Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions src/datadogV2/model/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
177 changes: 177 additions & 0 deletions src/datadogV2/model/model_dora_deployment_averaged_metrics.rs
Original file line number Diff line number Diff line change
@@ -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<i64>,
/// The averaged merge time, in seconds.
#[serde(rename = "merge_time")]
pub merge_time: Option<i64>,
/// The averaged review time, in seconds.
#[serde(rename = "review_time")]
pub review_time: Option<i64>,
/// The averaged time to deploy, in seconds.
#[serde(rename = "time_to_deploy")]
pub time_to_deploy: Option<i64>,
/// 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<i64>,
#[serde(flatten)]
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
#[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<String, serde_json::Value>,
) -> Self {
self.additional_properties = value;
self
}
}

impl Default for DORADeploymentAveragedMetrics {
fn default() -> Self {
Self::new()
}
}

impl<'de> Deserialize<'de> for DORADeploymentAveragedMetrics {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
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<M>(self, mut map: M) -> Result<Self::Value, M::Error>
where
M: MapAccess<'a>,
{
let mut change_lead_time: Option<i64> = None;
let mut merge_time: Option<i64> = None;
let mut review_time: Option<i64> = None;
let mut time_to_deploy: Option<i64> = None;
let mut time_to_pr_ready: Option<i64> = 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::<String, serde_json::Value>()? {
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)
}
}
Loading
Loading