#[non_exhaustive]pub struct ApplicationKeyUpdateData {
pub attributes: ApplicationKeyUpdateAttributes,
pub id: String,
pub type_: ApplicationKeysType,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Object 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.attributes: ApplicationKeyUpdateAttributes
Attributes used to update an application Key.
id: String
ID of the application key.
type_: ApplicationKeysType
Application Keys resource type.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl ApplicationKeyUpdateData
impl ApplicationKeyUpdateData
Sourcepub fn new(
attributes: ApplicationKeyUpdateAttributes,
id: String,
type_: ApplicationKeysType,
) -> ApplicationKeyUpdateData
pub fn new( attributes: ApplicationKeyUpdateAttributes, id: String, type_: ApplicationKeysType, ) -> ApplicationKeyUpdateData
Examples found in repository?
examples/v2_key-management_UpdateApplicationKey.rs (lines 13-18)
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 (lines 13-18)
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 (lines 17-22)
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 additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for ApplicationKeyUpdateData
impl Clone for ApplicationKeyUpdateData
Source§fn clone(&self) -> ApplicationKeyUpdateData
fn clone(&self) -> ApplicationKeyUpdateData
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 ApplicationKeyUpdateData
impl Debug for ApplicationKeyUpdateData
Source§impl<'de> Deserialize<'de> for ApplicationKeyUpdateData
impl<'de> Deserialize<'de> for ApplicationKeyUpdateData
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 ApplicationKeyUpdateData
impl PartialEq for ApplicationKeyUpdateData
Source§impl Serialize for ApplicationKeyUpdateData
impl Serialize for ApplicationKeyUpdateData
impl StructuralPartialEq for ApplicationKeyUpdateData
Auto Trait Implementations§
impl Freeze for ApplicationKeyUpdateData
impl RefUnwindSafe for ApplicationKeyUpdateData
impl Send for ApplicationKeyUpdateData
impl Sync for ApplicationKeyUpdateData
impl Unpin for ApplicationKeyUpdateData
impl UnwindSafe for ApplicationKeyUpdateData
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