Struct QueryValueWidgetRequest

Source
#[non_exhaustive]
pub struct QueryValueWidgetRequest {
Show 16 fields pub aggregator: Option<WidgetAggregator>, pub apm_query: Option<LogQueryDefinition>, pub audit_query: Option<LogQueryDefinition>, pub conditional_formats: Option<Vec<WidgetConditionalFormat>>, pub event_query: Option<LogQueryDefinition>, pub formulas: Option<Vec<WidgetFormula>>, pub log_query: Option<LogQueryDefinition>, pub network_query: Option<LogQueryDefinition>, pub process_query: Option<ProcessQueryDefinition>, pub profile_metrics_query: Option<LogQueryDefinition>, pub q: Option<String>, pub queries: Option<Vec<FormulaAndFunctionQueryDefinition>>, pub response_format: Option<FormulaAndFunctionResponseFormat>, pub rum_query: Option<LogQueryDefinition>, pub security_query: Option<LogQueryDefinition>, pub additional_properties: BTreeMap<String, Value>, /* private fields */
}
Expand description

Updated query value 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.
§aggregator: Option<WidgetAggregator>

Aggregator used for the request.

§apm_query: Option<LogQueryDefinition>

The log query.

§audit_query: Option<LogQueryDefinition>

The log query.

§conditional_formats: Option<Vec<WidgetConditionalFormat>>

List of conditional formats.

§event_query: Option<LogQueryDefinition>

The log query.

§formulas: Option<Vec<WidgetFormula>>

List of formulas that operate on queries.

§log_query: Option<LogQueryDefinition>

The log query.

§network_query: Option<LogQueryDefinition>

The log query.

§process_query: Option<ProcessQueryDefinition>

The process query to use in the widget.

§profile_metrics_query: Option<LogQueryDefinition>

The log query.

§q: Option<String>

TODO.

§queries: Option<Vec<FormulaAndFunctionQueryDefinition>>

List of queries that can be returned directly or used in formulas.

§response_format: Option<FormulaAndFunctionResponseFormat>

Timeseries, scalar, or event list response. Event list response formats are supported by Geomap widgets.

§rum_query: Option<LogQueryDefinition>

The log query.

§security_query: Option<LogQueryDefinition>

The log query.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl QueryValueWidgetRequest

Source

