#[non_exhaustive]pub struct ServiceAccountCreateRequest {
pub data: ServiceAccountCreateData,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Create a service account.
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: ServiceAccountCreateData
Object to create a service account User.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ServiceAccountCreateRequest
impl ServiceAccountCreateRequest
Sourcepub fn new(data: ServiceAccountCreateData) -> ServiceAccountCreateRequest
pub fn new(data: ServiceAccountCreateData) -> ServiceAccountCreateRequest
Examples found in repository?
examples/v2_service-accounts_CreateServiceAccount.rs (lines 18-32)
14async fn main() {
15 // there is a valid "role" in the system
16 let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
17 let body =
18 ServiceAccountCreateRequest::new(
19 ServiceAccountCreateData::new(
20 ServiceAccountCreateAttributes::new(
21 "Example-Service-Account@datadoghq.com".to_string(),
22 true,
23 )
24 .name("Test API Client".to_string()),
25 UsersType::USERS,
26 )
27 .relationships(UserRelationships::new().roles(
28 RelationshipToRoles::new().data(vec![RelationshipToRoleData::new()
29 .id(role_data_id.clone())
30 .type_(RolesType::ROLES)]),
31 )),
32 );
33 let configuration = datadog::Configuration::new();
34 let api = ServiceAccountsAPI::with_config(configuration);
35 let resp = api.create_service_account(body).await;
36 if let Ok(value) = resp {
37 println!("{:#?}", value);
38 } else {
39 println!("{:#?}", resp.unwrap_err());
40 }
41}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ServiceAccountCreateRequest
impl Clone for ServiceAccountCreateRequest
Source§fn clone(&self) -> ServiceAccountCreateRequest
fn clone(&self) -> ServiceAccountCreateRequest
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 ServiceAccountCreateRequest
impl Debug for ServiceAccountCreateRequest
Source§impl<'de> Deserialize<'de> for ServiceAccountCreateRequest
impl<'de> Deserialize<'de> for ServiceAccountCreateRequest
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 ServiceAccountCreateRequest
Auto Trait Implementations§
impl Freeze for ServiceAccountCreateRequest
impl RefUnwindSafe for ServiceAccountCreateRequest
impl Send for ServiceAccountCreateRequest
impl Sync for ServiceAccountCreateRequest
impl Unpin for ServiceAccountCreateRequest
impl UnwindSafe for ServiceAccountCreateRequest
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