#[non_exhaustive]pub struct SyntheticsGlobalVariableAttributes {
pub restricted_roles: Option<Vec<String>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Attributes of the global variable.
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.restricted_roles: Option<Vec<String>>
A list of role identifiers that can be pulled from the Roles API, for restricting read and write access.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl SyntheticsGlobalVariableAttributes
impl SyntheticsGlobalVariableAttributes
Sourcepub fn new() -> SyntheticsGlobalVariableAttributes
pub fn new() -> SyntheticsGlobalVariableAttributes
Examples found in repository?
examples/v1_synthetics_CreateGlobalVariable.rs (line 20)
13async fn main() {
14 let body = SyntheticsGlobalVariableRequest::new(
15 "Example description".to_string(),
16 "MY_VARIABLE".to_string(),
17 vec!["team:front".to_string(), "test:workflow-1".to_string()],
18 )
19 .attributes(
20 SyntheticsGlobalVariableAttributes::new()
21 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
22 )
23 .parse_test_options(
24 SyntheticsGlobalVariableParseTestOptions::new(
25 SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
26 )
27 .field("content-type".to_string())
28 .local_variable_name("LOCAL_VARIABLE".to_string())
29 .parser(
30 SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
31 .value(".*".to_string()),
32 ),
33 )
34 .parse_test_public_id("abc-def-123".to_string())
35 .value(
36 SyntheticsGlobalVariableValue::new()
37 .secure(true)
38 .value("value".to_string()),
39 );
40 let configuration = datadog::Configuration::new();
41 let api = SyntheticsAPI::with_config(configuration);
42 let resp = api.create_global_variable(body).await;
43 if let Ok(value) = resp {
44 println!("{:#?}", value);
45 } else {
46 println!("{:#?}", resp.unwrap_err());
47 }
48}
More examples
examples/v1_synthetics_EditGlobalVariable.rs (line 20)
13async fn main() {
14 let body = SyntheticsGlobalVariableRequest::new(
15 "Example description".to_string(),
16 "MY_VARIABLE".to_string(),
17 vec!["team:front".to_string(), "test:workflow-1".to_string()],
18 )
19 .attributes(
20 SyntheticsGlobalVariableAttributes::new()
21 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
22 )
23 .parse_test_options(
24 SyntheticsGlobalVariableParseTestOptions::new(
25 SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
26 )
27 .field("content-type".to_string())
28 .local_variable_name("LOCAL_VARIABLE".to_string())
29 .parser(
30 SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
31 .value(".*".to_string()),
32 ),
33 )
34 .parse_test_public_id("abc-def-123".to_string())
35 .value(
36 SyntheticsGlobalVariableValue::new()
37 .secure(true)
38 .value("value".to_string()),
39 );
40 let configuration = datadog::Configuration::new();
41 let api = SyntheticsAPI::with_config(configuration);
42 let resp = api
43 .edit_global_variable("variable_id".to_string(), body)
44 .await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
Sourcepub fn restricted_roles(self, value: Vec<String>) -> Self
pub fn restricted_roles(self, value: Vec<String>) -> Self
Examples found in repository?
examples/v1_synthetics_CreateGlobalVariable.rs (line 21)
13async fn main() {
14 let body = SyntheticsGlobalVariableRequest::new(
15 "Example description".to_string(),
16 "MY_VARIABLE".to_string(),
17 vec!["team:front".to_string(), "test:workflow-1".to_string()],
18 )
19 .attributes(
20 SyntheticsGlobalVariableAttributes::new()
21 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
22 )
23 .parse_test_options(
24 SyntheticsGlobalVariableParseTestOptions::new(
25 SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
26 )
27 .field("content-type".to_string())
28 .local_variable_name("LOCAL_VARIABLE".to_string())
29 .parser(
30 SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
31 .value(".*".to_string()),
32 ),
33 )
34 .parse_test_public_id("abc-def-123".to_string())
35 .value(
36 SyntheticsGlobalVariableValue::new()
37 .secure(true)
38 .value("value".to_string()),
39 );
40 let configuration = datadog::Configuration::new();
41 let api = SyntheticsAPI::with_config(configuration);
42 let resp = api.create_global_variable(body).await;
43 if let Ok(value) = resp {
44 println!("{:#?}", value);
45 } else {
46 println!("{:#?}", resp.unwrap_err());
47 }
48}
More examples
examples/v1_synthetics_EditGlobalVariable.rs (line 21)
13async fn main() {
14 let body = SyntheticsGlobalVariableRequest::new(
15 "Example description".to_string(),
16 "MY_VARIABLE".to_string(),
17 vec!["team:front".to_string(), "test:workflow-1".to_string()],
18 )
19 .attributes(
20 SyntheticsGlobalVariableAttributes::new()
21 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()]),
22 )
23 .parse_test_options(
24 SyntheticsGlobalVariableParseTestOptions::new(
25 SyntheticsGlobalVariableParseTestOptionsType::HTTP_BODY,
26 )
27 .field("content-type".to_string())
28 .local_variable_name("LOCAL_VARIABLE".to_string())
29 .parser(
30 SyntheticsVariableParser::new(SyntheticsGlobalVariableParserType::REGEX)
31 .value(".*".to_string()),
32 ),
33 )
34 .parse_test_public_id("abc-def-123".to_string())
35 .value(
36 SyntheticsGlobalVariableValue::new()
37 .secure(true)
38 .value("value".to_string()),
39 );
40 let configuration = datadog::Configuration::new();
41 let api = SyntheticsAPI::with_config(configuration);
42 let resp = api
43 .edit_global_variable("variable_id".to_string(), body)
44 .await;
45 if let Ok(value) = resp {
46 println!("{:#?}", value);
47 } else {
48 println!("{:#?}", resp.unwrap_err());
49 }
50}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for SyntheticsGlobalVariableAttributes
impl Clone for SyntheticsGlobalVariableAttributes
Source§fn clone(&self) -> SyntheticsGlobalVariableAttributes
fn clone(&self) -> SyntheticsGlobalVariableAttributes
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<'de> Deserialize<'de> for SyntheticsGlobalVariableAttributes
impl<'de> Deserialize<'de> for SyntheticsGlobalVariableAttributes
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 SyntheticsGlobalVariableAttributes
impl PartialEq for SyntheticsGlobalVariableAttributes
Source§fn eq(&self, other: &SyntheticsGlobalVariableAttributes) -> bool
fn eq(&self, other: &SyntheticsGlobalVariableAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for SyntheticsGlobalVariableAttributes
Auto Trait Implementations§
impl Freeze for SyntheticsGlobalVariableAttributes
impl RefUnwindSafe for SyntheticsGlobalVariableAttributes
impl Send for SyntheticsGlobalVariableAttributes
impl Sync for SyntheticsGlobalVariableAttributes
impl Unpin for SyntheticsGlobalVariableAttributes
impl UnwindSafe for SyntheticsGlobalVariableAttributes
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