#[non_exhaustive]pub struct PowerpackGroupWidget {
pub definition: PowerpackGroupWidgetDefinition,
pub layout: Option<PowerpackGroupWidgetLayout>,
pub live_span: Option<WidgetLiveSpan>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Powerpack group widget definition object.
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.definition: PowerpackGroupWidgetDefinition
Powerpack group widget object.
layout: Option<PowerpackGroupWidgetLayout>
Powerpack group widget layout.
live_span: Option<WidgetLiveSpan>
The available timeframes depend on the widget you are using.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl PowerpackGroupWidget
impl PowerpackGroupWidget
Sourcepub fn new(definition: PowerpackGroupWidgetDefinition) -> PowerpackGroupWidget
pub fn new(definition: PowerpackGroupWidgetDefinition) -> PowerpackGroupWidget
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (lines 22-33)
17async fn main() {
18 let body = Powerpack::new().data(
19 PowerpackData::new()
20 .attributes(
21 PowerpackAttributes::new(
22 PowerpackGroupWidget::new(
23 PowerpackGroupWidgetDefinition::new(
24 "ordered".to_string(),
25 "group".to_string(),
26 vec![PowerpackInnerWidgets::new(BTreeMap::from([
27 ("content".to_string(), Value::from("test")),
28 ("type".to_string(), Value::from("note")),
29 ]))],
30 )
31 .show_title(true)
32 .title("Sample Powerpack".to_string()),
33 )
34 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
35 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
36 "Example-Powerpack".to_string(),
37 )
38 .description("Sample powerpack".to_string())
39 .tags(vec!["tag:sample".to_string()])
40 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
41 .defaults(vec!["*".to_string()])]),
42 )
43 .type_("powerpack".to_string()),
44 );
45 let configuration = datadog::Configuration::new();
46 let api = PowerpackAPI::with_config(configuration);
47 let resp = api.create_powerpack(body).await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
More examples
examples/v2_powerpack_UpdatePowerpack.rs (lines 24-35)
17async fn main() {
18 // there is a valid "powerpack" in the system
19 let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
20 let body = Powerpack::new().data(
21 PowerpackData::new()
22 .attributes(
23 PowerpackAttributes::new(
24 PowerpackGroupWidget::new(
25 PowerpackGroupWidgetDefinition::new(
26 "ordered".to_string(),
27 "group".to_string(),
28 vec![PowerpackInnerWidgets::new(BTreeMap::from([
29 ("content".to_string(), Value::from("test")),
30 ("type".to_string(), Value::from("note")),
31 ]))],
32 )
33 .show_title(true)
34 .title("Sample Powerpack".to_string()),
35 )
36 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
37 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
38 "Example-Powerpack".to_string(),
39 )
40 .description("Sample powerpack".to_string())
41 .tags(vec!["tag:sample".to_string()])
42 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
43 .defaults(vec!["*".to_string()])]),
44 )
45 .type_("powerpack".to_string()),
46 );
47 let configuration = datadog::Configuration::new();
48 let api = PowerpackAPI::with_config(configuration);
49 let resp = api.update_powerpack(powerpack_data_id.clone(), body).await;
50 if let Ok(value) = resp {
51 println!("{:#?}", value);
52 } else {
53 println!("{:#?}", resp.unwrap_err());
54 }
55}
Sourcepub fn layout(self, value: PowerpackGroupWidgetLayout) -> Self
pub fn layout(self, value: PowerpackGroupWidgetLayout) -> Self
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 34)
17async fn main() {
18 let body = Powerpack::new().data(
19 PowerpackData::new()
20 .attributes(
21 PowerpackAttributes::new(
22 PowerpackGroupWidget::new(
23 PowerpackGroupWidgetDefinition::new(
24 "ordered".to_string(),
25 "group".to_string(),
26 vec![PowerpackInnerWidgets::new(BTreeMap::from([
27 ("content".to_string(), Value::from("test")),
28 ("type".to_string(), Value::from("note")),
29 ]))],
30 )
31 .show_title(true)
32 .title("Sample Powerpack".to_string()),
33 )
34 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
35 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
36 "Example-Powerpack".to_string(),
37 )
38 .description("Sample powerpack".to_string())
39 .tags(vec!["tag:sample".to_string()])
40 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
41 .defaults(vec!["*".to_string()])]),
42 )
43 .type_("powerpack".to_string()),
44 );
45 let configuration = datadog::Configuration::new();
46 let api = PowerpackAPI::with_config(configuration);
47 let resp = api.create_powerpack(body).await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
More examples
examples/v2_powerpack_UpdatePowerpack.rs (line 36)
17async fn main() {
18 // there is a valid "powerpack" in the system
19 let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
20 let body = Powerpack::new().data(
21 PowerpackData::new()
22 .attributes(
23 PowerpackAttributes::new(
24 PowerpackGroupWidget::new(
25 PowerpackGroupWidgetDefinition::new(
26 "ordered".to_string(),
27 "group".to_string(),
28 vec![PowerpackInnerWidgets::new(BTreeMap::from([
29 ("content".to_string(), Value::from("test")),
30 ("type".to_string(), Value::from("note")),
31 ]))],
32 )
33 .show_title(true)
34 .title("Sample Powerpack".to_string()),
35 )
36 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
37 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
38 "Example-Powerpack".to_string(),
39 )
40 .description("Sample powerpack".to_string())
41 .tags(vec!["tag:sample".to_string()])
42 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
43 .defaults(vec!["*".to_string()])]),
44 )
45 .type_("powerpack".to_string()),
46 );
47 let configuration = datadog::Configuration::new();
48 let api = PowerpackAPI::with_config(configuration);
49 let resp = api.update_powerpack(powerpack_data_id.clone(), body).await;
50 if let Ok(value) = resp {
51 println!("{:#?}", value);
52 } else {
53 println!("{:#?}", resp.unwrap_err());
54 }
55}
Sourcepub fn live_span(self, value: WidgetLiveSpan) -> Self
pub fn live_span(self, value: WidgetLiveSpan) -> Self
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 35)
17async fn main() {
18 let body = Powerpack::new().data(
19 PowerpackData::new()
20 .attributes(
21 PowerpackAttributes::new(
22 PowerpackGroupWidget::new(
23 PowerpackGroupWidgetDefinition::new(
24 "ordered".to_string(),
25 "group".to_string(),
26 vec![PowerpackInnerWidgets::new(BTreeMap::from([
27 ("content".to_string(), Value::from("test")),
28 ("type".to_string(), Value::from("note")),
29 ]))],
30 )
31 .show_title(true)
32 .title("Sample Powerpack".to_string()),
33 )
34 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
35 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
36 "Example-Powerpack".to_string(),
37 )
38 .description("Sample powerpack".to_string())
39 .tags(vec!["tag:sample".to_string()])
40 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
41 .defaults(vec!["*".to_string()])]),
42 )
43 .type_("powerpack".to_string()),
44 );
45 let configuration = datadog::Configuration::new();
46 let api = PowerpackAPI::with_config(configuration);
47 let resp = api.create_powerpack(body).await;
48 if let Ok(value) = resp {
49 println!("{:#?}", value);
50 } else {
51 println!("{:#?}", resp.unwrap_err());
52 }
53}
More examples
examples/v2_powerpack_UpdatePowerpack.rs (line 37)
17async fn main() {
18 // there is a valid "powerpack" in the system
19 let powerpack_data_id = std::env::var("POWERPACK_DATA_ID").unwrap();
20 let body = Powerpack::new().data(
21 PowerpackData::new()
22 .attributes(
23 PowerpackAttributes::new(
24 PowerpackGroupWidget::new(
25 PowerpackGroupWidgetDefinition::new(
26 "ordered".to_string(),
27 "group".to_string(),
28 vec![PowerpackInnerWidgets::new(BTreeMap::from([
29 ("content".to_string(), Value::from("test")),
30 ("type".to_string(), Value::from("note")),
31 ]))],
32 )
33 .show_title(true)
34 .title("Sample Powerpack".to_string()),
35 )
36 .layout(PowerpackGroupWidgetLayout::new(3, 12, 0, 0))
37 .live_span(WidgetLiveSpan::PAST_ONE_HOUR),
38 "Example-Powerpack".to_string(),
39 )
40 .description("Sample powerpack".to_string())
41 .tags(vec!["tag:sample".to_string()])
42 .template_variables(vec![PowerpackTemplateVariable::new("sample".to_string())
43 .defaults(vec!["*".to_string()])]),
44 )
45 .type_("powerpack".to_string()),
46 );
47 let configuration = datadog::Configuration::new();
48 let api = PowerpackAPI::with_config(configuration);
49 let resp = api.update_powerpack(powerpack_data_id.clone(), body).await;
50 if let Ok(value) = resp {
51 println!("{:#?}", value);
52 } else {
53 println!("{:#?}", resp.unwrap_err());
54 }
55}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for PowerpackGroupWidget
impl Clone for PowerpackGroupWidget
Source§fn clone(&self) -> PowerpackGroupWidget
fn clone(&self) -> PowerpackGroupWidget
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 PowerpackGroupWidget
impl Debug for PowerpackGroupWidget
Source§impl<'de> Deserialize<'de> for PowerpackGroupWidget
impl<'de> Deserialize<'de> for PowerpackGroupWidget
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 PowerpackGroupWidget
impl PartialEq for PowerpackGroupWidget
Source§impl Serialize for PowerpackGroupWidget
impl Serialize for PowerpackGroupWidget
impl StructuralPartialEq for PowerpackGroupWidget
Auto Trait Implementations§
impl Freeze for PowerpackGroupWidget
impl RefUnwindSafe for PowerpackGroupWidget
impl Send for PowerpackGroupWidget
impl Sync for PowerpackGroupWidget
impl Unpin for PowerpackGroupWidget
impl UnwindSafe for PowerpackGroupWidget
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