#[non_exhaustive]
pub struct SyntheticsAPIWaitStep { pub name: String, pub subtype: SyntheticsAPIWaitStepSubtype, pub value: i32, pub additional_properties: BTreeMap<String, Value>, /* private fields */ }
Expand description

The Wait step used in a Synthetic multi-step API test.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The name of the step.

§subtype: SyntheticsAPIWaitStepSubtype

The subtype of the Synthetic multi-step API wait step.

§value: i32

The time to wait in seconds. Minimum value: 0. Maximum value: 180.

§additional_properties: BTreeMap<String, Value>

Implementations§

source§

impl SyntheticsAPIWaitStep

source

pub fn new( name: String, subtype: SyntheticsAPIWaitStepSubtype, value: i32, ) -> SyntheticsAPIWaitStep

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_1279271422.rs (line 89)
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
async fn main() {
    let body =
        SyntheticsAPITest::new(
            SyntheticsAPITestConfig::new()
                .config_variables(
                    vec![
                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
                            .example("content-type".to_string())
                            .pattern("content-type".to_string())
                    ],
                )
                .steps(
                    vec![
                        SyntheticsAPIStep::SyntheticsAPITestStep(
                            Box::new(
                                SyntheticsAPITestStep::new(
                                    vec![
                                        SyntheticsAssertion::SyntheticsAssertionTarget(
                                            Box::new(
                                                SyntheticsAssertionTarget::new(
                                                    SyntheticsAssertionOperator::IS,
                                                    Value::from(200),
                                                    SyntheticsAssertionType::STATUS_CODE,
                                                ),
                                            ),
                                        )
                                    ],
                                    "request is sent".to_string(),
                                    SyntheticsTestRequest::new()
                                        .http_version(SyntheticsTestOptionsHTTPVersion::HTTP2)
                                        .method("GET".to_string())
                                        .timeout(10.0 as f64)
                                        .url("https://datadoghq.com".to_string()),
                                    SyntheticsAPITestStepSubtype::HTTP,
                                )
                                    .allow_failure(true)
                                    .extracted_values(
                                        vec![
                                            SyntheticsParsingOptions::new()
                                                .field("server".to_string())
                                                .name("EXTRACTED_VALUE".to_string())
                                                .parser(
                                                    SyntheticsVariableParser::new(
                                                        SyntheticsGlobalVariableParserType::RAW,
                                                    ),
                                                )
                                                .secure(true)
                                                .type_(SyntheticsLocalVariableParsingOptionsType::HTTP_HEADER)
                                        ],
                                    )
                                    .is_critical(true)
                                    .retry(SyntheticsTestOptionsRetry::new().count(5).interval(1000.0 as f64)),
                            ),
                        ),
                        SyntheticsAPIStep::SyntheticsAPIWaitStep(
                            Box::new(
                                SyntheticsAPIWaitStep::new("Wait".to_string(), SyntheticsAPIWaitStepSubtype::WAIT, 1),
                            ),
                        ),
                        SyntheticsAPIStep::SyntheticsAPITestStep(
                            Box::new(
                                SyntheticsAPITestStep::new(
                                    vec![
                                        SyntheticsAssertion::SyntheticsAssertionTarget(
                                            Box::new(
                                                SyntheticsAssertionTarget::new(
                                                    SyntheticsAssertionOperator::LESS_THAN,
                                                    Value::from(1000),
                                                    SyntheticsAssertionType::RESPONSE_TIME,
                                                ),
                                            ),
                                        )
                                    ],
                                    "GRPC CALL".to_string(),
                                    SyntheticsTestRequest::new()
                                        .call_type(SyntheticsTestCallType::UNARY)
                                        .compressed_json_descriptor(
                                            "eJy1lU1z2yAQhv+Lzj74I3ETH506bQ7OZOSm1w4Wa4epBARQppqM/3v5koCJJdvtxCdW77vPssCO3zMKUgHOFu/ZXvBiS6hZho/f8qe7pftYgXphWJrlA8XwxywEvNba+6PhkC2yVcVVswYp0R6ykRYlZ1SCV21SDrxsssPIeS9FJKqGfK2rqnmmSBwhWa2XlKgtaQPiDcRGCUDVfwGD2sKUqKEtc1cSoOrsMlaMOec1sySYCCgUYRSVLv2zSva2u+FQkB0pVkIw8bFuIudOOn3pOaKYVT3Iy97Pd0AYhOx5QcMsnxvRHlnuLf8ETDd3CNtrv2nejkDpRnANCmGkkFn/hsYzpBKE7jVbufgnKnV9HRM9zRPDDKPttYT61n0TdWkAAjggk9AhuxIeaXd69CYTcsGw7cBTakLVbNpRzGEgyWjkSOpMbZXkhGL6oX30R49qt3GoHrap7i0XdD41WQ+2icCNm5p1hmFqnHNlcla0riKmDZ183crDxChjbnurtxHPRE784sVhWvDfGP+SsTKibU3o5NtWHuZFGZOxP6P5VXqIOvaOSec4eYohyd7NslHuJbd1bewds85xYrNxkr2d+5IhFWF3NvaO684xjE2S5ulY+tu64Pna0fCPJgzw6vF5/WucLcYjt5xoq19O3UDptOg/OamJQRaCcPPnMTQ2QDFn+uhPvUfnCrMc99upyQY4Ui9Dlc/YoG3R/v4Cs9YE+g==".to_string(),
                                        )
                                        .host("grpcbin.test.k6.io".to_string())
                                        .message("{}".to_string())
                                        .metadata(BTreeMap::from([]))
                                        .method("Index".to_string())
                                        .port("9000".to_string())
                                        .service("grpcbin.GRPCBin".to_string()),
                                    SyntheticsAPITestStepSubtype::GRPC,
                                )
                                    .allow_failure(false)
                                    .extracted_values(vec![])
                                    .is_critical(true)
                                    .retry(SyntheticsTestOptionsRetry::new().count(0).interval(300.0 as f64)),
                            ),
                        )
                    ],
                ),
            vec!["aws:us-east-2".to_string()],
            "BDD test payload: synthetics_api_test_multi_step_payload.json".to_string(),
            "Example-Synthetic".to_string(),
            SyntheticsTestOptions::new()
                .accept_self_signed(false)
                .allow_insecure(true)
                .follow_redirects(true)
                .min_failure_duration(10)
                .min_location_failed(1)
                .monitor_name("Example-Synthetic".to_string())
                .monitor_priority(5)
                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(1000.0 as f64))
                .tick_every(60),
            SyntheticsAPITestType::API,
        )
            .subtype(SyntheticsTestDetailsSubType::MULTI)
            .tags(vec!["testing:api".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.create_synthetics_api_test(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

source§

impl Clone for SyntheticsAPIWaitStep

source§

fn clone(&self) -> SyntheticsAPIWaitStep

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SyntheticsAPIWaitStep

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SyntheticsAPIWaitStep

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for SyntheticsAPIWaitStep

source§

fn eq(&self, other: &SyntheticsAPIWaitStep) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SyntheticsAPIWaitStep

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for SyntheticsAPIWaitStep

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,