Struct datadog_api_client::datadogV1::model::model_synthetics_basic_auth_digest::SyntheticsBasicAuthDigest
source · #[non_exhaustive]pub struct SyntheticsBasicAuthDigest {
pub password: String,
pub type_: SyntheticsBasicAuthDigestType,
pub username: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}Expand description
Object to handle digest 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 digest authentication.
type_: SyntheticsBasicAuthDigestTypeThe type of basic authentication to use when performing the test.
username: StringUsername to use for the digest authentication.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl SyntheticsBasicAuthDigest
impl SyntheticsBasicAuthDigest
sourcepub fn new(
password: String,
type_: SyntheticsBasicAuthDigestType,
username: String,
) -> SyntheticsBasicAuthDigest
pub fn new( password: String, type_: SyntheticsBasicAuthDigestType, username: String, ) -> SyntheticsBasicAuthDigest
Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_1717840259.rs (lines 122-126)
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 SyntheticsBasicAuthDigest
impl Clone for SyntheticsBasicAuthDigest
source§fn clone(&self) -> SyntheticsBasicAuthDigest
fn clone(&self) -> SyntheticsBasicAuthDigest
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 SyntheticsBasicAuthDigest
impl Debug for SyntheticsBasicAuthDigest
source§impl<'de> Deserialize<'de> for SyntheticsBasicAuthDigest
impl<'de> Deserialize<'de> for SyntheticsBasicAuthDigest
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
impl StructuralPartialEq for SyntheticsBasicAuthDigest
Auto Trait Implementations§
impl Freeze for SyntheticsBasicAuthDigest
impl RefUnwindSafe for SyntheticsBasicAuthDigest
impl Send for SyntheticsBasicAuthDigest
impl Sync for SyntheticsBasicAuthDigest
impl Unpin for SyntheticsBasicAuthDigest
impl UnwindSafe for SyntheticsBasicAuthDigest
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)