#[non_exhaustive]pub struct DatasetRequest {
pub attributes: DatasetAttributesRequest,
pub type_: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Datasets Object Constraints
-
Tag limit per dataset:
- Each restricted dataset supports a maximum of 10 key:value pairs per product.
-
Tag key rules per telemetry type:
- Only one tag key or attribute may be used to define access within a single telemetry type.
- The same or different tag key may be used across different telemetry types.
-
Tag value uniqueness:
- Tag values must be unique within a single dataset.
- A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
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: DatasetAttributesRequest
Dataset metadata and configurations.
type_: String
Resource type, always “dataset”.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl DatasetRequest
impl DatasetRequest
Sourcepub fn new(
attributes: DatasetAttributesRequest,
type_: String,
) -> DatasetRequest
pub fn new( attributes: DatasetAttributesRequest, type_: String, ) -> DatasetRequest
Examples found in repository?
examples/v2_datasets_CreateDataset.rs (lines 11-21)
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 13-23)
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 DatasetRequest
impl Clone for DatasetRequest
Source§fn clone(&self) -> DatasetRequest
fn clone(&self) -> DatasetRequest
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 DatasetRequest
impl Debug for DatasetRequest
Source§impl<'de> Deserialize<'de> for DatasetRequest
impl<'de> Deserialize<'de> for DatasetRequest
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 DatasetRequest
impl PartialEq for DatasetRequest
Source§impl Serialize for DatasetRequest
impl Serialize for DatasetRequest
impl StructuralPartialEq for DatasetRequest
Auto Trait Implementations§
impl Freeze for DatasetRequest
impl RefUnwindSafe for DatasetRequest
impl Send for DatasetRequest
impl Sync for DatasetRequest
impl Unpin for DatasetRequest
impl UnwindSafe for DatasetRequest
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