#[non_exhaustive]pub struct WidgetCustomLink {
pub is_hidden: Option<bool>,
pub label: Option<String>,
pub link: Option<String>,
pub override_label: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Custom links help you connect a data value to a URL, like a Datadog page or your AWS console.
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.The flag for toggling context menu link visibility.
label: Option<String>
The label for the custom link URL. Keep the label short and descriptive. Use metrics and tags as variables.
link: Option<String>
The URL of the custom link. URL must include http
or https
. A relative URL must start with /
.
override_label: Option<String>
The label ID that refers to a context menu link. Can be logs
, hosts
, traces
, profiles
, processes
, containers
, or rum
.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl WidgetCustomLink
impl WidgetCustomLink
Sourcepub fn new() -> WidgetCustomLink
pub fn new() -> WidgetCustomLink
Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 55)
24async fn main() {
25 let body =
26 Dashboard::new(
27 DashboardLayoutType::ORDERED,
28 "Example-Dashboard".to_string(),
29 vec![
30 Widget::new(
31 WidgetDefinition::DistributionWidgetDefinition(
32 Box::new(
33 DistributionWidgetDefinition::new(
34 vec![
35 DistributionWidgetRequest::new()
36 .query(
37 DistributionWidgetHistogramRequestQuery
38 ::FormulaAndFunctionMetricQueryDefinition(
39 Box::new(
40 FormulaAndFunctionMetricQueryDefinition::new(
41 FormulaAndFunctionMetricDataSource::METRICS,
42 "query1".to_string(),
43 "histogram:trace.Load{*}".to_string(),
44 ),
45 ),
46 ),
47 )
48 .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49 .style(WidgetStyle::new().palette("dog_classic".to_string()))
50 ],
51 DistributionWidgetDefinitionType::DISTRIBUTION,
52 )
53 .custom_links(
54 vec![
55 WidgetCustomLink::new()
56 .label("Example".to_string())
57 .link("https://example.org/".to_string())
58 ],
59 )
60 .show_legend(false)
61 .title("Metrics HOP".to_string())
62 .title_align(WidgetTextAlign::LEFT)
63 .title_size("16".to_string())
64 .xaxis(
65 DistributionWidgetXAxis::new()
66 .include_zero(true)
67 .max("auto".to_string())
68 .min("auto".to_string())
69 .scale("linear".to_string()),
70 )
71 .yaxis(
72 DistributionWidgetYAxis::new()
73 .include_zero(true)
74 .max("auto".to_string())
75 .min("auto".to_string())
76 .scale("linear".to_string()),
77 ),
78 ),
79 ),
80 ).layout(WidgetLayout::new(2, 4, 0, 0))
81 ],
82 );
83 let configuration = datadog::Configuration::new();
84 let api = DashboardsAPI::with_config(configuration);
85 let resp = api.create_dashboard(body).await;
86 if let Ok(value) = resp {
87 println!("{:#?}", value);
88 } else {
89 println!("{:#?}", resp.unwrap_err());
90 }
91}
Sourcepub fn label(self, value: String) -> Self
pub fn label(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 56)
24async fn main() {
25 let body =
26 Dashboard::new(
27 DashboardLayoutType::ORDERED,
28 "Example-Dashboard".to_string(),
29 vec![
30 Widget::new(
31 WidgetDefinition::DistributionWidgetDefinition(
32 Box::new(
33 DistributionWidgetDefinition::new(
34 vec![
35 DistributionWidgetRequest::new()
36 .query(
37 DistributionWidgetHistogramRequestQuery
38 ::FormulaAndFunctionMetricQueryDefinition(
39 Box::new(
40 FormulaAndFunctionMetricQueryDefinition::new(
41 FormulaAndFunctionMetricDataSource::METRICS,
42 "query1".to_string(),
43 "histogram:trace.Load{*}".to_string(),
44 ),
45 ),
46 ),
47 )
48 .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49 .style(WidgetStyle::new().palette("dog_classic".to_string()))
50 ],
51 DistributionWidgetDefinitionType::DISTRIBUTION,
52 )
53 .custom_links(
54 vec![
55 WidgetCustomLink::new()
56 .label("Example".to_string())
57 .link("https://example.org/".to_string())
58 ],
59 )
60 .show_legend(false)
61 .title("Metrics HOP".to_string())
62 .title_align(WidgetTextAlign::LEFT)
63 .title_size("16".to_string())
64 .xaxis(
65 DistributionWidgetXAxis::new()
66 .include_zero(true)
67 .max("auto".to_string())
68 .min("auto".to_string())
69 .scale("linear".to_string()),
70 )
71 .yaxis(
72 DistributionWidgetYAxis::new()
73 .include_zero(true)
74 .max("auto".to_string())
75 .min("auto".to_string())
76 .scale("linear".to_string()),
77 ),
78 ),
79 ),
80 ).layout(WidgetLayout::new(2, 4, 0, 0))
81 ],
82 );
83 let configuration = datadog::Configuration::new();
84 let api = DashboardsAPI::with_config(configuration);
85 let resp = api.create_dashboard(body).await;
86 if let Ok(value) = resp {
87 println!("{:#?}", value);
88 } else {
89 println!("{:#?}", resp.unwrap_err());
90 }
91}
Sourcepub fn link(self, value: String) -> Self
pub fn link(self, value: String) -> Self
Examples found in repository?
examples/v1_dashboards_CreateDashboard_252716965.rs (line 57)
24async fn main() {
25 let body =
26 Dashboard::new(
27 DashboardLayoutType::ORDERED,
28 "Example-Dashboard".to_string(),
29 vec![
30 Widget::new(
31 WidgetDefinition::DistributionWidgetDefinition(
32 Box::new(
33 DistributionWidgetDefinition::new(
34 vec![
35 DistributionWidgetRequest::new()
36 .query(
37 DistributionWidgetHistogramRequestQuery
38 ::FormulaAndFunctionMetricQueryDefinition(
39 Box::new(
40 FormulaAndFunctionMetricQueryDefinition::new(
41 FormulaAndFunctionMetricDataSource::METRICS,
42 "query1".to_string(),
43 "histogram:trace.Load{*}".to_string(),
44 ),
45 ),
46 ),
47 )
48 .request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)
49 .style(WidgetStyle::new().palette("dog_classic".to_string()))
50 ],
51 DistributionWidgetDefinitionType::DISTRIBUTION,
52 )
53 .custom_links(
54 vec![
55 WidgetCustomLink::new()
56 .label("Example".to_string())
57 .link("https://example.org/".to_string())
58 ],
59 )
60 .show_legend(false)
61 .title("Metrics HOP".to_string())
62 .title_align(WidgetTextAlign::LEFT)
63 .title_size("16".to_string())
64 .xaxis(
65 DistributionWidgetXAxis::new()
66 .include_zero(true)
67 .max("auto".to_string())
68 .min("auto".to_string())
69 .scale("linear".to_string()),
70 )
71 .yaxis(
72 DistributionWidgetYAxis::new()
73 .include_zero(true)
74 .max("auto".to_string())
75 .min("auto".to_string())
76 .scale("linear".to_string()),
77 ),
78 ),
79 ),
80 ).layout(WidgetLayout::new(2, 4, 0, 0))
81 ],
82 );
83 let configuration = datadog::Configuration::new();
84 let api = DashboardsAPI::with_config(configuration);
85 let resp = api.create_dashboard(body).await;
86 if let Ok(value) = resp {
87 println!("{:#?}", value);
88 } else {
89 println!("{:#?}", resp.unwrap_err());
90 }
91}
pub fn override_label(self, value: String) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for WidgetCustomLink
impl Clone for WidgetCustomLink
Source§fn clone(&self) -> WidgetCustomLink
fn clone(&self) -> WidgetCustomLink
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 WidgetCustomLink
impl Debug for WidgetCustomLink
Source§impl Default for WidgetCustomLink
impl Default for WidgetCustomLink
Source§impl<'de> Deserialize<'de> for WidgetCustomLink
impl<'de> Deserialize<'de> for WidgetCustomLink
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 WidgetCustomLink
impl PartialEq for WidgetCustomLink
Source§impl Serialize for WidgetCustomLink
impl Serialize for WidgetCustomLink
impl StructuralPartialEq for WidgetCustomLink
Auto Trait Implementations§
impl Freeze for WidgetCustomLink
impl RefUnwindSafe for WidgetCustomLink
impl Send for WidgetCustomLink
impl Sync for WidgetCustomLink
impl Unpin for WidgetCustomLink
impl UnwindSafe for WidgetCustomLink
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