#[non_exhaustive]pub struct ApplicationKeyCreateRequest {
pub data: ApplicationKeyCreateData,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Request used to create an application key.
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: ApplicationKeyCreateData
Object used to create an application key.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ApplicationKeyCreateRequest
impl ApplicationKeyCreateRequest
Sourcepub fn new(data: ApplicationKeyCreateData) -> ApplicationKeyCreateRequest
pub fn new(data: ApplicationKeyCreateData) -> ApplicationKeyCreateRequest
Examples found in repository?
examples/v2_key-management_CreateCurrentUserApplicationKey.rs (lines 11-14)
10async fn main() {
11 let body = ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(
12 ApplicationKeyCreateAttributes::new("Example-Key-Management".to_string()),
13 ApplicationKeysType::APPLICATION_KEYS,
14 ));
15 let configuration = datadog::Configuration::new();
16 let api = KeyManagementAPI::with_config(configuration);
17 let resp = api.create_current_user_application_key(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
More examples
examples/v2_key-management_CreateCurrentUserApplicationKey_3383369233.rs (lines 12-21)
11async fn main() {
12 let body = ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(
13 ApplicationKeyCreateAttributes::new("Example-Key-Management".to_string()).scopes(Some(
14 vec![
15 "dashboards_read".to_string(),
16 "dashboards_write".to_string(),
17 "dashboards_public_share".to_string(),
18 ],
19 )),
20 ApplicationKeysType::APPLICATION_KEYS,
21 ));
22 let configuration = datadog::Configuration::new();
23 let api = KeyManagementAPI::with_config(configuration);
24 let resp = api.create_current_user_application_key(body).await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
examples/v2_service-accounts_CreateServiceAccountApplicationKey.rs (lines 13-16)
10async fn main() {
11 // there is a valid "service_account_user" in the system
12 let service_account_user_data_id = std::env::var("SERVICE_ACCOUNT_USER_DATA_ID").unwrap();
13 let body = ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(
14 ApplicationKeyCreateAttributes::new("Example-Service-Account".to_string()),
15 ApplicationKeysType::APPLICATION_KEYS,
16 ));
17 let configuration = datadog::Configuration::new();
18 let api = ServiceAccountsAPI::with_config(configuration);
19 let resp = api
20 .create_service_account_application_key(service_account_user_data_id.clone(), body)
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
examples/v2_service-accounts_CreateServiceAccountApplicationKey_3480494373.rs (lines 14-23)
11async fn main() {
12 // there is a valid "service_account_user" in the system
13 let service_account_user_data_id = std::env::var("SERVICE_ACCOUNT_USER_DATA_ID").unwrap();
14 let body = ApplicationKeyCreateRequest::new(ApplicationKeyCreateData::new(
15 ApplicationKeyCreateAttributes::new("Example-Service-Account".to_string()).scopes(Some(
16 vec![
17 "dashboards_read".to_string(),
18 "dashboards_write".to_string(),
19 "dashboards_public_share".to_string(),
20 ],
21 )),
22 ApplicationKeysType::APPLICATION_KEYS,
23 ));
24 let configuration = datadog::Configuration::new();
25 let api = ServiceAccountsAPI::with_config(configuration);
26 let resp = api
27 .create_service_account_application_key(service_account_user_data_id.clone(), body)
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ApplicationKeyCreateRequest
impl Clone for ApplicationKeyCreateRequest
Source§fn clone(&self) -> ApplicationKeyCreateRequest
fn clone(&self) -> ApplicationKeyCreateRequest
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 ApplicationKeyCreateRequest
impl Debug for ApplicationKeyCreateRequest
Source§impl<'de> Deserialize<'de> for ApplicationKeyCreateRequest
impl<'de> Deserialize<'de> for ApplicationKeyCreateRequest
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 ApplicationKeyCreateRequest
Auto Trait Implementations§
impl Freeze for ApplicationKeyCreateRequest
impl RefUnwindSafe for ApplicationKeyCreateRequest
impl Send for ApplicationKeyCreateRequest
impl Sync for ApplicationKeyCreateRequest
impl Unpin for ApplicationKeyCreateRequest
impl UnwindSafe for ApplicationKeyCreateRequest
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