From 48d3ce5c5350ac640fbafbd0b88744f453956bbc Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 9 Jul 2026 15:12:48 +0000 Subject: [PATCH] Regenerate client from commit 73b7a53 of spec repo --- .generator/schemas/v2/openapi.yaml | 7 ++++++- .../ListDegradations_3179419218.py | 19 +++++++++++++++++++ .../v2/api/status_pages_api.py | 13 ++++++++++++- tests/v2/features/status_pages.feature | 9 +++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 examples/v2/status-pages/ListDegradations_3179419218.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c2aa6fb686..6898e0df59 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -188770,7 +188770,7 @@ paths: - status_pages_settings_write /api/v2/statuspages/degradations: get: - description: Lists all degradations for the organization. Optionally filter by status and page. + description: Lists all degradations for the organization. Optionally filter by status, page, and source ID. operationId: ListDegradations parameters: - description: Optional page id filter. @@ -188802,6 +188802,11 @@ paths: name: filter[status] schema: type: string + - description: "Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID)." + in: query + name: filter[source_id] + schema: + type: string - description: "Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at." in: query name: sort diff --git a/examples/v2/status-pages/ListDegradations_3179419218.py b/examples/v2/status-pages/ListDegradations_3179419218.py new file mode 100644 index 0000000000..3c4f51a434 --- /dev/null +++ b/examples/v2/status-pages/ListDegradations_3179419218.py @@ -0,0 +1,19 @@ +""" +List degradations with source ID filter returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.status_pages_api import StatusPagesApi + +# there is a valid "degradation" in the system +DEGRADATION_DATA_ID = environ["DEGRADATION_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = StatusPagesApi(api_client) + response = api_instance.list_degradations( + filter_source_id=DEGRADATION_DATA_ID, + ) + + print(response) diff --git a/src/datadog_api_client/v2/api/status_pages_api.py b/src/datadog_api_client/v2/api/status_pages_api.py index b0c0452cf0..97812f7d59 100644 --- a/src/datadog_api_client/v2/api/status_pages_api.py +++ b/src/datadog_api_client/v2/api/status_pages_api.py @@ -551,6 +551,11 @@ def __init__(self, api_client=None): "attribute": "filter[status]", "location": "query", }, + "filter_source_id": { + "openapi_types": (str,), + "attribute": "filter[source_id]", + "location": "query", + }, "sort": { "openapi_types": (str,), "attribute": "sort", @@ -1302,11 +1307,12 @@ def list_degradations( page_limit: Union[int, UnsetType] = unset, include: Union[str, UnsetType] = unset, filter_status: Union[str, UnsetType] = unset, + filter_source_id: Union[str, UnsetType] = unset, sort: Union[str, UnsetType] = unset, ) -> DegradationArray: """List degradations. - Lists all degradations for the organization. Optionally filter by status and page. + Lists all degradations for the organization. Optionally filter by status, page, and source ID. :param filter_page_id: Optional page id filter. :type filter_page_id: str, optional @@ -1318,6 +1324,8 @@ def list_degradations( :type include: str, optional :param filter_status: Optional degradation status filter. Supported values: investigating, identified, monitoring, resolved. :type filter_status: str, optional + :param filter_source_id: Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID). + :type filter_source_id: str, optional :param sort: Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at. :type sort: str, optional :rtype: DegradationArray @@ -1338,6 +1346,9 @@ def list_degradations( if filter_status is not unset: kwargs["filter_status"] = filter_status + if filter_source_id is not unset: + kwargs["filter_source_id"] = filter_source_id + if sort is not unset: kwargs["sort"] = sort diff --git a/tests/v2/features/status_pages.feature b/tests/v2/features/status_pages.feature index 99cb8e3ed6..0d8ec89721 100644 --- a/tests/v2/features/status_pages.feature +++ b/tests/v2/features/status_pages.feature @@ -157,6 +157,15 @@ Feature: Status Pages When the request is sent Then the response status is 200 OK + @team:DataDog/incident-app + Scenario: List degradations with source ID filter returns "OK" response + Given new "ListDegradations" request + And there is a valid "status_page" in the system + And there is a valid "degradation" in the system + And request contains "filter[source_id]" parameter from "degradation.data.id" + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: List maintenances returns "OK" response Given there is a valid "status_page" in the system