Struct datadog_api_client::datadogV2::model::model_powerpack_template_variable::PowerpackTemplateVariable
source · #[non_exhaustive]pub struct PowerpackTemplateVariable {
pub defaults: Option<Vec<String>>,
pub name: String,
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.defaults: Option<Vec<String>>One or many template variable default values within the saved view, which are unioned together using OR if more than one is specified.
name: StringThe name of the variable.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl PowerpackTemplateVariable
impl PowerpackTemplateVariable
sourcepub fn new(name: String) -> PowerpackTemplateVariable
pub fn new(name: String) -> PowerpackTemplateVariable
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 40)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
async fn main() {
let body = Powerpack::new().data(
PowerpackData::new()
.attributes(
PowerpackAttributes::new(
PowerpackGroupWidget::new(
PowerpackGroupWidgetDefinition::new(
"ordered".to_string(),
"group".to_string(),
vec![PowerpackInnerWidgets::new(BTreeMap::from([
("content".to_string(), Value::from("test")),
("type".to_string(), Value::from("note")),
]))],
)
.show_title(true)
.title("Sample Powerpack".to_string()),
)
.layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
.live_span(WidgetLiveSpan::PAST_ONE_HOUR),
"Example-Powerpack".to_string(),
)
.description("Sample powerpack".to_string())
.tags(vec!["tag:sample".to_string()])
.template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
.defaults(vec!["*".to_string()])]),
)
.type_("powerpack".to_string()),
);
let configuration = datadog::Configuration::new();
let api = PowerpackAPI::with_config(configuration);
let resp = api.create_powerpack(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
examples/v2_powerpack_UpdatePowerpack.rs (line 42)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
async fn main() {
// there is a valid "powerpack" in the system
let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
let body = Powerpack::new().data(
PowerpackData::new()
.attributes(
PowerpackAttributes::new(
PowerpackGroupWidget::new(
PowerpackGroupWidgetDefinition::new(
"ordered".to_string(),
"group".to_string(),
vec![PowerpackInnerWidgets::new(BTreeMap::from([
("content".to_string(), Value::from("test")),
("type".to_string(), Value::from("note")),
]))],
)
.show_title(true)
.title("Sample Powerpack".to_string()),
)
.layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
.live_span(WidgetLiveSpan::PAST_ONE_HOUR),
"Example-Powerpack".to_string(),
)
.description("Sample powerpack".to_string())
.tags(vec!["tag:sample".to_string()])
.template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
.defaults(vec!["*".to_string()])]),
)
.type_("powerpack".to_string()),
);
let configuration = datadog::Configuration::new();
let api = PowerpackAPI::with_config(configuration);
let resp = api.update_powerpack(powerpack_data_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn defaults(self, value: Vec<String>) -> Self
pub fn defaults(self, value: Vec<String>) -> Self
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 41)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
async fn main() {
let body = Powerpack::new().data(
PowerpackData::new()
.attributes(
PowerpackAttributes::new(
PowerpackGroupWidget::new(
PowerpackGroupWidgetDefinition::new(
"ordered".to_string(),
"group".to_string(),
vec![PowerpackInnerWidgets::new(BTreeMap::from([
("content".to_string(), Value::from("test")),
("type".to_string(), Value::from("note")),
]))],
)
.show_title(true)
.title("Sample Powerpack".to_string()),
)
.layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
.live_span(WidgetLiveSpan::PAST_ONE_HOUR),
"Example-Powerpack".to_string(),
)
.description("Sample powerpack".to_string())
.tags(vec!["tag:sample".to_string()])
.template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
.defaults(vec!["*".to_string()])]),
)
.type_("powerpack".to_string()),
);
let configuration = datadog::Configuration::new();
let api = PowerpackAPI::with_config(configuration);
let resp = api.create_powerpack(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
examples/v2_powerpack_UpdatePowerpack.rs (line 43)
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
async fn main() {
// there is a valid "powerpack" in the system
let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
let body = Powerpack::new().data(
PowerpackData::new()
.attributes(
PowerpackAttributes::new(
PowerpackGroupWidget::new(
PowerpackGroupWidgetDefinition::new(
"ordered".to_string(),
"group".to_string(),
vec![PowerpackInnerWidgets::new(BTreeMap::from([
("content".to_string(), Value::from("test")),
("type".to_string(), Value::from("note")),
]))],
)
.show_title(true)
.title("Sample Powerpack".to_string()),
)
.layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
.live_span(WidgetLiveSpan::PAST_ONE_HOUR),
"Example-Powerpack".to_string(),
)
.description("Sample powerpack".to_string())
.tags(vec!["tag:sample".to_string()])
.template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
.defaults(vec!["*".to_string()])]),
)
.type_("powerpack".to_string()),
);
let configuration = datadog::Configuration::new();
let api = PowerpackAPI::with_config(configuration);
let resp = api.update_powerpack(powerpack_data_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
source§impl Clone for PowerpackTemplateVariable
impl Clone for PowerpackTemplateVariable
source§fn clone(&self) -> PowerpackTemplateVariable
fn clone(&self) -> PowerpackTemplateVariable
Returns a copy 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 PowerpackTemplateVariable
impl Debug for PowerpackTemplateVariable
source§impl<'de> Deserialize<'de> for PowerpackTemplateVariable
impl<'de> Deserialize<'de> for PowerpackTemplateVariable
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 PowerpackTemplateVariable
Auto Trait Implementations§
impl Freeze for PowerpackTemplateVariable
impl RefUnwindSafe for PowerpackTemplateVariable
impl Send for PowerpackTemplateVariable
impl Sync for PowerpackTemplateVariable
impl Unpin for PowerpackTemplateVariable
impl UnwindSafe for PowerpackTemplateVariable
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)