#[non_exhaustive]pub struct RestrictionPolicyAttributes {
pub bindings: Vec<RestrictionPolicyBinding>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Restriction policy attributes.
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.bindings: Vec<RestrictionPolicyBinding>
An array of bindings.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RestrictionPolicyAttributes
impl RestrictionPolicyAttributes
Sourcepub fn new(
bindings: Vec<RestrictionPolicyBinding>,
) -> RestrictionPolicyAttributes
pub fn new( bindings: Vec<RestrictionPolicyBinding>, ) -> RestrictionPolicyAttributes
Examples found in repository?
examples/v2_restriction-policies_UpdateRestrictionPolicy.rs (lines 15-18)
12async fn main() {
13 // there is a valid "user" in the system
14 let body = RestrictionPolicyUpdateRequest::new(RestrictionPolicy::new(
15 RestrictionPolicyAttributes::new(vec![RestrictionPolicyBinding::new(
16 vec!["org:00000000-0000-beef-0000-000000000000".to_string()],
17 "editor".to_string(),
18 )]),
19 "dashboard:test-update".to_string(),
20 RestrictionPolicyType::RESTRICTION_POLICY,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = RestrictionPoliciesAPI::with_config(configuration);
24 let resp = api
25 .update_restriction_policy(
26 "dashboard:test-update".to_string(),
27 body,
28 UpdateRestrictionPolicyOptionalParams::default(),
29 )
30 .await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RestrictionPolicyAttributes
impl Clone for RestrictionPolicyAttributes
Source§fn clone(&self) -> RestrictionPolicyAttributes
fn clone(&self) -> RestrictionPolicyAttributes
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 RestrictionPolicyAttributes
impl Debug for RestrictionPolicyAttributes
Source§impl<'de> Deserialize<'de> for RestrictionPolicyAttributes
impl<'de> Deserialize<'de> for RestrictionPolicyAttributes
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 RestrictionPolicyAttributes
Auto Trait Implementations§
impl Freeze for RestrictionPolicyAttributes
impl RefUnwindSafe for RestrictionPolicyAttributes
impl Send for RestrictionPolicyAttributes
impl Sync for RestrictionPolicyAttributes
impl Unpin for RestrictionPolicyAttributes
impl UnwindSafe for RestrictionPolicyAttributes
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