#[non_exhaustive]pub struct PowerpackTemplateVariableContents {
pub name: String,
pub prefix: Option<String>,
pub values: Vec<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Powerpack template variable contents.
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
The name of the variable.
prefix: Option<String>
The tag prefix associated with the variable.
values: Vec<String>
One or many template variable values within the saved view, which will be unioned together using OR
if more than one is specified.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl PowerpackTemplateVariableContents
impl PowerpackTemplateVariableContents
Sourcepub fn new(
name: String,
values: Vec<String>,
) -> PowerpackTemplateVariableContents
pub fn new( name: String, values: Vec<String>, ) -> PowerpackTemplateVariableContents
Examples found in repository?
examples/v1_dashboards_CreateDashboard_1754992756.rs (lines 29-32)
15async fn main() {
16 // there is a valid "powerpack" in the system
17 let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
18 let body = Dashboard::new(
19 DashboardLayoutType::ORDERED,
20 "Example-Dashboard with powerpack widget".to_string(),
21 vec![
22 Widget::new(WidgetDefinition::PowerpackWidgetDefinition(Box::new(
23 PowerpackWidgetDefinition::new(
24 powerpack_data_id.clone(),
25 PowerpackWidgetDefinitionType::POWERPACK,
26 )
27 .template_variables(
28 PowerpackTemplateVariables::new()
29 .controlled_by_powerpack(vec![PowerpackTemplateVariableContents::new(
30 "foo".to_string(),
31 vec!["baz".to_string(), "qux".to_string(), "quuz".to_string()],
32 )
33 .prefix("bar".to_string())])
34 .controlled_externally(vec![]),
35 ),
36 )))
37 .layout(WidgetLayout::new(2, 2, 1, 1).is_column_break(false)),
38 ],
39 )
40 .description(Some("description".to_string()));
41 let configuration = datadog::Configuration::new();
42 let api = DashboardsAPI::with_config(configuration);
43 let resp = api.create_dashboard(body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
Sourcepub fn prefix(self, value: String) -> Self
pub fn prefix(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_1754992756.rs (line 33)
15async fn main() {
16 // there is a valid "powerpack" in the system
17 let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
18 let body = Dashboard::new(
19 DashboardLayoutType::ORDERED,
20 "Example-Dashboard with powerpack widget".to_string(),
21 vec![
22 Widget::new(WidgetDefinition::PowerpackWidgetDefinition(Box::new(
23 PowerpackWidgetDefinition::new(
24 powerpack_data_id.clone(),
25 PowerpackWidgetDefinitionType::POWERPACK,
26 )
27 .template_variables(
28 PowerpackTemplateVariables::new()
29 .controlled_by_powerpack(vec![PowerpackTemplateVariableContents::new(
30 "foo".to_string(),
31 vec!["baz".to_string(), "qux".to_string(), "quuz".to_string()],
32 )
33 .prefix("bar".to_string())])
34 .controlled_externally(vec![]),
35 ),
36 )))
37 .layout(WidgetLayout::new(2, 2, 1, 1).is_column_break(false)),
38 ],
39 )
40 .description(Some("description".to_string()));
41 let configuration = datadog::Configuration::new();
42 let api = DashboardsAPI::with_config(configuration);
43 let resp = api.create_dashboard(body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for PowerpackTemplateVariableContents
impl Clone for PowerpackTemplateVariableContents
Source§fn clone(&self) -> PowerpackTemplateVariableContents
fn clone(&self) -> PowerpackTemplateVariableContents
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 PowerpackTemplateVariableContents
impl<'de> Deserialize<'de> for PowerpackTemplateVariableContents
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 PowerpackTemplateVariableContents
impl PartialEq for PowerpackTemplateVariableContents
Source§fn eq(&self, other: &PowerpackTemplateVariableContents) -> bool
fn eq(&self, other: &PowerpackTemplateVariableContents) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for PowerpackTemplateVariableContents
Auto Trait Implementations§
impl Freeze for PowerpackTemplateVariableContents
impl RefUnwindSafe for PowerpackTemplateVariableContents
impl Send for PowerpackTemplateVariableContents
impl Sync for PowerpackTemplateVariableContents
impl Unpin for PowerpackTemplateVariableContents
impl UnwindSafe for PowerpackTemplateVariableContents
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