#[non_exhaustive]pub struct SyntheticsPatchTestOperation {
pub op: Option<SyntheticsPatchTestOperationName>,
pub path: Option<String>,
pub value: Option<Value>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
A single JSON Patch operation to perform on 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.op: Option<SyntheticsPatchTestOperationName>
The operation to perform
path: Option<String>
The path to the value to modify
value: Option<Value>
A value to use in a JSON Patch operation
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl SyntheticsPatchTestOperation
impl SyntheticsPatchTestOperation
Sourcepub fn new() -> SyntheticsPatchTestOperation
pub fn new() -> SyntheticsPatchTestOperation
Examples found in repository?
examples/v1_synthetics_PatchTest.rs (line 14)
10async fn main() {
11 // there is a valid "synthetics_api_test" in the system
12 let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
13 let body = SyntheticsPatchTestBody::new().data(vec![
14 SyntheticsPatchTestOperation::new()
15 .op(SyntheticsPatchTestOperationName::REPLACE)
16 .path("/name".to_string())
17 .value(Value::from("New test name")),
18 SyntheticsPatchTestOperation::new()
19 .op(SyntheticsPatchTestOperationName::REMOVE)
20 .path("/config/assertions/0".to_string()),
21 ]);
22 let configuration = datadog::Configuration::new();
23 let api = SyntheticsAPI::with_config(configuration);
24 let resp = api
25 .patch_test(synthetics_api_test_public_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub fn op(self, value: SyntheticsPatchTestOperationName) -> Self
pub fn op(self, value: SyntheticsPatchTestOperationName) -> Self
Examples found in repository?
examples/v1_synthetics_PatchTest.rs (line 15)
10async fn main() {
11 // there is a valid "synthetics_api_test" in the system
12 let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
13 let body = SyntheticsPatchTestBody::new().data(vec![
14 SyntheticsPatchTestOperation::new()
15 .op(SyntheticsPatchTestOperationName::REPLACE)
16 .path("/name".to_string())
17 .value(Value::from("New test name")),
18 SyntheticsPatchTestOperation::new()
19 .op(SyntheticsPatchTestOperationName::REMOVE)
20 .path("/config/assertions/0".to_string()),
21 ]);
22 let configuration = datadog::Configuration::new();
23 let api = SyntheticsAPI::with_config(configuration);
24 let resp = api
25 .patch_test(synthetics_api_test_public_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub fn path(self, value: String) -> Self
pub fn path(self, value: String) -> Self
Examples found in repository?
examples/v1_synthetics_PatchTest.rs (line 16)
10async fn main() {
11 // there is a valid "synthetics_api_test" in the system
12 let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
13 let body = SyntheticsPatchTestBody::new().data(vec![
14 SyntheticsPatchTestOperation::new()
15 .op(SyntheticsPatchTestOperationName::REPLACE)
16 .path("/name".to_string())
17 .value(Value::from("New test name")),
18 SyntheticsPatchTestOperation::new()
19 .op(SyntheticsPatchTestOperationName::REMOVE)
20 .path("/config/assertions/0".to_string()),
21 ]);
22 let configuration = datadog::Configuration::new();
23 let api = SyntheticsAPI::with_config(configuration);
24 let resp = api
25 .patch_test(synthetics_api_test_public_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
Sourcepub fn value(self, value: Value) -> Self
pub fn value(self, value: Value) -> Self
Examples found in repository?
examples/v1_synthetics_PatchTest.rs (line 17)
10async fn main() {
11 // there is a valid "synthetics_api_test" in the system
12 let synthetics_api_test_public_id = std::env::var("SYNTHETICS_API_TEST_PUBLIC_ID").unwrap();
13 let body = SyntheticsPatchTestBody::new().data(vec![
14 SyntheticsPatchTestOperation::new()
15 .op(SyntheticsPatchTestOperationName::REPLACE)
16 .path("/name".to_string())
17 .value(Value::from("New test name")),
18 SyntheticsPatchTestOperation::new()
19 .op(SyntheticsPatchTestOperationName::REMOVE)
20 .path("/config/assertions/0".to_string()),
21 ]);
22 let configuration = datadog::Configuration::new();
23 let api = SyntheticsAPI::with_config(configuration);
24 let resp = api
25 .patch_test(synthetics_api_test_public_id.clone(), body)
26 .await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for SyntheticsPatchTestOperation
impl Clone for SyntheticsPatchTestOperation
Source§fn clone(&self) -> SyntheticsPatchTestOperation
fn clone(&self) -> SyntheticsPatchTestOperation
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 SyntheticsPatchTestOperation
impl Debug for SyntheticsPatchTestOperation
Source§impl<'de> Deserialize<'de> for SyntheticsPatchTestOperation
impl<'de> Deserialize<'de> for SyntheticsPatchTestOperation
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 SyntheticsPatchTestOperation
impl PartialEq for SyntheticsPatchTestOperation
Source§fn eq(&self, other: &SyntheticsPatchTestOperation) -> bool
fn eq(&self, other: &SyntheticsPatchTestOperation) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for SyntheticsPatchTestOperation
Auto Trait Implementations§
impl Freeze for SyntheticsPatchTestOperation
impl RefUnwindSafe for SyntheticsPatchTestOperation
impl Send for SyntheticsPatchTestOperation
impl Sync for SyntheticsPatchTestOperation
impl Unpin for SyntheticsPatchTestOperation
impl UnwindSafe for SyntheticsPatchTestOperation
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