#[non_exhaustive]pub struct DatasetAttributesRequest {
pub name: String,
pub principals: Vec<String>,
pub product_filters: Vec<FiltersPerProduct>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Dataset metadata and configurations.
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: String
Name of the dataset.
principals: Vec<String>
List of access principals, formatted as principal_type:id
. Principal can be ‘team’ or ‘role’.
product_filters: Vec<FiltersPerProduct>
List of product-specific filters.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl DatasetAttributesRequest
impl DatasetAttributesRequest
Sourcepub fn new(
name: String,
principals: Vec<String>,
product_filters: Vec<FiltersPerProduct>,
) -> DatasetAttributesRequest
pub fn new( name: String, principals: Vec<String>, product_filters: Vec<FiltersPerProduct>, ) -> DatasetAttributesRequest
Examples found in repository?
examples/v2_datasets_CreateDataset.rs (lines 12-19)
10async fn main() {
11 let body = DatasetCreateRequest::new(DatasetRequest::new(
12 DatasetAttributesRequest::new(
13 "Security Audit Dataset".to_string(),
14 vec!["role:94172442-be03-11e9-a77a-3b7612558ac1".to_string()],
15 vec![FiltersPerProduct::new(
16 vec!["@application.id:ABCD".to_string()],
17 "metrics".to_string(),
18 )],
19 ),
20 "dataset".to_string(),
21 ));
22 let mut configuration = datadog::Configuration::new();
23 configuration.set_unstable_operation_enabled("v2.CreateDataset", true);
24 let api = DatasetsAPI::with_config(configuration);
25 let resp = api.create_dataset(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
More examples
examples/v2_datasets_UpdateDataset.rs (lines 14-21)
10async fn main() {
11 // there is a valid "dataset" in the system
12 let dataset_data_id = std::env::var("DATASET_DATA_ID").unwrap();
13 let body = DatasetUpdateRequest::new(DatasetRequest::new(
14 DatasetAttributesRequest::new(
15 "Security Audit Dataset".to_string(),
16 vec!["role:94172442-be03-11e9-a77a-3b7612558ac1".to_string()],
17 vec![FiltersPerProduct::new(
18 vec!["@application.id:1234".to_string()],
19 "metrics".to_string(),
20 )],
21 ),
22 "dataset".to_string(),
23 ));
24 let mut configuration = datadog::Configuration::new();
25 configuration.set_unstable_operation_enabled("v2.UpdateDataset", true);
26 let api = DatasetsAPI::with_config(configuration);
27 let resp = api.update_dataset(dataset_data_id.clone(), body).await;
28 if let Ok(value) = resp {
29 println!("{:#?}", value);
30 } else {
31 println!("{:#?}", resp.unwrap_err());
32 }
33}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for DatasetAttributesRequest
impl Clone for DatasetAttributesRequest
Source§fn clone(&self) -> DatasetAttributesRequest
fn clone(&self) -> DatasetAttributesRequest
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 DatasetAttributesRequest
impl Debug for DatasetAttributesRequest
Source§impl<'de> Deserialize<'de> for DatasetAttributesRequest
impl<'de> Deserialize<'de> for DatasetAttributesRequest
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 DatasetAttributesRequest
impl PartialEq for DatasetAttributesRequest
Source§impl Serialize for DatasetAttributesRequest
impl Serialize for DatasetAttributesRequest
impl StructuralPartialEq for DatasetAttributesRequest
Auto Trait Implementations§
impl Freeze for DatasetAttributesRequest
impl RefUnwindSafe for DatasetAttributesRequest
impl Send for DatasetAttributesRequest
impl Sync for DatasetAttributesRequest
impl Unpin for DatasetAttributesRequest
impl UnwindSafe for DatasetAttributesRequest
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