#[non_exhaustive]pub struct GeomapWidgetDefinitionStyle {
pub palette: String,
pub palette_flip: bool,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
The style to apply to the widget.
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.palette: String
The color palette to apply to the widget.
palette_flip: bool
Whether to flip the palette tones.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl GeomapWidgetDefinitionStyle
impl GeomapWidgetDefinitionStyle
Sourcepub fn new(palette: String, palette_flip: bool) -> GeomapWidgetDefinitionStyle
pub fn new(palette: String, palette_flip: bool) -> GeomapWidgetDefinitionStyle
Examples found in repository?
examples/v1_dashboards_CreateDashboard_3513586382.rs (line 59)
23async fn main() {
24 let body = Dashboard::new(
25 DashboardLayoutType::ORDERED,
26 "Example-Dashboard".to_string(),
27 vec![
28 Widget::new(WidgetDefinition::GeomapWidgetDefinition(Box::new(
29 GeomapWidgetDefinition::new(
30 vec![GeomapWidgetRequest::new()
31 .columns(vec![
32 ListStreamColumn::new(
33 "@network.client.geoip.location.latitude".to_string(),
34 ListStreamColumnWidth::AUTO,
35 ),
36 ListStreamColumn::new(
37 "@network.client.geoip.location.longitude".to_string(),
38 ListStreamColumnWidth::AUTO,
39 ),
40 ListStreamColumn::new(
41 "@network.client.geoip.country.iso_code".to_string(),
42 ListStreamColumnWidth::AUTO,
43 ),
44 ListStreamColumn::new(
45 "@network.client.geoip.subdivision.name".to_string(),
46 ListStreamColumnWidth::AUTO,
47 ),
48 ListStreamColumn::new(
49 "classic".to_string(),
50 ListStreamColumnWidth::AUTO,
51 ),
52 ListStreamColumn::new("".to_string(), ListStreamColumnWidth::AUTO),
53 ])
54 .query(
55 ListStreamQuery::new(ListStreamSource::LOGS_STREAM, "".to_string())
56 .indexes(vec![]),
57 )
58 .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)],
59 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
60 GeomapWidgetDefinitionType::GEOMAP,
61 GeomapWidgetDefinitionView::new("WORLD".to_string()),
62 )
63 .title("".to_string())
64 .title_align(WidgetTextAlign::LEFT)
65 .title_size("16".to_string()),
66 )))
67 .layout(WidgetLayout::new(6, 12, 0, 0)),
68 ],
69 )
70 .description(Some("Example-Dashboard".to_string()))
71 .notify_list(Some(vec![]))
72 .reflow_type(DashboardReflowType::FIXED)
73 .tags(Some(vec![]))
74 .template_variables(Some(vec![]));
75 let configuration = datadog::Configuration::new();
76 let api = DashboardsAPI::with_config(configuration);
77 let resp = api.create_dashboard(body).await;
78 if let Ok(value) = resp {
79 println!("{:#?}", value);
80 } else {
81 println!("{:#?}", resp.unwrap_err());
82 }
83}
More examples
examples/v1_dashboards_CreateDashboard_915214113.rs (line 104)
35async fn main() {
36 let body =
37 Dashboard::new(
38 DashboardLayoutType::FREE,
39 "Example-Dashboard".to_string(),
40 vec![
41 Widget::new(
42 WidgetDefinition::GeomapWidgetDefinition(
43 Box::new(
44 GeomapWidgetDefinition::new(
45 vec![
46 GeomapWidgetRequest::new()
47 .formulas(vec![WidgetFormula::new("query1".to_string())])
48 .queries(
49 vec![
50 FormulaAndFunctionQueryDefinition
51 ::FormulaAndFunctionEventQueryDefinition(
52 Box::new(
53 FormulaAndFunctionEventQueryDefinition::new(
54 FormulaAndFunctionEventQueryDefinitionCompute::new(
55 FormulaAndFunctionEventAggregation::COUNT,
56 ),
57 FormulaAndFunctionEventsDataSource::RUM,
58 "query1".to_string(),
59 )
60 .group_by(
61 vec![
62 FormulaAndFunctionEventQueryGroupBy::new(
63 "@geo.country_iso_code".to_string(),
64 )
65 .limit(250)
66 .sort(
67 FormulaAndFunctionEventQueryGroupBySort
68 ::new(
69 FormulaAndFunctionEventAggregation
70 ::COUNT,
71 ).order(QuerySortOrder::DESC),
72 )
73 ],
74 )
75 .indexes(vec!["*".to_string()])
76 .search(
77 FormulaAndFunctionEventQueryDefinitionSearch::new(
78 "".to_string(),
79 ),
80 ),
81 ),
82 )
83 ],
84 )
85 .response_format(FormulaAndFunctionResponseFormat::SCALAR)
86 .sort(
87 WidgetSortBy::new()
88 .count(250)
89 .order_by(
90 vec![
91 WidgetSortOrderBy::WidgetFormulaSort(
92 Box::new(
93 WidgetFormulaSort::new(
94 0,
95 WidgetSort::DESCENDING,
96 FormulaType::FORMULA,
97 ),
98 ),
99 )
100 ],
101 ),
102 )
103 ],
104 GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false),
105 GeomapWidgetDefinitionType::GEOMAP,
106 GeomapWidgetDefinitionView::new("WORLD".to_string()),
107 )
108 .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
109 .title("".to_string())
110 .title_align(WidgetTextAlign::LEFT)
111 .title_size("16".to_string()),
112 ),
113 ),
114 ).layout(WidgetLayout::new(30, 47, 0, 0))
115 ],
116 )
117 .description(None)
118 .notify_list(Some(vec![]))
119 .template_variables(Some(vec![]));
120 let configuration = datadog::Configuration::new();
121 let api = DashboardsAPI::with_config(configuration);
122 let resp = api.create_dashboard(body).await;
123 if let Ok(value) = resp {
124 println!("{:#?}", value);
125 } else {
126 println!("{:#?}", resp.unwrap_err());
127 }
128}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for GeomapWidgetDefinitionStyle
impl Clone for GeomapWidgetDefinitionStyle
Source§fn clone(&self) -> GeomapWidgetDefinitionStyle
fn clone(&self) -> GeomapWidgetDefinitionStyle
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 GeomapWidgetDefinitionStyle
impl Debug for GeomapWidgetDefinitionStyle
Source§impl<'de> Deserialize<'de> for GeomapWidgetDefinitionStyle
impl<'de> Deserialize<'de> for GeomapWidgetDefinitionStyle
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 GeomapWidgetDefinitionStyle
Auto Trait Implementations§
impl Freeze for GeomapWidgetDefinitionStyle
impl RefUnwindSafe for GeomapWidgetDefinitionStyle
impl Send for GeomapWidgetDefinitionStyle
impl Sync for GeomapWidgetDefinitionStyle
impl Unpin for GeomapWidgetDefinitionStyle
impl UnwindSafe for GeomapWidgetDefinitionStyle
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