Skip to content

Add synthetics stepDetail.allowFailure and stepDetail.failure #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-21 20:59:47.825157",
"spec_repo_commit": "9ac9609b"
"regenerated": "2024-10-23 10:08:19.228929",
"spec_repo_commit": "df3187ca"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-10-21 20:59:47.843315",
"spec_repo_commit": "9ac9609b"
"regenerated": "2024-10-23 10:08:19.247211",
"spec_repo_commit": "df3187ca"
}
}
}
5 changes: 5 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16168,6 +16168,9 @@ components:
SyntheticsStepDetail:
description: Object describing a step for a Synthetic test.
properties:
allowFailure:
description: Whether or not the step was allowed to fail.
type: boolean
browserErrors:
description: Array of errors collected for a browser test.
items:
Expand All @@ -16185,6 +16188,8 @@ components:
error:
description: Error returned by the test.
type: string
failure:
$ref: '#/components/schemas/SyntheticsBrowserTestResultFailure'
playingTab:
$ref: '#/components/schemas/SyntheticsPlayingTab'
screenshotBucketKey:
Expand Down
40 changes: 40 additions & 0 deletions src/datadogV1/model/model_synthetics_step_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct SyntheticsStepDetail {
/// Whether or not the step was allowed to fail.
#[serde(rename = "allowFailure")]
pub allow_failure: Option<bool>,
/// Array of errors collected for a browser test.
#[serde(rename = "browserErrors")]
pub browser_errors: Option<Vec<crate::datadogV1::model::SyntheticsBrowserError>>,
Expand All @@ -26,6 +29,9 @@ pub struct SyntheticsStepDetail {
/// Error returned by the test.
#[serde(rename = "error")]
pub error: Option<String>,
/// The browser test failure details.
#[serde(rename = "failure")]
pub failure: Option<crate::datadogV1::model::SyntheticsBrowserTestResultFailure>,
/// Navigate between different tabs for your browser test.
#[serde(rename = "playingTab")]
pub playing_tab: Option<crate::datadogV1::model::SyntheticsPlayingTab>,
Expand Down Expand Up @@ -73,11 +79,13 @@ pub struct SyntheticsStepDetail {
impl SyntheticsStepDetail {
pub fn new() -> SyntheticsStepDetail {
SyntheticsStepDetail {
allow_failure: None,
browser_errors: None,
check_type: None,
description: None,
duration: None,
error: None,
failure: None,
playing_tab: None,
screenshot_bucket_key: None,
skipped: None,
Expand All @@ -95,6 +103,11 @@ impl SyntheticsStepDetail {
}
}

pub fn allow_failure(mut self, value: bool) -> Self {
self.allow_failure = Some(value);
self
}

pub fn browser_errors(
mut self,
value: Vec<crate::datadogV1::model::SyntheticsBrowserError>,
Expand Down Expand Up @@ -123,6 +136,14 @@ impl SyntheticsStepDetail {
self
}

pub fn failure(
mut self,
value: crate::datadogV1::model::SyntheticsBrowserTestResultFailure,
) -> Self {
self.failure = Some(value);
self
}

pub fn playing_tab(mut self, value: crate::datadogV1::model::SyntheticsPlayingTab) -> Self {
self.playing_tab = Some(value);
self
Expand Down Expand Up @@ -224,13 +245,17 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
where
M: MapAccess<'a>,
{
let mut allow_failure: Option<bool> = None;
let mut browser_errors: Option<
Vec<crate::datadogV1::model::SyntheticsBrowserError>,
> = None;
let mut check_type: Option<crate::datadogV1::model::SyntheticsCheckType> = None;
let mut description: Option<String> = None;
let mut duration: Option<f64> = None;
let mut error: Option<String> = None;
let mut failure: Option<
crate::datadogV1::model::SyntheticsBrowserTestResultFailure,
> = None;
let mut playing_tab: Option<crate::datadogV1::model::SyntheticsPlayingTab> = None;
let mut screenshot_bucket_key: Option<bool> = None;
let mut skipped: Option<bool> = None;
Expand All @@ -257,6 +282,13 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"allowFailure" => {
if v.is_null() {
continue;
}
allow_failure =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"browserErrors" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -297,6 +329,12 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
}
error = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"failure" => {
if v.is_null() {
continue;
}
failure = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"playingTab" => {
if v.is_null() {
continue;
Expand Down Expand Up @@ -402,11 +440,13 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
}

let content = SyntheticsStepDetail {
allow_failure,
browser_errors,
check_type,
description,
duration,
error,
failure,
playing_tab,
screenshot_bucket_key,
skipped,
Expand Down
Loading