From 78a5b440b5c0a1b4a091020c64adbee03bf31a75 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 15 Jul 2026 17:49:50 +0000 Subject: [PATCH] Regenerate client from commit e48f054 of spec repo --- .generator/schemas/v2/openapi.yaml | 7 +++++- ...tatus-pages_ListDegradations_3179419218.rs | 23 +++++++++++++++++++ src/datadogV2/api/api_status_pages.rs | 16 +++++++++++-- .../features/v2/status_pages.feature | 9 ++++++++ tests/scenarios/function_mappings.rs | 4 ++++ 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 examples/v2_status-pages_ListDegradations_3179419218.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bf4011c15..3114843c7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -190482,7 +190482,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. @@ -190514,6 +190514,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.rs b/examples/v2_status-pages_ListDegradations_3179419218.rs new file mode 100644 index 000000000..a8c0b6dc4 --- /dev/null +++ b/examples/v2_status-pages_ListDegradations_3179419218.rs @@ -0,0 +1,23 @@ +// List degradations with source ID filter returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_status_pages::ListDegradationsOptionalParams; +use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI; + +#[tokio::main] +async fn main() { + // there is a valid "degradation" in the system + let degradation_data_id = uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap()) + .expect("Invalid UUID"); + let configuration = datadog::Configuration::new(); + let api = StatusPagesAPI::with_config(configuration); + let resp = api + .list_degradations( + ListDegradationsOptionalParams::default().filter_source_id(degradation_data_id.clone()), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/src/datadogV2/api/api_status_pages.rs b/src/datadogV2/api/api_status_pages.rs index 01a2a1f33..240fb0e56 100644 --- a/src/datadogV2/api/api_status_pages.rs +++ b/src/datadogV2/api/api_status_pages.rs @@ -230,6 +230,8 @@ pub struct ListDegradationsOptionalParams { pub include: Option, /// Optional degradation status filter. Supported values: investigating, identified, monitoring, resolved. pub filter_status: Option, + /// Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID). + pub filter_source_id: Option, /// Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at. pub sort: Option, } @@ -260,6 +262,11 @@ impl ListDegradationsOptionalParams { self.filter_status = Some(value); self } + /// Optional source ID filter. Returns only degradations whose source matches this ID (e.g. an incident ID). + pub fn filter_source_id(mut self, value: String) -> Self { + self.filter_source_id = Some(value); + self + } /// Sort order. Prefix with '-' for descending. Supported values: created_at, -created_at, modified_at, -modified_at. pub fn sort(mut self, value: String) -> Self { self.sort = Some(value); @@ -2776,7 +2783,7 @@ impl StatusPagesAPI { } } - /// 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. pub async fn list_degradations( &self, params: ListDegradationsOptionalParams, @@ -2796,7 +2803,7 @@ impl StatusPagesAPI { } } - /// 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. pub async fn list_degradations_with_http_info( &self, params: ListDegradationsOptionalParams, @@ -2813,6 +2820,7 @@ impl StatusPagesAPI { let page_limit = params.page_limit; let include = params.include; let filter_status = params.filter_status; + let filter_source_id = params.filter_source_id; let sort = params.sort; let local_client = &self.client; @@ -2844,6 +2852,10 @@ impl StatusPagesAPI { local_req_builder = local_req_builder.query(&[("filter[status]", &local_query_param.to_string())]); }; + if let Some(ref local_query_param) = filter_source_id { + local_req_builder = + local_req_builder.query(&[("filter[source_id]", &local_query_param.to_string())]); + }; if let Some(ref local_query_param) = sort { local_req_builder = local_req_builder.query(&[("sort", &local_query_param.to_string())]); diff --git a/tests/scenarios/features/v2/status_pages.feature b/tests/scenarios/features/v2/status_pages.feature index 99cb8e3ed..0d8ec8972 100644 --- a/tests/scenarios/features/v2/status_pages.feature +++ b/tests/scenarios/features/v2/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 diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index f3d378346..9a640527f 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -57720,6 +57720,9 @@ fn test_v2_list_degradations(world: &mut DatadogWorld, _parameters: &HashMap response,