#[non_exhaustive]pub struct SelectableTemplateVariableItems {
pub default_value: Option<String>,
pub name: Option<String>,
pub prefix: Option<String>,
pub type_: Option<Option<String>>,
pub visible_tags: Option<Option<Vec<String>>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Object containing the template variable’s name, associated tag/attribute, default value and selectable values.
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.default_value: Option<String>
The default value of the template variable.
name: Option<String>
Name of the template variable.
prefix: Option<String>
The tag/attribute key associated with the template variable.
type_: Option<Option<String>>
The type of variable. This is to differentiate between filter variables (interpolated in query) and group by variables (interpolated into group by).
List of visible tag values on the shared dashboard.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl SelectableTemplateVariableItems
impl SelectableTemplateVariableItems
Sourcepub fn new() -> SelectableTemplateVariableItems
pub fn new() -> SelectableTemplateVariableItems
Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 19)
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (line 19)
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub fn default_value(self, value: String) -> Self
pub fn default_value(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 20)
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (line 20)
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Sourcepub fn name(self, value: String) -> Self
pub fn name(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 21)
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (line 21)
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
pub fn prefix(self, value: String) -> Self
Sourcepub fn type_(self, value: Option<String>) -> Self
pub fn type_(self, value: Option<String>) -> Self
Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (line 22)
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (line 22)
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
Examples found in repository?
examples/v1_dashboards_CreatePublicDashboard_1668947073.rs (lines 23-26)
12async fn main() {
13 // there is a valid "dashboard" in the system
14 let dashboard_id = std::env::var("DASHBOARD_ID").unwrap();
15 let body = SharedDashboard::new(dashboard_id.clone(), DashboardType::CUSTOM_TIMEBOARD)
16 .global_time(
17 DashboardGlobalTime::new().live_span(DashboardGlobalTimeLiveSpan::PAST_ONE_HOUR),
18 )
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_type(Some(DashboardShareType::OPEN));
28 let configuration = datadog::Configuration::new();
29 let api = DashboardsAPI::with_config(configuration);
30 let resp = api.create_public_dashboard(body).await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
examples/v1_dashboards_UpdatePublicDashboard_1708268778.rs (lines 23-26)
11async fn main() {
12 // there is a valid "shared_dashboard" in the system
13 let shared_dashboard_token = std::env::var("SHARED_DASHBOARD_TOKEN").unwrap();
14 let body = SharedDashboardUpdateRequest::new()
15 .global_time(Some(
16 SharedDashboardUpdateRequestGlobalTime::new()
17 .live_span(DashboardGlobalTimeLiveSpan::PAST_FIFTEEN_MINUTES),
18 ))
19 .selectable_template_vars(Some(vec![SelectableTemplateVariableItems::new()
20 .default_value("*".to_string())
21 .name("group_by_var".to_string())
22 .type_(Some("group".to_string()))
23 .visible_tags(Some(vec![
24 "selectableValue1".to_string(),
25 "selectableValue2".to_string(),
26 ]))]))
27 .share_list(Some(vec![]))
28 .share_type(Some(DashboardShareType::OPEN));
29 let configuration = datadog::Configuration::new();
30 let api = DashboardsAPI::with_config(configuration);
31 let resp = api
32 .update_public_dashboard(shared_dashboard_token.clone(), body)
33 .await;
34 if let Ok(value) = resp {
35 println!("{:#?}", value);
36 } else {
37 println!("{:#?}", resp.unwrap_err());
38 }
39}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for SelectableTemplateVariableItems
impl Clone for SelectableTemplateVariableItems
Source§fn clone(&self) -> SelectableTemplateVariableItems
fn clone(&self) -> SelectableTemplateVariableItems
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<'de> Deserialize<'de> for SelectableTemplateVariableItems
impl<'de> Deserialize<'de> for SelectableTemplateVariableItems
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 SelectableTemplateVariableItems
impl PartialEq for SelectableTemplateVariableItems
Source§fn eq(&self, other: &SelectableTemplateVariableItems) -> bool
fn eq(&self, other: &SelectableTemplateVariableItems) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for SelectableTemplateVariableItems
Auto Trait Implementations§
impl Freeze for SelectableTemplateVariableItems
impl RefUnwindSafe for SelectableTemplateVariableItems
impl Send for SelectableTemplateVariableItems
impl Sync for SelectableTemplateVariableItems
impl Unpin for SelectableTemplateVariableItems
impl UnwindSafe for SelectableTemplateVariableItems
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