#[non_exhaustive]pub struct RestrictionPolicyUpdateRequest {
pub data: RestrictionPolicy,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Update request for a restriction policy.
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.data: RestrictionPolicy
Restriction policy object.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RestrictionPolicyUpdateRequest
impl RestrictionPolicyUpdateRequest
Sourcepub fn new(data: RestrictionPolicy) -> RestrictionPolicyUpdateRequest
pub fn new(data: RestrictionPolicy) -> RestrictionPolicyUpdateRequest
Examples found in repository?
examples/v2_restriction-policies_UpdateRestrictionPolicy.rs (lines 14-21)
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 RestrictionPolicyUpdateRequest
impl Clone for RestrictionPolicyUpdateRequest
Source§fn clone(&self) -> RestrictionPolicyUpdateRequest
fn clone(&self) -> RestrictionPolicyUpdateRequest
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 RestrictionPolicyUpdateRequest
impl<'de> Deserialize<'de> for RestrictionPolicyUpdateRequest
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 RestrictionPolicyUpdateRequest
impl PartialEq for RestrictionPolicyUpdateRequest
Source§fn eq(&self, other: &RestrictionPolicyUpdateRequest) -> bool
fn eq(&self, other: &RestrictionPolicyUpdateRequest) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for RestrictionPolicyUpdateRequest
Auto Trait Implementations§
impl Freeze for RestrictionPolicyUpdateRequest
impl RefUnwindSafe for RestrictionPolicyUpdateRequest
impl Send for RestrictionPolicyUpdateRequest
impl Sync for RestrictionPolicyUpdateRequest
impl Unpin for RestrictionPolicyUpdateRequest
impl UnwindSafe for RestrictionPolicyUpdateRequest
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