#[non_exhaustive]pub struct DatasetAttributes {
pub created_at: Option<Option<DateTime<Utc>>>,
pub created_by: Option<Uuid>,
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 configuration(s).
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.created_at: Option<Option<DateTime<Utc>>>
Timestamp when the dataset was created.
created_by: Option<Uuid>
Unique ID of the user who created the dataset.
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 DatasetAttributes
impl DatasetAttributes
Sourcepub fn new(
name: String,
principals: Vec<String>,
product_filters: Vec<FiltersPerProduct>,
) -> DatasetAttributes
pub fn new( name: String, principals: Vec<String>, product_filters: Vec<FiltersPerProduct>, ) -> DatasetAttributes
Examples found in repository?
examples/v2_datasets_CreateDataset.rs (lines 13-20)
10async fn main() {
11 let body = DatasetCreateRequest::new(
12 Dataset::new(
13 DatasetAttributes::new(
14 "Security Audit Dataset".to_string(),
15 vec!["role:86245fce-0a4e-11f0-92bd-da7ad0900002".to_string()],
16 vec![FiltersPerProduct::new(
17 vec!["@application.id:ABCD".to_string()],
18 "logs".to_string(),
19 )],
20 )
21 .created_at(None),
22 "dataset".to_string(),
23 )
24 .id("123e4567-e89b-12d3-a456-426614174000".to_string()),
25 );
26 let configuration = datadog::Configuration::new();
27 let api = DatasetsAPI::with_config(configuration);
28 let resp = api.create_dataset(body).await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub fn created_at(self, value: Option<DateTime<Utc>>) -> Self
pub fn created_at(self, value: Option<DateTime<Utc>>) -> Self
Examples found in repository?
examples/v2_datasets_CreateDataset.rs (line 21)
10async fn main() {
11 let body = DatasetCreateRequest::new(
12 Dataset::new(
13 DatasetAttributes::new(
14 "Security Audit Dataset".to_string(),
15 vec!["role:86245fce-0a4e-11f0-92bd-da7ad0900002".to_string()],
16 vec![FiltersPerProduct::new(
17 vec!["@application.id:ABCD".to_string()],
18 "logs".to_string(),
19 )],
20 )
21 .created_at(None),
22 "dataset".to_string(),
23 )
24 .id("123e4567-e89b-12d3-a456-426614174000".to_string()),
25 );
26 let configuration = datadog::Configuration::new();
27 let api = DatasetsAPI::with_config(configuration);
28 let resp = api.create_dataset(body).await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
pub fn created_by(self, value: Uuid) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for DatasetAttributes
impl Clone for DatasetAttributes
Source§fn clone(&self) -> DatasetAttributes
fn clone(&self) -> DatasetAttributes
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 DatasetAttributes
impl Debug for DatasetAttributes
Source§impl<'de> Deserialize<'de> for DatasetAttributes
impl<'de> Deserialize<'de> for DatasetAttributes
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 DatasetAttributes
impl PartialEq for DatasetAttributes
Source§impl Serialize for DatasetAttributes
impl Serialize for DatasetAttributes
impl StructuralPartialEq for DatasetAttributes
Auto Trait Implementations§
impl Freeze for DatasetAttributes
impl RefUnwindSafe for DatasetAttributes
impl Send for DatasetAttributes
impl Sync for DatasetAttributes
impl Unpin for DatasetAttributes
impl UnwindSafe for DatasetAttributes
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