#[non_exhaustive]pub struct RoleCreateAttributes {
pub created_at: Option<DateTime<Utc>>,
pub modified_at: Option<DateTime<Utc>>,
pub name: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Attributes of the created role.
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.created_at: Option<DateTime<Utc>>
Creation time of the role.
modified_at: Option<DateTime<Utc>>
Time of last role modification.
name: String
Name of the role.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl RoleCreateAttributes
impl RoleCreateAttributes
Sourcepub fn new(name: String) -> RoleCreateAttributes
pub fn new(name: String) -> RoleCreateAttributes
Examples found in repository?
examples/v2_roles_CreateRole.rs (line 16)
14async fn main() {
15 let body = RoleCreateRequest::new(
16 RoleCreateData::new(RoleCreateAttributes::new("developers".to_string()))
17 .relationships(RoleRelationships::new().permissions(
18 RelationshipToPermissions::new().data(vec![
19 RelationshipToPermissionData::new().type_(PermissionsType::PERMISSIONS),
20 ]),
21 ))
22 .type_(RolesType::ROLES),
23 );
24 let configuration = datadog::Configuration::new();
25 let api = RolesAPI::with_config(configuration);
26 let resp = api.create_role(body).await;
27 if let Ok(value) = resp {
28 println!("{:#?}", value);
29 } else {
30 println!("{:#?}", resp.unwrap_err());
31 }
32}
More examples
examples/v2_roles_CreateRole_3862893229.rs (line 18)
14async fn main() {
15 // there is a valid "permission" in the system
16 let permission_id = std::env::var("PERMISSION_ID").unwrap();
17 let body = RoleCreateRequest::new(
18 RoleCreateData::new(RoleCreateAttributes::new("Example-Role".to_string()))
19 .relationships(RoleRelationships::new().permissions(
20 RelationshipToPermissions::new().data(vec![
21 RelationshipToPermissionData::new()
22 .id(permission_id.clone())
23 .type_(PermissionsType::PERMISSIONS)
24 ]),
25 ))
26 .type_(RolesType::ROLES),
27 );
28 let configuration = datadog::Configuration::new();
29 let api = RolesAPI::with_config(configuration);
30 let resp = api.create_role(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
pub fn created_at(self, value: DateTime<Utc>) -> Self
pub fn modified_at(self, value: DateTime<Utc>) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for RoleCreateAttributes
impl Clone for RoleCreateAttributes
Source§fn clone(&self) -> RoleCreateAttributes
fn clone(&self) -> RoleCreateAttributes
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 RoleCreateAttributes
impl Debug for RoleCreateAttributes
Source§impl<'de> Deserialize<'de> for RoleCreateAttributes
impl<'de> Deserialize<'de> for RoleCreateAttributes
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 RoleCreateAttributes
impl PartialEq for RoleCreateAttributes
Source§impl Serialize for RoleCreateAttributes
impl Serialize for RoleCreateAttributes
impl StructuralPartialEq for RoleCreateAttributes
Auto Trait Implementations§
impl Freeze for RoleCreateAttributes
impl RefUnwindSafe for RoleCreateAttributes
impl Send for RoleCreateAttributes
impl Sync for RoleCreateAttributes
impl Unpin for RoleCreateAttributes
impl UnwindSafe for RoleCreateAttributes
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