diff --git a/.apigentools-info b/.apigentools-info index 3b1f87db3..6cef0cfa0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-26 17:56:17.758022", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-26 21:05:33.041204", + "spec_repo_commit": "3211ca1b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-26 17:56:17.774479", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-26 21:05:33.057660", + "spec_repo_commit": "3211ca1b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3ff83bedc..9c8dd33e0 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3439,13 +3439,28 @@ components: example: focus: WORLD properties: + custom_extent: + description: A custom extent of the map defined by an array of four numbers + in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`. + Mutually exclusive with `focus`. + example: + - -30 + - -40 + - 40 + - 30 + items: + description: The longitudinal or latitudinal coordinates of the bounding + box. + format: double + type: number + maxItems: 4 + minItems: 4 + type: array focus: description: The 2-letter ISO code of a country to focus the map on. Or - `WORLD`. + `WORLD`. Mutually exclusive with `custom_extent`. example: WORLD type: string - required: - - focus type: object GeomapWidgetRequest: description: An updated geomap widget. diff --git a/examples/v1_dashboards_CreateDashboard_3513586382.rs b/examples/v1_dashboards_CreateDashboard_3513586382.rs index 9fd99917e..96fa7d640 100644 --- a/examples/v1_dashboards_CreateDashboard_3513586382.rs +++ b/examples/v1_dashboards_CreateDashboard_3513586382.rs @@ -58,7 +58,7 @@ async fn main() { .response_format(FormulaAndFunctionResponseFormat::EVENT_LIST)], GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false), GeomapWidgetDefinitionType::GEOMAP, - GeomapWidgetDefinitionView::new("WORLD".to_string()), + GeomapWidgetDefinitionView::new().focus("WORLD".to_string()), ) .title("".to_string()) .title_align(WidgetTextAlign::LEFT) diff --git a/examples/v1_dashboards_CreateDashboard_915214113.rs b/examples/v1_dashboards_CreateDashboard_915214113.rs index ad32a36da..3e0c3840e 100644 --- a/examples/v1_dashboards_CreateDashboard_915214113.rs +++ b/examples/v1_dashboards_CreateDashboard_915214113.rs @@ -103,7 +103,7 @@ async fn main() { ], GeomapWidgetDefinitionStyle::new("hostmap_blues".to_string(), false), GeomapWidgetDefinitionType::GEOMAP, - GeomapWidgetDefinitionView::new("WORLD".to_string()), + GeomapWidgetDefinitionView::new().focus("WORLD".to_string()), ) .time(WidgetTime::WidgetLegacyLiveSpan(Box::new(WidgetLegacyLiveSpan::new()))) .title("".to_string()) diff --git a/src/datadogV1/model/model_geomap_widget_definition_view.rs b/src/datadogV1/model/model_geomap_widget_definition_view.rs index 97408312c..d15f96507 100644 --- a/src/datadogV1/model/model_geomap_widget_definition_view.rs +++ b/src/datadogV1/model/model_geomap_widget_definition_view.rs @@ -11,9 +11,12 @@ use std::fmt::{self, Formatter}; #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct GeomapWidgetDefinitionView { - /// The 2-letter ISO code of a country to focus the map on. Or `WORLD`. + /// A custom extent of the map defined by an array of four numbers in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`. Mutually exclusive with `focus`. + #[serde(rename = "custom_extent")] + pub custom_extent: Option>, + /// The 2-letter ISO code of a country to focus the map on. Or `WORLD`. Mutually exclusive with `custom_extent`. #[serde(rename = "focus")] - pub focus: String, + pub focus: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -22,14 +25,25 @@ pub struct GeomapWidgetDefinitionView { } impl GeomapWidgetDefinitionView { - pub fn new(focus: String) -> GeomapWidgetDefinitionView { + pub fn new() -> GeomapWidgetDefinitionView { GeomapWidgetDefinitionView { - focus, + custom_extent: None, + focus: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn custom_extent(mut self, value: Vec) -> Self { + self.custom_extent = Some(value); + self + } + + pub fn focus(mut self, value: String) -> Self { + self.focus = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -39,6 +53,12 @@ impl GeomapWidgetDefinitionView { } } +impl Default for GeomapWidgetDefinitionView { + fn default() -> Self { + Self::new() + } +} + impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView { fn deserialize(deserializer: D) -> Result where @@ -56,6 +76,7 @@ impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView { where M: MapAccess<'a>, { + let mut custom_extent: Option> = None; let mut focus: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -65,7 +86,17 @@ impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { + "custom_extent" => { + if v.is_null() { + continue; + } + custom_extent = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "focus" => { + if v.is_null() { + continue; + } focus = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { @@ -75,9 +106,9 @@ impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView { } } } - let focus = focus.ok_or_else(|| M::Error::missing_field("focus"))?; let content = GeomapWidgetDefinitionView { + custom_extent, focus, additional_properties, _unparsed,