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