#[non_exhaustive]pub struct PowerpackData {
pub attributes: Option<PowerpackAttributes>,
pub id: Option<String>,
pub relationships: Option<PowerpackRelationships>,
pub type_: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Powerpack data 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.attributes: Option<PowerpackAttributes>
Powerpack attribute object.
id: Option<String>
ID of the powerpack.
relationships: Option<PowerpackRelationships>
Powerpack relationship object.
type_: Option<String>
Type of widget, must be powerpack.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl PowerpackData
impl PowerpackData
Sourcepub fn new() -> PowerpackData
pub fn new() -> PowerpackData
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 19)
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 21)
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 attributes(self, value: PowerpackAttributes) -> Self
pub fn attributes(self, value: PowerpackAttributes) -> Self
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (lines 20-42)
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 22-44)
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 id(self, value: String) -> Self
pub fn relationships(self, value: PowerpackRelationships) -> Self
Sourcepub fn type_(self, value: String) -> Self
pub fn type_(self, value: String) -> Self
Examples found in repository?
examples/v2_powerpack_CreatePowerpack.rs (line 43)
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 45)
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 PowerpackData
impl Clone for PowerpackData
Source§fn clone(&self) -> PowerpackData
fn clone(&self) -> PowerpackData
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 PowerpackData
impl Debug for PowerpackData
Source§impl Default for PowerpackData
impl Default for PowerpackData
Source§impl<'de> Deserialize<'de> for PowerpackData
impl<'de> Deserialize<'de> for PowerpackData
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 PowerpackData
impl PartialEq for PowerpackData
Source§impl Serialize for PowerpackData
impl Serialize for PowerpackData
impl StructuralPartialEq for PowerpackData
Auto Trait Implementations§
impl Freeze for PowerpackData
impl RefUnwindSafe for PowerpackData
impl Send for PowerpackData
impl Sync for PowerpackData
impl Unpin for PowerpackData
impl UnwindSafe for PowerpackData
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