From ed6ca1b7046401fda634f964e387d1b066601ad7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 27 Aug 2026 07:58:19 +0000 Subject: [PATCH] Regenerate client from commit fb473a3 of spec repo --- .generator/schemas/v2/openapi.yaml | 103 +++++++ src/datadogV2/model/mod.rs | 4 + .../model_dora_deployment_averaged_metrics.rs | 177 ++++++++++++ ...model_dora_deployment_object_attributes.rs | 266 ++++++++++++++++++ .../model_dora_deployment_remediation.rs | 122 ++++++++ 5 files changed, 672 insertions(+) create mode 100644 src/datadogV2/model/model_dora_deployment_averaged_metrics.rs create mode 100644 src/datadogV2/model/model_dora_deployment_remediation.rs diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e24a358f1b..43de804db3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29903,6 +29903,35 @@ components: type: string nullable: true type: array + DORADeploymentAveragedMetrics: + description: Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + properties: + change_lead_time: + description: The averaged change lead time, in seconds. + example: 166821 + format: int64 + type: integer + merge_time: + description: The averaged merge time, in seconds. + example: 5852 + format: int64 + type: integer + review_time: + description: The averaged review time, in seconds. + example: 140 + format: int64 + type: integer + time_to_deploy: + description: The averaged time to deploy, in seconds. + example: 164481 + format: int64 + type: integer + time_to_pr_ready: + description: The averaged time until the pull request was ready for review, in seconds. + example: 27 + format: int64 + type: integer + type: object DORADeploymentFetchResponse: description: Response for fetching a single deployment event. properties: @@ -29940,8 +29969,43 @@ components: DORADeploymentObjectAttributes: description: The attributes of the deployment event. properties: + ai: + additionalProperties: {} + description: AI-assisted development metrics aggregated across the commits and pull requests included in the deployment. + type: object + averaged_metrics: + $ref: "#/components/schemas/DORADeploymentAveragedMetrics" + change_failure: + description: Whether the deployment is flagged as a change failure. + example: false + type: boolean + commits: + description: The list of commits included in the deployment. + items: + additionalProperties: {} + type: object + type: array + created_at: + description: The time when the deployment event was recorded. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string + custom: + additionalProperties: {} + description: A map of custom metadata associated with the deployment. + example: {"service": ["courier-cloud"]} + type: object custom_tags: $ref: "#/components/schemas/DORACustomTags" + deployment_type: + description: The type of the deployment. + example: standard + type: string + duration: + description: The duration of the deployment. + example: 0 + format: int64 + type: integer env: description: Environment name to where the service was deployed. example: production @@ -29953,10 +30017,37 @@ components: type: string git: $ref: "#/components/schemas/DORAGitInfoResponse" + number_of_commits: + description: The number of commits associated with the deployment. + example: 5 + format: int64 + type: integer + number_of_pull_requests: + description: The number of pull requests associated with the deployment. + example: 1 + format: int64 + type: integer + pull_requests: + description: The list of pull requests included in the deployment. + items: + additionalProperties: {} + type: object + type: array + recovery_time_sec: + description: The recovery time, in seconds, for a deployment flagged as a change failure. + example: 28230 + format: int64 + type: integer + remediation: + $ref: "#/components/schemas/DORADeploymentRemediation" service: description: Service name. example: shopist type: string + source: + description: The source of the deployment event. + example: apm_deployments + type: string started_at: description: The time when the deployment started. example: "2023-08-31T14:26:14Z" @@ -30148,6 +30239,18 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT_PATCH_REQUEST + DORADeploymentRemediation: + description: Remediation details for a deployment that was flagged as a change failure. + properties: + id: + description: The ID of the remediation deployment. + example: eG42zNIkVjM + type: string + type: + description: The type of remediation, such as a rollback. + example: rollback + type: string + type: object DORADeploymentRequest: description: Request to create a DORA deployment event. properties: diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index 8a24dc5642..2178dd4e82 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -3724,8 +3724,12 @@ pub mod model_dora_deployment_object; pub use self::model_dora_deployment_object::DORADeploymentObject; pub mod model_dora_deployment_object_attributes; pub use self::model_dora_deployment_object_attributes::DORADeploymentObjectAttributes; +pub mod model_dora_deployment_averaged_metrics; +pub use self::model_dora_deployment_averaged_metrics::DORADeploymentAveragedMetrics; pub mod model_dora_git_info_response; pub use self::model_dora_git_info_response::DORAGitInfoResponse; +pub mod model_dora_deployment_remediation; +pub use self::model_dora_deployment_remediation::DORADeploymentRemediation; pub mod model_dora_deployment_fetch_response; pub use self::model_dora_deployment_fetch_response::DORADeploymentFetchResponse; pub mod model_dora_deployment_patch_request; diff --git a/src/datadogV2/model/model_dora_deployment_averaged_metrics.rs b/src/datadogV2/model/model_dora_deployment_averaged_metrics.rs new file mode 100644 index 0000000000..11195da5d1 --- /dev/null +++ b/src/datadogV2/model/model_dora_deployment_averaged_metrics.rs @@ -0,0 +1,177 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct DORADeploymentAveragedMetrics { + /// The averaged change lead time, in seconds. + #[serde(rename = "change_lead_time")] + pub change_lead_time: Option, + /// The averaged merge time, in seconds. + #[serde(rename = "merge_time")] + pub merge_time: Option, + /// The averaged review time, in seconds. + #[serde(rename = "review_time")] + pub review_time: Option, + /// The averaged time to deploy, in seconds. + #[serde(rename = "time_to_deploy")] + pub time_to_deploy: Option, + /// The averaged time until the pull request was ready for review, in seconds. + #[serde(rename = "time_to_pr_ready")] + pub time_to_pr_ready: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl DORADeploymentAveragedMetrics { + pub fn new() -> DORADeploymentAveragedMetrics { + DORADeploymentAveragedMetrics { + change_lead_time: None, + merge_time: None, + review_time: None, + time_to_deploy: None, + time_to_pr_ready: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn change_lead_time(mut self, value: i64) -> Self { + self.change_lead_time = Some(value); + self + } + + pub fn merge_time(mut self, value: i64) -> Self { + self.merge_time = Some(value); + self + } + + pub fn review_time(mut self, value: i64) -> Self { + self.review_time = Some(value); + self + } + + pub fn time_to_deploy(mut self, value: i64) -> Self { + self.time_to_deploy = Some(value); + self + } + + pub fn time_to_pr_ready(mut self, value: i64) -> Self { + self.time_to_pr_ready = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for DORADeploymentAveragedMetrics { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for DORADeploymentAveragedMetrics { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct DORADeploymentAveragedMetricsVisitor; + impl<'a> Visitor<'a> for DORADeploymentAveragedMetricsVisitor { + type Value = DORADeploymentAveragedMetrics; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut change_lead_time: Option = None; + let mut merge_time: Option = None; + let mut review_time: Option = None; + let mut time_to_deploy: Option = None; + let mut time_to_pr_ready: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "change_lead_time" => { + if v.is_null() { + continue; + } + change_lead_time = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "merge_time" => { + if v.is_null() { + continue; + } + merge_time = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "review_time" => { + if v.is_null() { + continue; + } + review_time = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "time_to_deploy" => { + if v.is_null() { + continue; + } + time_to_deploy = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "time_to_pr_ready" => { + if v.is_null() { + continue; + } + time_to_pr_ready = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = DORADeploymentAveragedMetrics { + change_lead_time, + merge_time, + review_time, + time_to_deploy, + time_to_pr_ready, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(DORADeploymentAveragedMetricsVisitor) + } +} diff --git a/src/datadogV2/model/model_dora_deployment_object_attributes.rs b/src/datadogV2/model/model_dora_deployment_object_attributes.rs index 01ab6e28eb..0acc465fb4 100644 --- a/src/datadogV2/model/model_dora_deployment_object_attributes.rs +++ b/src/datadogV2/model/model_dora_deployment_object_attributes.rs @@ -11,6 +11,24 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct DORADeploymentObjectAttributes { + /// AI-assisted development metrics aggregated across the commits and pull requests included in the deployment. + #[serde(rename = "ai")] + pub ai: Option>, + /// Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + #[serde(rename = "averaged_metrics")] + pub averaged_metrics: Option, + /// Whether the deployment is flagged as a change failure. + #[serde(rename = "change_failure")] + pub change_failure: Option, + /// The list of commits included in the deployment. + #[serde(rename = "commits")] + pub commits: Option>>, + /// The time when the deployment event was recorded. + #[serde(rename = "created_at")] + pub created_at: Option>, + /// A map of custom metadata associated with the deployment. + #[serde(rename = "custom")] + pub custom: Option>, /// A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. #[serde( rename = "custom_tags", @@ -18,6 +36,12 @@ pub struct DORADeploymentObjectAttributes { with = "::serde_with::rust::double_option" )] pub custom_tags: Option>>, + /// The type of the deployment. + #[serde(rename = "deployment_type")] + pub deployment_type: Option, + /// The duration of the deployment. + #[serde(rename = "duration")] + pub duration: Option, /// Environment name to where the service was deployed. #[serde(rename = "env")] pub env: Option, @@ -27,9 +51,27 @@ pub struct DORADeploymentObjectAttributes { /// Git info returned by DORA Metrics events. #[serde(rename = "git")] pub git: Option, + /// The number of commits associated with the deployment. + #[serde(rename = "number_of_commits")] + pub number_of_commits: Option, + /// The number of pull requests associated with the deployment. + #[serde(rename = "number_of_pull_requests")] + pub number_of_pull_requests: Option, + /// The list of pull requests included in the deployment. + #[serde(rename = "pull_requests")] + pub pull_requests: Option>>, + /// The recovery time, in seconds, for a deployment flagged as a change failure. + #[serde(rename = "recovery_time_sec")] + pub recovery_time_sec: Option, + /// Remediation details for a deployment that was flagged as a change failure. + #[serde(rename = "remediation")] + pub remediation: Option, /// Service name. #[serde(rename = "service")] pub service: String, + /// The source of the deployment event. + #[serde(rename = "source")] + pub source: Option, /// The time when the deployment started. #[serde(rename = "started_at")] pub started_at: chrono::DateTime, @@ -52,11 +94,25 @@ impl DORADeploymentObjectAttributes { started_at: chrono::DateTime, ) -> DORADeploymentObjectAttributes { DORADeploymentObjectAttributes { + ai: None, + averaged_metrics: None, + change_failure: None, + commits: None, + created_at: None, + custom: None, custom_tags: None, + deployment_type: None, + duration: None, env: None, finished_at: None, git: None, + number_of_commits: None, + number_of_pull_requests: None, + pull_requests: None, + recovery_time_sec: None, + remediation: None, service, + source: None, started_at, team: None, version: None, @@ -65,11 +121,57 @@ impl DORADeploymentObjectAttributes { } } + pub fn ai(mut self, value: std::collections::BTreeMap) -> Self { + self.ai = Some(value); + self + } + + pub fn averaged_metrics( + mut self, + value: crate::datadogV2::model::DORADeploymentAveragedMetrics, + ) -> Self { + self.averaged_metrics = Some(value); + self + } + + pub fn change_failure(mut self, value: bool) -> Self { + self.change_failure = Some(value); + self + } + + pub fn commits( + mut self, + value: Vec>, + ) -> Self { + self.commits = Some(value); + self + } + + pub fn created_at(mut self, value: chrono::DateTime) -> Self { + self.created_at = Some(value); + self + } + + pub fn custom(mut self, value: std::collections::BTreeMap) -> Self { + self.custom = Some(value); + self + } + pub fn custom_tags(mut self, value: Option>) -> Self { self.custom_tags = Some(value); self } + pub fn deployment_type(mut self, value: String) -> Self { + self.deployment_type = Some(value); + self + } + + pub fn duration(mut self, value: i64) -> Self { + self.duration = Some(value); + self + } + pub fn env(mut self, value: String) -> Self { self.env = Some(value); self @@ -85,6 +187,42 @@ impl DORADeploymentObjectAttributes { self } + pub fn number_of_commits(mut self, value: i64) -> Self { + self.number_of_commits = Some(value); + self + } + + pub fn number_of_pull_requests(mut self, value: i64) -> Self { + self.number_of_pull_requests = Some(value); + self + } + + pub fn pull_requests( + mut self, + value: Vec>, + ) -> Self { + self.pull_requests = Some(value); + self + } + + pub fn recovery_time_sec(mut self, value: i64) -> Self { + self.recovery_time_sec = Some(value); + self + } + + pub fn remediation( + mut self, + value: crate::datadogV2::model::DORADeploymentRemediation, + ) -> Self { + self.remediation = Some(value); + self + } + + pub fn source(mut self, value: String) -> Self { + self.source = Some(value); + self + } + pub fn team(mut self, value: String) -> Self { self.team = Some(value); self @@ -121,11 +259,33 @@ impl<'de> Deserialize<'de> for DORADeploymentObjectAttributes { where M: MapAccess<'a>, { + let mut ai: Option> = None; + let mut averaged_metrics: Option< + crate::datadogV2::model::DORADeploymentAveragedMetrics, + > = None; + let mut change_failure: Option = None; + let mut commits: Option< + Vec>, + > = None; + let mut created_at: Option> = None; + let mut custom: Option> = + None; let mut custom_tags: Option>> = None; + let mut deployment_type: Option = None; + let mut duration: Option = None; let mut env: Option = None; let mut finished_at: Option> = None; let mut git: Option = None; + let mut number_of_commits: Option = None; + let mut number_of_pull_requests: Option = None; + let mut pull_requests: Option< + Vec>, + > = None; + let mut recovery_time_sec: Option = None; + let mut remediation: Option = + None; let mut service: Option = None; + let mut source: Option = None; let mut started_at: Option> = None; let mut team: Option = None; let mut version: Option = None; @@ -137,10 +297,61 @@ impl<'de> Deserialize<'de> for DORADeploymentObjectAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { + "ai" => { + if v.is_null() { + continue; + } + ai = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "averaged_metrics" => { + if v.is_null() { + continue; + } + averaged_metrics = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "change_failure" => { + if v.is_null() { + continue; + } + change_failure = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "commits" => { + if v.is_null() { + continue; + } + commits = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + if v.is_null() { + continue; + } + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "custom" => { + if v.is_null() { + continue; + } + custom = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "custom_tags" => { custom_tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "deployment_type" => { + if v.is_null() { + continue; + } + deployment_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "duration" => { + if v.is_null() { + continue; + } + duration = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "env" => { if v.is_null() { continue; @@ -160,9 +371,50 @@ impl<'de> Deserialize<'de> for DORADeploymentObjectAttributes { } git = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "number_of_commits" => { + if v.is_null() { + continue; + } + number_of_commits = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "number_of_pull_requests" => { + if v.is_null() { + continue; + } + number_of_pull_requests = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "pull_requests" => { + if v.is_null() { + continue; + } + pull_requests = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "recovery_time_sec" => { + if v.is_null() { + continue; + } + recovery_time_sec = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "remediation" => { + if v.is_null() { + continue; + } + remediation = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "service" => { service = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "source" => { + if v.is_null() { + continue; + } + source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "started_at" => { started_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } @@ -189,11 +441,25 @@ impl<'de> Deserialize<'de> for DORADeploymentObjectAttributes { let started_at = started_at.ok_or_else(|| M::Error::missing_field("started_at"))?; let content = DORADeploymentObjectAttributes { + ai, + averaged_metrics, + change_failure, + commits, + created_at, + custom, custom_tags, + deployment_type, + duration, env, finished_at, git, + number_of_commits, + number_of_pull_requests, + pull_requests, + recovery_time_sec, + remediation, service, + source, started_at, team, version, diff --git a/src/datadogV2/model/model_dora_deployment_remediation.rs b/src/datadogV2/model/model_dora_deployment_remediation.rs new file mode 100644 index 0000000000..4abb7a5fbc --- /dev/null +++ b/src/datadogV2/model/model_dora_deployment_remediation.rs @@ -0,0 +1,122 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Remediation details for a deployment that was flagged as a change failure. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct DORADeploymentRemediation { + /// The ID of the remediation deployment. + #[serde(rename = "id")] + pub id: Option, + /// The type of remediation, such as a rollback. + #[serde(rename = "type")] + pub type_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl DORADeploymentRemediation { + pub fn new() -> DORADeploymentRemediation { + DORADeploymentRemediation { + id: None, + type_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_(mut self, value: String) -> Self { + self.type_ = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for DORADeploymentRemediation { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for DORADeploymentRemediation { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct DORADeploymentRemediationVisitor; + impl<'a> Visitor<'a> for DORADeploymentRemediationVisitor { + type Value = DORADeploymentRemediation; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "id" => { + if v.is_null() { + continue; + } + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + if v.is_null() { + continue; + } + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = DORADeploymentRemediation { + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(DORADeploymentRemediationVisitor) + } +}