Struct datadog_api_client::datadogV1::model::model_alert_value_widget_definition::AlertValueWidgetDefinition
source · #[non_exhaustive]pub struct AlertValueWidgetDefinition {
pub alert_id: String,
pub precision: Option<i64>,
pub text_align: Option<WidgetTextAlign>,
pub title: Option<String>,
pub title_align: Option<WidgetTextAlign>,
pub title_size: Option<String>,
pub type_: AlertValueWidgetDefinitionType,
pub unit: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}Expand description
Alert values are query values showing the current value of the metric in any monitor defined on your system.
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.alert_id: StringID of the alert to use in the widget.
precision: Option<i64>Number of decimal to show. If not defined, will use the raw value.
text_align: Option<WidgetTextAlign>How to align the text on the widget.
title: Option<String>Title of the widget.
title_align: Option<WidgetTextAlign>How to align the text on the widget.
title_size: Option<String>Size of value in the widget.
type_: AlertValueWidgetDefinitionTypeType of the alert value widget.
unit: Option<String>Unit to display with the value.
additional_properties: BTreeMap<String, Value>Implementations§
source§impl AlertValueWidgetDefinition
impl AlertValueWidgetDefinition
sourcepub fn new(
alert_id: String,
type_: AlertValueWidgetDefinitionType,
) -> AlertValueWidgetDefinition
pub fn new( alert_id: String, type_: AlertValueWidgetDefinitionType, ) -> AlertValueWidgetDefinition
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (lines 21-24)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn precision(self, value: i64) -> Self
pub fn precision(self, value: i64) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 25)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn text_align(self, value: WidgetTextAlign) -> Self
pub fn text_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 26)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn title(self, value: String) -> Self
pub fn title(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 27)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn title_align(self, value: WidgetTextAlign) -> Self
pub fn title_align(self, value: WidgetTextAlign) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 28)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn title_size(self, value: String) -> Self
pub fn title_size(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 29)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub fn unit(self, value: String) -> Self
pub fn unit(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_2316374332.rs (line 30)
14 15 16 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
async fn main() {
// there is a valid "monitor" in the system
let body = Dashboard::new(
DashboardLayoutType::FREE,
"Example-Dashboard".to_string(),
vec![
Widget::new(WidgetDefinition::AlertValueWidgetDefinition(Box::new(
AlertValueWidgetDefinition::new(
"7".to_string(),
AlertValueWidgetDefinitionType::ALERT_VALUE,
)
.precision(2)
.text_align(WidgetTextAlign::LEFT)
.title("".to_string())
.title_align(WidgetTextAlign::LEFT)
.title_size("16".to_string())
.unit("auto".to_string()),
)))
.layout(WidgetLayout::new(8, 15, 0, 0)),
],
)
.description(Some("".to_string()))
.is_read_only(false)
.notify_list(Some(vec![]))
.template_variables(Some(vec![]));
let configuration = datadog::Configuration::new();
let api = DashboardsAPI::with_config(configuration);
let resp = api.create_dashboard(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 AlertValueWidgetDefinition
impl Clone for AlertValueWidgetDefinition
source§fn clone(&self) -> AlertValueWidgetDefinition
fn clone(&self) -> AlertValueWidgetDefinition
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 AlertValueWidgetDefinition
impl Debug for AlertValueWidgetDefinition
source§impl<'de> Deserialize<'de> for AlertValueWidgetDefinition
impl<'de> Deserialize<'de> for AlertValueWidgetDefinition
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 AlertValueWidgetDefinition
Auto Trait Implementations§
impl Freeze for AlertValueWidgetDefinition
impl RefUnwindSafe for AlertValueWidgetDefinition
impl Send for AlertValueWidgetDefinition
impl Sync for AlertValueWidgetDefinition
impl Unpin for AlertValueWidgetDefinition
impl UnwindSafe for AlertValueWidgetDefinition
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)