#[non_exhaustive]pub struct UserCreateData {
pub attributes: UserCreateAttributes,
pub relationships: Option<UserRelationships>,
pub type_: UsersType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Object to create a user.
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.attributes: UserCreateAttributes
Attributes of the created user.
relationships: Option<UserRelationships>
Relationships of the user object.
type_: UsersType
Users resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl UserCreateData
impl UserCreateData
Sourcepub fn new(attributes: UserCreateAttributes, type_: UsersType) -> UserCreateData
pub fn new(attributes: UserCreateAttributes, type_: UsersType) -> UserCreateData
Examples found in repository?
examples/v2_users_CreateUser.rs (lines 11-15)
10async fn main() {
11 let body = UserCreateRequest::new(UserCreateData::new(
12 UserCreateAttributes::new("Example-User@datadoghq.com".to_string())
13 .name("Datadog API Client Python".to_string()),
14 UsersType::USERS,
15 ));
16 let configuration = datadog::Configuration::new();
17 let api = UsersAPI::with_config(configuration);
18 let resp = api.create_user(body).await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
pub fn relationships(self, value: UserRelationships) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for UserCreateData
impl Clone for UserCreateData
Source§fn clone(&self) -> UserCreateData
fn clone(&self) -> UserCreateData
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 UserCreateData
impl Debug for UserCreateData
Source§impl<'de> Deserialize<'de> for UserCreateData
impl<'de> Deserialize<'de> for UserCreateData
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 UserCreateData
impl PartialEq for UserCreateData
Source§impl Serialize for UserCreateData
impl Serialize for UserCreateData
impl StructuralPartialEq for UserCreateData
Auto Trait Implementations§
impl Freeze for UserCreateData
impl RefUnwindSafe for UserCreateData
impl Send for UserCreateData
impl Sync for UserCreateData
impl Unpin for UserCreateData
impl UnwindSafe for UserCreateData
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