#[non_exhaustive]
pub struct SyntheticsBasicAuthWeb { pub password: String, pub type_: Option<SyntheticsBasicAuthWebType>, pub username: String, pub additional_properties: BTreeMap<String, Value>, /* private fields */ }
Expand description

Object to handle basic authentication when performing the 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.
§password: String

Password to use for the basic authentication.

§type_: Option<SyntheticsBasicAuthWebType>

The type of basic authentication to use when performing the test.

§username: String

Username to use for the basic authentication.

§additional_properties: BTreeMap<String, Value>

Implementations§

source§

impl SyntheticsBasicAuthWeb

source

pub fn new(password: String, username: String) -> SyntheticsBasicAuthWeb

Examples found in repository?
examples/v1_synthetics_TriggerCITests.rs (line 22)
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
async fn main() {
    let body =
        SyntheticsCITestBody::new().tests(vec![SyntheticsCITest::new("aaa-aaa-aaa".to_string())
            .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                    .type_(SyntheticsBasicAuthWebType::WEB),
            )))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .locations(vec!["aws:eu-west-3".to_string()])
            .metadata(
                SyntheticsCIBatchMetadata::new()
                    .ci(SyntheticsCIBatchMetadataCI::new()
                        .pipeline(SyntheticsCIBatchMetadataPipeline::new())
                        .provider(SyntheticsCIBatchMetadataProvider::new()))
                    .git(SyntheticsCIBatchMetadataGit::new()),
            )
            .retry(SyntheticsTestOptionsRetry::new())]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.trigger_ci_tests(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_UpdateBrowserTest.rs (line 42)
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
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                    SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                        .type_(SyntheticsBasicAuthWebType::WEB),
                )))
                .body_type(SyntheticsTestRequestBodyType::TEXT_PLAIN)
                .call_type(SyntheticsTestCallType::UNARY)
                .certificate(
                    SyntheticsTestRequestCertificate::new()
                        .cert(SyntheticsTestRequestCertificateItem::new())
                        .key(SyntheticsTestRequestCertificateItem::new()),
                )
                .certificate_domains(vec![])
                .files(vec![SyntheticsTestRequestBodyFile::new()])
                .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
                .proxy(SyntheticsTestRequestProxy::new(
                    "https://example.com".to_string(),
                ))
                .service("Greeter".to_string())
                .url("https://example.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .secure(false)])
        .variables(vec![SyntheticsBrowserVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsBrowserVariableType::TEXT,
        )]),
        vec!["aws:eu-west-3".to_string()],
        "".to_string(),
        "Example test name".to_string(),
        SyntheticsTestOptions::new()
            .ci(SyntheticsTestCiOptions::new()
                .execution_rule(SyntheticsTestExecutionRule::BLOCKING))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
            .monitor_options(SyntheticsTestOptionsMonitorOptions::new())
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
            .retry(SyntheticsTestOptionsRetry::new())
            .rum_settings(
                SyntheticsBrowserTestRumSettings::new(true)
                    .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
                    .client_token_id(12345),
            )
            .scheduling(
                SyntheticsTestOptionsScheduling::new()
                    .timeframes(vec![
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(1)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(3)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                    ])
                    .timezone("America/New_York".to_string()),
            ),
        SyntheticsBrowserTestType::BROWSER,
    )
    .status(SyntheticsTestPauseStatus::LIVE)
    .steps(vec![
        SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT)
    ])
    .tags(vec!["env:prod".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.update_browser_test("public_id".to_string(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest_1717840259.rs (line 49)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new().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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                        SyntheticsBasicAuthWeb::new("password".to_string(), "username".to_string()),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                        SyntheticsBasicAuthWeb::new("password".to_string(), "username".to_string())
                            .type_(SyntheticsBasicAuthWebType::WEB),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthSigv4(Box::new(
                        SyntheticsBasicAuthSigv4::new(
                            "accessKey".to_string(),
                            "secretKey".to_string(),
                            SyntheticsBasicAuthSigv4Type::SIGV4,
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthNTLM(Box::new(
                        SyntheticsBasicAuthNTLM::new(SyntheticsBasicAuthNTLMType::NTLM),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthDigest(Box::new(
                        SyntheticsBasicAuthDigest::new(
                            "password".to_string(),
                            SyntheticsBasicAuthDigestType::DIGEST,
                            "username".to_string(),
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthClient(
                        Box::new(SyntheticsBasicAuthOauthClient::new(
                            "accessTokenUrl".to_string(),
                            "clientId".to_string(),
                            "clientSecret".to_string(),
                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
                            SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
                        )),
                    ))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(Box::new(
                        SyntheticsBasicAuthOauthROP::new(
                            "accessTokenUrl".to_string(),
                            "password".to_string(),
                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
                            SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
                            "username".to_string(),
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
        ]),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json"
            .to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new().tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::MULTI);
    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 type_(self, value: SyntheticsBasicAuthWebType) -> Self

Examples found in repository?
examples/v1_synthetics_TriggerCITests.rs (line 23)
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
async fn main() {
    let body =
        SyntheticsCITestBody::new().tests(vec![SyntheticsCITest::new("aaa-aaa-aaa".to_string())
            .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                    .type_(SyntheticsBasicAuthWebType::WEB),
            )))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .locations(vec!["aws:eu-west-3".to_string()])
            .metadata(
                SyntheticsCIBatchMetadata::new()
                    .ci(SyntheticsCIBatchMetadataCI::new()
                        .pipeline(SyntheticsCIBatchMetadataPipeline::new())
                        .provider(SyntheticsCIBatchMetadataProvider::new()))
                    .git(SyntheticsCIBatchMetadataGit::new()),
            )
            .retry(SyntheticsTestOptionsRetry::new())]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.trigger_ci_tests(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v1_synthetics_UpdateBrowserTest.rs (line 43)
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
async fn main() {
    let body = SyntheticsBrowserTest::new(
        SyntheticsBrowserTestConfig::new(
            vec![],
            SyntheticsTestRequest::new()
                .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                    SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string())
                        .type_(SyntheticsBasicAuthWebType::WEB),
                )))
                .body_type(SyntheticsTestRequestBodyType::TEXT_PLAIN)
                .call_type(SyntheticsTestCallType::UNARY)
                .certificate(
                    SyntheticsTestRequestCertificate::new()
                        .cert(SyntheticsTestRequestCertificateItem::new())
                        .key(SyntheticsTestRequestCertificateItem::new()),
                )
                .certificate_domains(vec![])
                .files(vec![SyntheticsTestRequestBodyFile::new()])
                .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
                .proxy(SyntheticsTestRequestProxy::new(
                    "https://example.com".to_string(),
                ))
                .service("Greeter".to_string())
                .url("https://example.com".to_string()),
        )
        .config_variables(vec![SyntheticsConfigVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsConfigVariableType::TEXT,
        )
        .secure(false)])
        .variables(vec![SyntheticsBrowserVariable::new(
            "VARIABLE_NAME".to_string(),
            SyntheticsBrowserVariableType::TEXT,
        )]),
        vec!["aws:eu-west-3".to_string()],
        "".to_string(),
        "Example test name".to_string(),
        SyntheticsTestOptions::new()
            .ci(SyntheticsTestCiOptions::new()
                .execution_rule(SyntheticsTestExecutionRule::BLOCKING))
            .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE])
            .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
            .monitor_options(SyntheticsTestOptionsMonitorOptions::new())
            .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
            .retry(SyntheticsTestOptionsRetry::new())
            .rum_settings(
                SyntheticsBrowserTestRumSettings::new(true)
                    .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
                    .client_token_id(12345),
            )
            .scheduling(
                SyntheticsTestOptionsScheduling::new()
                    .timeframes(vec![
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(1)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                        SyntheticsTestOptionsSchedulingTimeframe::new()
                            .day(3)
                            .from("07:00".to_string())
                            .to("16:00".to_string()),
                    ])
                    .timezone("America/New_York".to_string()),
            ),
        SyntheticsBrowserTestType::BROWSER,
    )
    .status(SyntheticsTestPauseStatus::LIVE)
    .steps(vec![
        SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT)
    ])
    .tags(vec!["env:prod".to_string()]);
    let configuration = datadog::Configuration::new();
    let api = SyntheticsAPI::with_config(configuration);
    let resp = api.update_browser_test("public_id".to_string(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v1_synthetics_CreateSyntheticsAPITest_1717840259.rs (line 67)
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
async fn main() {
    let body = SyntheticsAPITest::new(
        SyntheticsAPITestConfig::new().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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                        SyntheticsBasicAuthWeb::new("password".to_string(), "username".to_string()),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
                        SyntheticsBasicAuthWeb::new("password".to_string(), "username".to_string())
                            .type_(SyntheticsBasicAuthWebType::WEB),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthSigv4(Box::new(
                        SyntheticsBasicAuthSigv4::new(
                            "accessKey".to_string(),
                            "secretKey".to_string(),
                            SyntheticsBasicAuthSigv4Type::SIGV4,
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthNTLM(Box::new(
                        SyntheticsBasicAuthNTLM::new(SyntheticsBasicAuthNTLMType::NTLM),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthDigest(Box::new(
                        SyntheticsBasicAuthDigest::new(
                            "password".to_string(),
                            SyntheticsBasicAuthDigestType::DIGEST,
                            "username".to_string(),
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthClient(
                        Box::new(SyntheticsBasicAuthOauthClient::new(
                            "accessTokenUrl".to_string(),
                            "clientId".to_string(),
                            "clientSecret".to_string(),
                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
                            SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
                        )),
                    ))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
            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()
                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(Box::new(
                        SyntheticsBasicAuthOauthROP::new(
                            "accessTokenUrl".to_string(),
                            "password".to_string(),
                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
                            SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
                            "username".to_string(),
                        ),
                    )))
                    .method("GET".to_string())
                    .url("https://httpbin.org/status/200".to_string()),
                SyntheticsAPITestStepSubtype::HTTP,
            ))),
        ]),
        vec!["aws:us-east-2".to_string()],
        "BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json"
            .to_string(),
        "Example-Synthetic".to_string(),
        SyntheticsTestOptions::new().tick_every(60),
        SyntheticsAPITestType::API,
    )
    .subtype(SyntheticsTestDetailsSubType::MULTI);
    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 SyntheticsBasicAuthWeb

source§

fn clone(&self) -> SyntheticsBasicAuthWeb

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 SyntheticsBasicAuthWeb

source§

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

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

impl<'de> Deserialize<'de> for SyntheticsBasicAuthWeb

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 SyntheticsBasicAuthWeb

source§

fn eq(&self, other: &SyntheticsBasicAuthWeb) -> 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 SyntheticsBasicAuthWeb

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 SyntheticsBasicAuthWeb

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>,