Struct datadog_api_client::datadogV1::model::model_synthetics_basic_auth_web::SyntheticsBasicAuthWeb
source · #[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: StringPassword to use for the basic authentication.
type_: Option<SyntheticsBasicAuthWebType>The type of basic authentication to use when performing the test.
username: StringUsername to use for the basic authentication.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl SyntheticsBasicAuthWeb
impl SyntheticsBasicAuthWeb
sourcepub fn new(password: String, username: String) -> SyntheticsBasicAuthWeb
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
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());
}
}sourcepub fn type_(self, value: SyntheticsBasicAuthWebType) -> Self
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
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());
}
}pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
source§impl Clone for SyntheticsBasicAuthWeb
impl Clone for SyntheticsBasicAuthWeb
source§fn clone(&self) -> SyntheticsBasicAuthWeb
fn clone(&self) -> SyntheticsBasicAuthWeb
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SyntheticsBasicAuthWeb
impl Debug for SyntheticsBasicAuthWeb
source§impl<'de> Deserialize<'de> for SyntheticsBasicAuthWeb
impl<'de> Deserialize<'de> for SyntheticsBasicAuthWeb
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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
impl PartialEq for SyntheticsBasicAuthWeb
source§impl Serialize for SyntheticsBasicAuthWeb
impl Serialize for SyntheticsBasicAuthWeb
impl StructuralPartialEq for SyntheticsBasicAuthWeb
Auto Trait Implementations§
impl Freeze for SyntheticsBasicAuthWeb
impl RefUnwindSafe for SyntheticsBasicAuthWeb
impl Send for SyntheticsBasicAuthWeb
impl Sync for SyntheticsBasicAuthWeb
impl Unpin for SyntheticsBasicAuthWeb
impl UnwindSafe for SyntheticsBasicAuthWeb
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)