@@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
11
11
#[ skip_serializing_none]
12
12
#[ derive( Clone , Debug , PartialEq , Serialize ) ]
13
13
pub struct SyntheticsStepDetail {
14
+ /// Whether or not the step was allowed to fail.
15
+ #[ serde( rename = "allowFailure" ) ]
16
+ pub allow_failure : Option < bool > ,
14
17
/// Array of errors collected for a browser test.
15
18
#[ serde( rename = "browserErrors" ) ]
16
19
pub browser_errors : Option < Vec < crate :: datadogV1:: model:: SyntheticsBrowserError > > ,
@@ -26,6 +29,9 @@ pub struct SyntheticsStepDetail {
26
29
/// Error returned by the test.
27
30
#[ serde( rename = "error" ) ]
28
31
pub error : Option < String > ,
32
+ /// The browser test failure details.
33
+ #[ serde( rename = "failure" ) ]
34
+ pub failure : Option < crate :: datadogV1:: model:: SyntheticsBrowserTestResultFailure > ,
29
35
/// Navigate between different tabs for your browser test.
30
36
#[ serde( rename = "playingTab" ) ]
31
37
pub playing_tab : Option < crate :: datadogV1:: model:: SyntheticsPlayingTab > ,
@@ -73,11 +79,13 @@ pub struct SyntheticsStepDetail {
73
79
impl SyntheticsStepDetail {
74
80
pub fn new ( ) -> SyntheticsStepDetail {
75
81
SyntheticsStepDetail {
82
+ allow_failure : None ,
76
83
browser_errors : None ,
77
84
check_type : None ,
78
85
description : None ,
79
86
duration : None ,
80
87
error : None ,
88
+ failure : None ,
81
89
playing_tab : None ,
82
90
screenshot_bucket_key : None ,
83
91
skipped : None ,
@@ -95,6 +103,11 @@ impl SyntheticsStepDetail {
95
103
}
96
104
}
97
105
106
+ pub fn allow_failure ( mut self , value : bool ) -> Self {
107
+ self . allow_failure = Some ( value) ;
108
+ self
109
+ }
110
+
98
111
pub fn browser_errors (
99
112
mut self ,
100
113
value : Vec < crate :: datadogV1:: model:: SyntheticsBrowserError > ,
@@ -123,6 +136,14 @@ impl SyntheticsStepDetail {
123
136
self
124
137
}
125
138
139
+ pub fn failure (
140
+ mut self ,
141
+ value : crate :: datadogV1:: model:: SyntheticsBrowserTestResultFailure ,
142
+ ) -> Self {
143
+ self . failure = Some ( value) ;
144
+ self
145
+ }
146
+
126
147
pub fn playing_tab ( mut self , value : crate :: datadogV1:: model:: SyntheticsPlayingTab ) -> Self {
127
148
self . playing_tab = Some ( value) ;
128
149
self
@@ -224,13 +245,17 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
224
245
where
225
246
M : MapAccess < ' a > ,
226
247
{
248
+ let mut allow_failure: Option < bool > = None ;
227
249
let mut browser_errors: Option <
228
250
Vec < crate :: datadogV1:: model:: SyntheticsBrowserError > ,
229
251
> = None ;
230
252
let mut check_type: Option < crate :: datadogV1:: model:: SyntheticsCheckType > = None ;
231
253
let mut description: Option < String > = None ;
232
254
let mut duration: Option < f64 > = None ;
233
255
let mut error: Option < String > = None ;
256
+ let mut failure: Option <
257
+ crate :: datadogV1:: model:: SyntheticsBrowserTestResultFailure ,
258
+ > = None ;
234
259
let mut playing_tab: Option < crate :: datadogV1:: model:: SyntheticsPlayingTab > = None ;
235
260
let mut screenshot_bucket_key: Option < bool > = None ;
236
261
let mut skipped: Option < bool > = None ;
@@ -257,6 +282,13 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
257
282
258
283
while let Some ( ( k, v) ) = map. next_entry :: < String , serde_json:: Value > ( ) ? {
259
284
match k. as_str ( ) {
285
+ "allowFailure" => {
286
+ if v. is_null ( ) {
287
+ continue ;
288
+ }
289
+ allow_failure =
290
+ Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
291
+ }
260
292
"browserErrors" => {
261
293
if v. is_null ( ) {
262
294
continue ;
@@ -297,6 +329,12 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
297
329
}
298
330
error = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
299
331
}
332
+ "failure" => {
333
+ if v. is_null ( ) {
334
+ continue ;
335
+ }
336
+ failure = Some ( serde_json:: from_value ( v) . map_err ( M :: Error :: custom) ?) ;
337
+ }
300
338
"playingTab" => {
301
339
if v. is_null ( ) {
302
340
continue ;
@@ -402,11 +440,13 @@ impl<'de> Deserialize<'de> for SyntheticsStepDetail {
402
440
}
403
441
404
442
let content = SyntheticsStepDetail {
443
+ allow_failure,
405
444
browser_errors,
406
445
check_type,
407
446
description,
408
447
duration,
409
448
error,
449
+ failure,
410
450
playing_tab,
411
451
screenshot_bucket_key,
412
452
skipped,
0 commit comments