#[non_exhaustive]pub struct PowerpackTemplateVariables {
pub controlled_by_powerpack: Option<Vec<PowerpackTemplateVariableContents>>,
pub controlled_externally: Option<Vec<PowerpackTemplateVariableContents>>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Powerpack template variables.
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.controlled_by_powerpack: Option<Vec<PowerpackTemplateVariableContents>>
Template variables controlled at the powerpack level.
controlled_externally: Option<Vec<PowerpackTemplateVariableContents>>
Template variables controlled by the external resource, such as the dashboard this powerpack is on.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl PowerpackTemplateVariables
impl PowerpackTemplateVariables
Sourcepub fn new() -> PowerpackTemplateVariables
pub fn new() -> PowerpackTemplateVariables
Examples found in repository?
examples/v1_dashboards_CreateDashboard_1754992756.rs (line 28)
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 controlled_by_powerpack(
self,
value: Vec<PowerpackTemplateVariableContents>,
) -> Self
pub fn controlled_by_powerpack( self, value: Vec<PowerpackTemplateVariableContents>, ) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_1754992756.rs (lines 29-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}
Sourcepub fn controlled_externally(
self,
value: Vec<PowerpackTemplateVariableContents>,
) -> Self
pub fn controlled_externally( self, value: Vec<PowerpackTemplateVariableContents>, ) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_1754992756.rs (line 34)
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 PowerpackTemplateVariables
impl Clone for PowerpackTemplateVariables
Source§fn clone(&self) -> PowerpackTemplateVariables
fn clone(&self) -> PowerpackTemplateVariables
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 PowerpackTemplateVariables
impl Debug for PowerpackTemplateVariables
Source§impl Default for PowerpackTemplateVariables
impl Default for PowerpackTemplateVariables
Source§impl<'de> Deserialize<'de> for PowerpackTemplateVariables
impl<'de> Deserialize<'de> for PowerpackTemplateVariables
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
impl StructuralPartialEq for PowerpackTemplateVariables
Auto Trait Implementations§
impl Freeze for PowerpackTemplateVariables
impl RefUnwindSafe for PowerpackTemplateVariables
impl Send for PowerpackTemplateVariables
impl Sync for PowerpackTemplateVariables
impl Unpin for PowerpackTemplateVariables
impl UnwindSafe for PowerpackTemplateVariables
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