pub fn new() -> QueryValueWidgetRequest

Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 33)
22async fn main() {
23    let body =
24        Dashboard::new(
25            DashboardLayoutType::FREE,
26            "Example-Dashboard".to_string(),
27            vec![
28                Widget::new(
29                    WidgetDefinition::QueryValueWidgetDefinition(
30                        Box::new(
31                            QueryValueWidgetDefinition::new(
32                                vec![
33                                    QueryValueWidgetRequest::new()
34                                        .queries(
35                                            vec![
36                                                FormulaAndFunctionQueryDefinition
37                                                ::FormulaAndFunctionMetricQueryDefinition(
38                                                    Box::new(
39                                                        FormulaAndFunctionMetricQueryDefinition::new(
40                                                            FormulaAndFunctionMetricDataSource::METRICS,
41                                                            "query1".to_string(),
42                                                            "avg:system.cpu.user{*}".to_string(),
43                                                        ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44                                                    ),
45                                                )
46                                            ],
47                                        )
48                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49                                ],
50                                QueryValueWidgetDefinitionType::QUERY_VALUE,
51                            )
52                                .autoscale(true)
53                                .precision(2)
54                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55                                .title("".to_string())
56                                .title_align(WidgetTextAlign::LEFT)
57                                .title_size("16".to_string()),
58                        ),
59                    ),
60                ).layout(WidgetLayout::new(15, 47, 0, 0))
61            ],
62        )
63            .description(Some("".to_string()))
64            .notify_list(Some(vec![]))
65            .template_variables(Some(vec![]));
66    let configuration = datadog::Configuration::new();
67    let api = DashboardsAPI::with_config(configuration);
68    let resp = api.create_dashboard(body).await;
69    if let Ok(value) = resp {
70        println!("{:#?}", value);
71    } else {
72        println!("{:#?}", resp.unwrap_err());
73    }
74}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 34)
23async fn main() {
24    let body =
25        Dashboard::new(
26            DashboardLayoutType::ORDERED,
27            "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28            vec![
29                Widget::new(
30                    WidgetDefinition::QueryValueWidgetDefinition(
31                        Box::new(
32                            QueryValueWidgetDefinition::new(
33                                vec![
34                                    QueryValueWidgetRequest::new()
35                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
36                                        .queries(
37                                            vec![
38                                                FormulaAndFunctionQueryDefinition
39                                                ::FormulaAndFunctionMetricQueryDefinition(
40                                                    Box::new(
41                                                        FormulaAndFunctionMetricQueryDefinition::new(
42                                                            FormulaAndFunctionMetricDataSource::METRICS,
43                                                            "query1".to_string(),
44                                                            "p90:dist.dd.dogweb.latency{*}".to_string(),
45                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46                                                    ),
47                                                )
48                                            ],
49                                        )
50                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51                                ],
52                                QueryValueWidgetDefinitionType::QUERY_VALUE,
53                            )
54                                .autoscale(true)
55                                .precision(2)
56                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57                                .title("".to_string())
58                                .title_align(WidgetTextAlign::LEFT)
59                                .title_size("16".to_string()),
60                        ),
61                    ),
62                ).layout(WidgetLayout::new(2, 2, 0, 0))
63            ],
64        );
65    let configuration = datadog::Configuration::new();
66    let api = DashboardsAPI::with_config(configuration);
67    let resp = api.create_dashboard(body).await;
68    if let Ok(value) = resp {
69        println!("{:#?}", value);
70    } else {
71        println!("{:#?}", resp.unwrap_err());
72    }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 37)
26async fn main() {
27    let body =
28        Dashboard::new(
29            DashboardLayoutType::ORDERED,
30            "Example-Dashboard with QVW Timeseries Background".to_string(),
31            vec![
32                Widget::new(
33                    WidgetDefinition::QueryValueWidgetDefinition(
34                        Box::new(
35                            QueryValueWidgetDefinition::new(
36                                vec![
37                                    QueryValueWidgetRequest::new()
38                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
39                                        .queries(
40                                            vec![
41                                                FormulaAndFunctionQueryDefinition
42                                                ::FormulaAndFunctionMetricQueryDefinition(
43                                                    Box::new(
44                                                        FormulaAndFunctionMetricQueryDefinition::new(
45                                                            FormulaAndFunctionMetricDataSource::METRICS,
46                                                            "query1".to_string(),
47                                                            "sum:my.cool.count.metric{*}".to_string(),
48                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49                                                    ),
50                                                )
51                                            ],
52                                        )
53                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54                                ],
55                                QueryValueWidgetDefinitionType::QUERY_VALUE,
56                            )
57                                .autoscale(true)
58                                .precision(2)
59                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60                                .timeseries_background(
61                                    TimeseriesBackground::new(
62                                        TimeseriesBackgroundType::AREA,
63                                    ).yaxis(WidgetAxis::new().include_zero(true)),
64                                )
65                                .title("".to_string())
66                                .title_align(WidgetTextAlign::LEFT)
67                                .title_size("16".to_string()),
68                        ),
69                    ),
70                ).layout(WidgetLayout::new(2, 2, 0, 0))
71            ],
72        );
73    let configuration = datadog::Configuration::new();
74    let api = DashboardsAPI::with_config(configuration);
75    let resp = api.create_dashboard(body).await;
76    if let Ok(value) = resp {
77        println!("{:#?}", value);
78    } else {
79        println!("{:#?}", resp.unwrap_err());
80    }
81}
Source

pub fn aggregator(self, value: WidgetAggregator) -> Self

Source

pub fn apm_query(self, value: LogQueryDefinition) -> Self

Source

pub fn audit_query(self, value: LogQueryDefinition) -> Self

Source

pub fn conditional_formats(self, value: Vec<WidgetConditionalFormat>) -> Self

Source

pub fn event_query(self, value: LogQueryDefinition) -> Self

Source

pub fn formulas(self, value: Vec<WidgetFormula>) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 35)
23async fn main() {
24    let body =
25        Dashboard::new(
26            DashboardLayoutType::ORDERED,
27            "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28            vec![
29                Widget::new(
30                    WidgetDefinition::QueryValueWidgetDefinition(
31                        Box::new(
32                            QueryValueWidgetDefinition::new(
33                                vec![
34                                    QueryValueWidgetRequest::new()
35                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
36                                        .queries(
37                                            vec![
38                                                FormulaAndFunctionQueryDefinition
39                                                ::FormulaAndFunctionMetricQueryDefinition(
40                                                    Box::new(
41                                                        FormulaAndFunctionMetricQueryDefinition::new(
42                                                            FormulaAndFunctionMetricDataSource::METRICS,
43                                                            "query1".to_string(),
44                                                            "p90:dist.dd.dogweb.latency{*}".to_string(),
45                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46                                                    ),
47                                                )
48                                            ],
49                                        )
50                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51                                ],
52                                QueryValueWidgetDefinitionType::QUERY_VALUE,
53                            )
54                                .autoscale(true)
55                                .precision(2)
56                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57                                .title("".to_string())
58                                .title_align(WidgetTextAlign::LEFT)
59                                .title_size("16".to_string()),
60                        ),
61                    ),
62                ).layout(WidgetLayout::new(2, 2, 0, 0))
63            ],
64        );
65    let configuration = datadog::Configuration::new();
66    let api = DashboardsAPI::with_config(configuration);
67    let resp = api.create_dashboard(body).await;
68    if let Ok(value) = resp {
69        println!("{:#?}", value);
70    } else {
71        println!("{:#?}", resp.unwrap_err());
72    }
73}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_765140092.rs (line 38)
26async fn main() {
27    let body =
28        Dashboard::new(
29            DashboardLayoutType::ORDERED,
30            "Example-Dashboard with QVW Timeseries Background".to_string(),
31            vec![
32                Widget::new(
33                    WidgetDefinition::QueryValueWidgetDefinition(
34                        Box::new(
35                            QueryValueWidgetDefinition::new(
36                                vec![
37                                    QueryValueWidgetRequest::new()
38                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
39                                        .queries(
40                                            vec![
41                                                FormulaAndFunctionQueryDefinition
42                                                ::FormulaAndFunctionMetricQueryDefinition(
43                                                    Box::new(
44                                                        FormulaAndFunctionMetricQueryDefinition::new(
45                                                            FormulaAndFunctionMetricDataSource::METRICS,
46                                                            "query1".to_string(),
47                                                            "sum:my.cool.count.metric{*}".to_string(),
48                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49                                                    ),
50                                                )
51                                            ],
52                                        )
53                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54                                ],
55                                QueryValueWidgetDefinitionType::QUERY_VALUE,
56                            )
57                                .autoscale(true)
58                                .precision(2)
59                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60                                .timeseries_background(
61                                    TimeseriesBackground::new(
62                                        TimeseriesBackgroundType::AREA,
63                                    ).yaxis(WidgetAxis::new().include_zero(true)),
64                                )
65                                .title("".to_string())
66                                .title_align(WidgetTextAlign::LEFT)
67                                .title_size("16".to_string()),
68                        ),
69                    ),
70                ).layout(WidgetLayout::new(2, 2, 0, 0))
71            ],
72        );
73    let configuration = datadog::Configuration::new();
74    let api = DashboardsAPI::with_config(configuration);
75    let resp = api.create_dashboard(body).await;
76    if let Ok(value) = resp {
77        println!("{:#?}", value);
78    } else {
79        println!("{:#?}", resp.unwrap_err());
80    }
81}
Source

pub fn log_query(self, value: LogQueryDefinition) -> Self

Source

pub fn network_query(self, value: LogQueryDefinition) -> Self

Source

pub fn process_query(self, value: ProcessQueryDefinition) -> Self

Source

pub fn profile_metrics_query(self, value: LogQueryDefinition) -> Self

Source

pub fn q(self, value: String) -> Self

Source

pub fn queries(self, value: Vec<FormulaAndFunctionQueryDefinition>) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (lines 34-47)
22async fn main() {
23    let body =
24        Dashboard::new(
25            DashboardLayoutType::FREE,
26            "Example-Dashboard".to_string(),
27            vec![
28                Widget::new(
29                    WidgetDefinition::QueryValueWidgetDefinition(
30                        Box::new(
31                            QueryValueWidgetDefinition::new(
32                                vec![
33                                    QueryValueWidgetRequest::new()
34                                        .queries(
35                                            vec![
36                                                FormulaAndFunctionQueryDefinition
37                                                ::FormulaAndFunctionMetricQueryDefinition(
38                                                    Box::new(
39                                                        FormulaAndFunctionMetricQueryDefinition::new(
40                                                            FormulaAndFunctionMetricDataSource::METRICS,
41                                                            "query1".to_string(),
42                                                            "avg:system.cpu.user{*}".to_string(),
43                                                        ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44                                                    ),
45                                                )
46                                            ],
47                                        )
48                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49                                ],
50                                QueryValueWidgetDefinitionType::QUERY_VALUE,
51                            )
52                                .autoscale(true)
53                                .precision(2)
54                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55                                .title("".to_string())
56                                .title_align(WidgetTextAlign::LEFT)
57                                .title_size("16".to_string()),
58                        ),
59                    ),
60                ).layout(WidgetLayout::new(15, 47, 0, 0))
61            ],
62        )
63            .description(Some("".to_string()))
64            .notify_list(Some(vec![]))
65            .template_variables(Some(vec![]));
66    let configuration = datadog::Configuration::new();
67    let api = DashboardsAPI::with_config(configuration);
68    let resp = api.create_dashboard(body).await;
69    if let Ok(value) = resp {
70        println!("{:#?}", value);
71    } else {
72        println!("{:#?}", resp.unwrap_err());
73    }
74}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (lines 36-49)
23async fn main() {
24    let body =
25        Dashboard::new(
26            DashboardLayoutType::ORDERED,
27            "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28            vec![
29                Widget::new(
30                    WidgetDefinition::QueryValueWidgetDefinition(
31                        Box::new(
32                            QueryValueWidgetDefinition::new(
33                                vec![
34                                    QueryValueWidgetRequest::new()
35                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
36                                        .queries(
37                                            vec![
38                                                FormulaAndFunctionQueryDefinition
39                                                ::FormulaAndFunctionMetricQueryDefinition(
40                                                    Box::new(
41                                                        FormulaAndFunctionMetricQueryDefinition::new(
42                                                            FormulaAndFunctionMetricDataSource::METRICS,
43                                                            "query1".to_string(),
44                                                            "p90:dist.dd.dogweb.latency{*}".to_string(),
45                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46                                                    ),
47                                                )
48                                            ],
49                                        )
50                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51                                ],
52                                QueryValueWidgetDefinitionType::QUERY_VALUE,
53                            )
54                                .autoscale(true)
55                                .precision(2)
56                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57                                .title("".to_string())
58                                .title_align(WidgetTextAlign::LEFT)
59                                .title_size("16".to_string()),
60                        ),
61                    ),
62                ).layout(WidgetLayout::new(2, 2, 0, 0))
63            ],
64        );
65    let configuration = datadog::Configuration::new();
66    let api = DashboardsAPI::with_config(configuration);
67    let resp = api.create_dashboard(body).await;
68    if let Ok(value) = resp {
69        println!("{:#?}", value);
70    } else {
71        println!("{:#?}", resp.unwrap_err());
72    }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (lines 39-52)
26async fn main() {
27    let body =
28        Dashboard::new(
29            DashboardLayoutType::ORDERED,
30            "Example-Dashboard with QVW Timeseries Background".to_string(),
31            vec![
32                Widget::new(
33                    WidgetDefinition::QueryValueWidgetDefinition(
34                        Box::new(
35                            QueryValueWidgetDefinition::new(
36                                vec![
37                                    QueryValueWidgetRequest::new()
38                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
39                                        .queries(
40                                            vec![
41                                                FormulaAndFunctionQueryDefinition
42                                                ::FormulaAndFunctionMetricQueryDefinition(
43                                                    Box::new(
44                                                        FormulaAndFunctionMetricQueryDefinition::new(
45                                                            FormulaAndFunctionMetricDataSource::METRICS,
46                                                            "query1".to_string(),
47                                                            "sum:my.cool.count.metric{*}".to_string(),
48                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49                                                    ),
50                                                )
51                                            ],
52                                        )
53                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54                                ],
55                                QueryValueWidgetDefinitionType::QUERY_VALUE,
56                            )
57                                .autoscale(true)
58                                .precision(2)
59                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60                                .timeseries_background(
61                                    TimeseriesBackground::new(
62                                        TimeseriesBackgroundType::AREA,
63                                    ).yaxis(WidgetAxis::new().include_zero(true)),
64                                )
65                                .title("".to_string())
66                                .title_align(WidgetTextAlign::LEFT)
67                                .title_size("16".to_string()),
68                        ),
69                    ),
70                ).layout(WidgetLayout::new(2, 2, 0, 0))
71            ],
72        );
73    let configuration = datadog::Configuration::new();
74    let api = DashboardsAPI::with_config(configuration);
75    let resp = api.create_dashboard(body).await;
76    if let Ok(value) = resp {
77        println!("{:#?}", value);
78    } else {
79        println!("{:#?}", resp.unwrap_err());
80    }
81}
Source

pub fn response_format(self, value: FormulaAndFunctionResponseFormat) -> Self

Examples found in repository?
examples/v1_dashboards_CreateDashboard_2349863258.rs (line 48)
22async fn main() {
23    let body =
24        Dashboard::new(
25            DashboardLayoutType::FREE,
26            "Example-Dashboard".to_string(),
27            vec![
28                Widget::new(
29                    WidgetDefinition::QueryValueWidgetDefinition(
30                        Box::new(
31                            QueryValueWidgetDefinition::new(
32                                vec![
33                                    QueryValueWidgetRequest::new()
34                                        .queries(
35                                            vec![
36                                                FormulaAndFunctionQueryDefinition
37                                                ::FormulaAndFunctionMetricQueryDefinition(
38                                                    Box::new(
39                                                        FormulaAndFunctionMetricQueryDefinition::new(
40                                                            FormulaAndFunctionMetricDataSource::METRICS,
41                                                            "query1".to_string(),
42                                                            "avg:system.cpu.user{*}".to_string(),
43                                                        ).aggregator(FormulaAndFunctionMetricAggregation::AVG),
44                                                    ),
45                                                )
46                                            ],
47                                        )
48                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
49                                ],
50                                QueryValueWidgetDefinitionType::QUERY_VALUE,
51                            )
52                                .autoscale(true)
53                                .precision(2)
54                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
55                                .title("".to_string())
56                                .title_align(WidgetTextAlign::LEFT)
57                                .title_size("16".to_string()),
58                        ),
59                    ),
60                ).layout(WidgetLayout::new(15, 47, 0, 0))
61            ],
62        )
63            .description(Some("".to_string()))
64            .notify_list(Some(vec![]))
65            .template_variables(Some(vec![]));
66    let configuration = datadog::Configuration::new();
67    let api = DashboardsAPI::with_config(configuration);
68    let resp = api.create_dashboard(body).await;
69    if let Ok(value) = resp {
70        println!("{:#?}", value);
71    } else {
72        println!("{:#?}", resp.unwrap_err());
73    }
74}
More examples
Hide additional examples
examples/v1_dashboards_CreateDashboard_2644712913.rs (line 50)
23async fn main() {
24    let body =
25        Dashboard::new(
26            DashboardLayoutType::ORDERED,
27            "Example-Dashboard with QVW Percentile Aggregator".to_string(),
28            vec![
29                Widget::new(
30                    WidgetDefinition::QueryValueWidgetDefinition(
31                        Box::new(
32                            QueryValueWidgetDefinition::new(
33                                vec![
34                                    QueryValueWidgetRequest::new()
35                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
36                                        .queries(
37                                            vec![
38                                                FormulaAndFunctionQueryDefinition
39                                                ::FormulaAndFunctionMetricQueryDefinition(
40                                                    Box::new(
41                                                        FormulaAndFunctionMetricQueryDefinition::new(
42                                                            FormulaAndFunctionMetricDataSource::METRICS,
43                                                            "query1".to_string(),
44                                                            "p90:dist.dd.dogweb.latency{*}".to_string(),
45                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
46                                                    ),
47                                                )
48                                            ],
49                                        )
50                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
51                                ],
52                                QueryValueWidgetDefinitionType::QUERY_VALUE,
53                            )
54                                .autoscale(true)
55                                .precision(2)
56                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
57                                .title("".to_string())
58                                .title_align(WidgetTextAlign::LEFT)
59                                .title_size("16".to_string()),
60                        ),
61                    ),
62                ).layout(WidgetLayout::new(2, 2, 0, 0))
63            ],
64        );
65    let configuration = datadog::Configuration::new();
66    let api = DashboardsAPI::with_config(configuration);
67    let resp = api.create_dashboard(body).await;
68    if let Ok(value) = resp {
69        println!("{:#?}", value);
70    } else {
71        println!("{:#?}", resp.unwrap_err());
72    }
73}
examples/v1_dashboards_CreateDashboard_765140092.rs (line 53)
26async fn main() {
27    let body =
28        Dashboard::new(
29            DashboardLayoutType::ORDERED,
30            "Example-Dashboard with QVW Timeseries Background".to_string(),
31            vec![
32                Widget::new(
33                    WidgetDefinition::QueryValueWidgetDefinition(
34                        Box::new(
35                            QueryValueWidgetDefinition::new(
36                                vec![
37                                    QueryValueWidgetRequest::new()
38                                        .formulas(vec![WidgetFormula::new("query1".to_string())])
39                                        .queries(
40                                            vec![
41                                                FormulaAndFunctionQueryDefinition
42                                                ::FormulaAndFunctionMetricQueryDefinition(
43                                                    Box::new(
44                                                        FormulaAndFunctionMetricQueryDefinition::new(
45                                                            FormulaAndFunctionMetricDataSource::METRICS,
46                                                            "query1".to_string(),
47                                                            "sum:my.cool.count.metric{*}".to_string(),
48                                                        ).aggregator(FormulaAndFunctionMetricAggregation::PERCENTILE),
49                                                    ),
50                                                )
51                                            ],
52                                        )
53                                        .response_format(FormulaAndFunctionResponseFormat::SCALAR)
54                                ],
55                                QueryValueWidgetDefinitionType::QUERY_VALUE,
56                            )
57                                .autoscale(true)
58                                .precision(2)
59                                .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new())))
60                                .timeseries_background(
61                                    TimeseriesBackground::new(
62                                        TimeseriesBackgroundType::AREA,
63                                    ).yaxis(WidgetAxis::new().include_zero(true)),
64                                )
65                                .title("".to_string())
66                                .title_align(WidgetTextAlign::LEFT)
67                                .title_size("16".to_string()),
68                        ),
69                    ),
70                ).layout(WidgetLayout::new(2, 2, 0, 0))
71            ],
72        );
73    let configuration = datadog::Configuration::new();
74    let api = DashboardsAPI::with_config(configuration);
75    let resp = api.create_dashboard(body).await;
76    if let Ok(value) = resp {
77        println!("{:#?}", value);
78    } else {
79        println!("{:#?}", resp.unwrap_err());
80    }
81}
Source

pub fn rum_query(self, value: LogQueryDefinition) -> Self

Source

pub fn security_query(self, value: LogQueryDefinition) -> Self

Source

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

Trait Implementations§

Source§

impl Clone for QueryValueWidgetRequest

Source§

fn clone(&self) -> QueryValueWidgetRequest

Returns a duplicate 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 QueryValueWidgetRequest

Source§

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

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

impl Default for QueryValueWidgetRequest

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for QueryValueWidgetRequest

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 QueryValueWidgetRequest

Source§

fn eq(&self, other: &QueryValueWidgetRequest) -> 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 QueryValueWidgetRequest

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 QueryValueWidgetRequest

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,