#[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: String
Password to use for the digest authentication.
type_: SyntheticsBasicAuthDigestType
The type of basic authentication to use when performing the test.
username: String
Username 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 136-140)
35async fn main() {
36 let body = SyntheticsAPITest::new(
37 SyntheticsAPITestConfig::new().steps(vec![
38 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
39 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
40 SyntheticsAssertionTarget::new(
41 SyntheticsAssertionOperator::IS,
42 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
43 200.0 as f64,
44 ),
45 SyntheticsAssertionType::STATUS_CODE,
46 ),
47 ))],
48 "request is sent".to_string(),
49 SyntheticsTestRequest::new()
50 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
51 SyntheticsBasicAuthWeb::new()
52 .password("password".to_string())
53 .username("username".to_string()),
54 )))
55 .method("GET".to_string())
56 .url("https://httpbin.org/status/200".to_string()),
57 SyntheticsAPITestStepSubtype::HTTP,
58 ))),
59 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
60 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
61 SyntheticsAssertionTarget::new(
62 SyntheticsAssertionOperator::IS,
63 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
64 200.0 as f64,
65 ),
66 SyntheticsAssertionType::STATUS_CODE,
67 ),
68 ))],
69 "request is sent".to_string(),
70 SyntheticsTestRequest::new()
71 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
72 SyntheticsBasicAuthWeb::new()
73 .password("password".to_string())
74 .type_(SyntheticsBasicAuthWebType::WEB)
75 .username("username".to_string()),
76 )))
77 .method("GET".to_string())
78 .url("https://httpbin.org/status/200".to_string()),
79 SyntheticsAPITestStepSubtype::HTTP,
80 ))),
81 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
82 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
83 SyntheticsAssertionTarget::new(
84 SyntheticsAssertionOperator::IS,
85 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
86 200.0 as f64,
87 ),
88 SyntheticsAssertionType::STATUS_CODE,
89 ),
90 ))],
91 "request is sent".to_string(),
92 SyntheticsTestRequest::new()
93 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthSigv4(Box::new(
94 SyntheticsBasicAuthSigv4::new(
95 "accessKey".to_string(),
96 "secretKey".to_string(),
97 SyntheticsBasicAuthSigv4Type::SIGV4,
98 ),
99 )))
100 .method("GET".to_string())
101 .url("https://httpbin.org/status/200".to_string()),
102 SyntheticsAPITestStepSubtype::HTTP,
103 ))),
104 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
105 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
106 SyntheticsAssertionTarget::new(
107 SyntheticsAssertionOperator::IS,
108 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
109 200.0 as f64,
110 ),
111 SyntheticsAssertionType::STATUS_CODE,
112 ),
113 ))],
114 "request is sent".to_string(),
115 SyntheticsTestRequest::new()
116 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthNTLM(Box::new(
117 SyntheticsBasicAuthNTLM::new(SyntheticsBasicAuthNTLMType::NTLM),
118 )))
119 .method("GET".to_string())
120 .url("https://httpbin.org/status/200".to_string()),
121 SyntheticsAPITestStepSubtype::HTTP,
122 ))),
123 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
124 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
125 SyntheticsAssertionTarget::new(
126 SyntheticsAssertionOperator::IS,
127 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
128 200.0 as f64,
129 ),
130 SyntheticsAssertionType::STATUS_CODE,
131 ),
132 ))],
133 "request is sent".to_string(),
134 SyntheticsTestRequest::new()
135 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthDigest(Box::new(
136 SyntheticsBasicAuthDigest::new(
137 "password".to_string(),
138 SyntheticsBasicAuthDigestType::DIGEST,
139 "username".to_string(),
140 ),
141 )))
142 .method("GET".to_string())
143 .url("https://httpbin.org/status/200".to_string()),
144 SyntheticsAPITestStepSubtype::HTTP,
145 ))),
146 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
147 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
148 SyntheticsAssertionTarget::new(
149 SyntheticsAssertionOperator::IS,
150 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
151 200.0 as f64,
152 ),
153 SyntheticsAssertionType::STATUS_CODE,
154 ),
155 ))],
156 "request is sent".to_string(),
157 SyntheticsTestRequest::new()
158 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthClient(
159 Box::new(SyntheticsBasicAuthOauthClient::new(
160 "accessTokenUrl".to_string(),
161 "clientId".to_string(),
162 "clientSecret".to_string(),
163 SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
164 SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
165 )),
166 ))
167 .method("GET".to_string())
168 .url("https://httpbin.org/status/200".to_string()),
169 SyntheticsAPITestStepSubtype::HTTP,
170 ))),
171 SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
172 vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
173 SyntheticsAssertionTarget::new(
174 SyntheticsAssertionOperator::IS,
175 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
176 200.0 as f64,
177 ),
178 SyntheticsAssertionType::STATUS_CODE,
179 ),
180 ))],
181 "request is sent".to_string(),
182 SyntheticsTestRequest::new()
183 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(Box::new(
184 SyntheticsBasicAuthOauthROP::new(
185 "accessTokenUrl".to_string(),
186 "password".to_string(),
187 SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
188 SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
189 "username".to_string(),
190 ),
191 )))
192 .method("GET".to_string())
193 .url("https://httpbin.org/status/200".to_string()),
194 SyntheticsAPITestStepSubtype::HTTP,
195 ))),
196 ]),
197 vec!["aws:us-east-2".to_string()],
198 "BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json"
199 .to_string(),
200 "Example-Synthetic".to_string(),
201 SyntheticsTestOptions::new().tick_every(60),
202 SyntheticsAPITestType::API,
203 )
204 .subtype(SyntheticsTestDetailsSubType::MULTI);
205 let configuration = datadog::Configuration::new();
206 let api = SyntheticsAPI::with_config(configuration);
207 let resp = api.create_synthetics_api_test(body).await;
208 if let Ok(value) = resp {
209 println!("{:#?}", value);
210 } else {
211 println!("{:#?}", resp.unwrap_err());
212 }
213}
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 duplicate 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