Struct GeomapWidgetDefinitionStyle

Source
#[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

Source

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
Hide additional 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}
Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for GeomapWidgetDefinitionStyle

Source§

fn clone(&self) -> GeomapWidgetDefinitionStyle

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeomapWidgetDefinitionStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GeomapWidgetDefinitionStyle

Source§

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 GeomapWidgetDefinitionStyle

Source§

fn eq(&self, other: &GeomapWidgetDefinitionStyle) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GeomapWidgetDefinitionStyle

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for GeomapWidgetDefinitionStyle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T