#[non_exhaustive]pub struct ApplicationKeyUpdateAttributes {
pub name: Option<String>,
pub scopes: Option<Option<Vec<String>>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Attributes used to update 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.name: Option<String>
Name of the application key.
scopes: Option<Option<Vec<String>>>
Array of scopes to grant the application key.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ApplicationKeyUpdateAttributes
impl ApplicationKeyUpdateAttributes
Sourcepub fn new() -> ApplicationKeyUpdateAttributes
pub fn new() -> ApplicationKeyUpdateAttributes
Examples found in repository?
examples/v2_key-management_UpdateApplicationKey.rs (line 14)
10async fn main() {
11 // there is a valid "application_key" in the system
12 let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap();
13 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
14 ApplicationKeyUpdateAttributes::new()
15 .name("Application Key for managing dashboards-updated".to_string()),
16 application_key_data_id.clone(),
17 ApplicationKeysType::APPLICATION_KEYS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = KeyManagementAPI::with_config(configuration);
21 let resp = api
22 .update_application_key(application_key_data_id.clone(), body)
23 .await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
More examples
examples/v2_key-management_UpdateCurrentUserApplicationKey.rs (line 14)
10async fn main() {
11 // there is a valid "application_key" in the system
12 let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap();
13 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
14 ApplicationKeyUpdateAttributes::new()
15 .name("Application Key for managing dashboards-updated".to_string()),
16 application_key_data_id.clone(),
17 ApplicationKeysType::APPLICATION_KEYS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = KeyManagementAPI::with_config(configuration);
21 let resp = api
22 .update_current_user_application_key(application_key_data_id.clone(), body)
23 .await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
examples/v2_service-accounts_UpdateServiceAccountApplicationKey.rs (line 18)
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
14 // there is a valid "service_account_application_key" for "service_account_user"
15 let service_account_application_key_data_id =
16 std::env::var("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID").unwrap();
17 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
18 ApplicationKeyUpdateAttributes::new()
19 .name("Application Key for managing dashboards-updated".to_string()),
20 service_account_application_key_data_id.clone(),
21 ApplicationKeysType::APPLICATION_KEYS,
22 ));
23 let configuration = datadog::Configuration::new();
24 let api = ServiceAccountsAPI::with_config(configuration);
25 let resp = api
26 .update_service_account_application_key(
27 service_account_user_data_id.clone(),
28 service_account_application_key_data_id.clone(),
29 body,
30 )
31 .await;
32 if let Ok(value) = resp {
33 println!("{:#?}", value);
34 } else {
35 println!("{:#?}", resp.unwrap_err());
36 }
37}
Sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
examples/v2_key-management_UpdateApplicationKey.rs (line 15)
10async fn main() {
11 // there is a valid "application_key" in the system
12 let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap();
13 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
14 ApplicationKeyUpdateAttributes::new()
15 .name("Application Key for managing dashboards-updated".to_string()),
16 application_key_data_id.clone(),
17 ApplicationKeysType::APPLICATION_KEYS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = KeyManagementAPI::with_config(configuration);
21 let resp = api
22 .update_application_key(application_key_data_id.clone(), body)
23 .await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
More examples
examples/v2_key-management_UpdateCurrentUserApplicationKey.rs (line 15)
10async fn main() {
11 // there is a valid "application_key" in the system
12 let application_key_data_id = std::env::var("APPLICATION_KEY_DATA_ID").unwrap();
13 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
14 ApplicationKeyUpdateAttributes::new()
15 .name("Application Key for managing dashboards-updated".to_string()),
16 application_key_data_id.clone(),
17 ApplicationKeysType::APPLICATION_KEYS,
18 ));
19 let configuration = datadog::Configuration::new();
20 let api = KeyManagementAPI::with_config(configuration);
21 let resp = api
22 .update_current_user_application_key(application_key_data_id.clone(), body)
23 .await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
examples/v2_service-accounts_UpdateServiceAccountApplicationKey.rs (line 19)
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
14 // there is a valid "service_account_application_key" for "service_account_user"
15 let service_account_application_key_data_id =
16 std::env::var("SERVICE_ACCOUNT_APPLICATION_KEY_DATA_ID").unwrap();
17 let body = ApplicationKeyUpdateRequest::new(ApplicationKeyUpdateData::new(
18 ApplicationKeyUpdateAttributes::new()
19 .name("Application Key for managing dashboards-updated".to_string()),
20 service_account_application_key_data_id.clone(),
21 ApplicationKeysType::APPLICATION_KEYS,
22 ));
23 let configuration = datadog::Configuration::new();
24 let api = ServiceAccountsAPI::with_config(configuration);
25 let resp = api
26 .update_service_account_application_key(
27 service_account_user_data_id.clone(),
28 service_account_application_key_data_id.clone(),
29 body,
30 )
31 .await;
32 if let Ok(value) = resp {
33 println!("{:#?}", value);
34 } else {
35 println!("{:#?}", resp.unwrap_err());
36 }
37}
pub fn scopes(self, value: Option<Vec<String>>) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ApplicationKeyUpdateAttributes
impl Clone for ApplicationKeyUpdateAttributes
Source§fn clone(&self) -> ApplicationKeyUpdateAttributes
fn clone(&self) -> ApplicationKeyUpdateAttributes
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 ApplicationKeyUpdateAttributes
impl<'de> Deserialize<'de> for ApplicationKeyUpdateAttributes
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 ApplicationKeyUpdateAttributes
impl PartialEq for ApplicationKeyUpdateAttributes
Source§fn eq(&self, other: &ApplicationKeyUpdateAttributes) -> bool
fn eq(&self, other: &ApplicationKeyUpdateAttributes) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for ApplicationKeyUpdateAttributes
Auto Trait Implementations§
impl Freeze for ApplicationKeyUpdateAttributes
impl RefUnwindSafe for ApplicationKeyUpdateAttributes
impl Send for ApplicationKeyUpdateAttributes
impl Sync for ApplicationKeyUpdateAttributes
impl Unpin for ApplicationKeyUpdateAttributes
impl UnwindSafe for ApplicationKeyUpdateAttributes
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