Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "3a6cb30",
"generated": "2025-08-12 15:46:06.984"
"spec_repo_commit": "6b8994f",
"generated": "2025-08-13 15:27:22.639"
}
20 changes: 18 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3446,9 +3446,25 @@ 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]`.
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`.
description: The ISO code of a country, sub-division, or region to focus
the map on. Or `WORLD`. Mutually exclusive with `custom_extent`.
example: WORLD
type: string
required:
Expand Down
20 changes: 19 additions & 1 deletion src/datadogV1/model/model_geomap_widget_definition_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ 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]`.
#[serde(rename = "custom_extent")]
pub custom_extent: Option<Vec<f64>>,
/// The ISO code of a country, sub-division, or region to focus the map on. Or `WORLD`. Mutually exclusive with `custom_extent`.
#[serde(rename = "focus")]
pub focus: String,
#[serde(flatten)]
Expand All @@ -24,12 +27,18 @@ pub struct GeomapWidgetDefinitionView {
impl GeomapWidgetDefinitionView {
pub fn new(focus: String) -> GeomapWidgetDefinitionView {
GeomapWidgetDefinitionView {
custom_extent: None,
focus,
additional_properties: std::collections::BTreeMap::new(),
_unparsed: false,
}
}

pub fn custom_extent(mut self, value: Vec<f64>) -> Self {
self.custom_extent = Some(value);
self
}

pub fn additional_properties(
mut self,
value: std::collections::BTreeMap<String, serde_json::Value>,
Expand All @@ -56,6 +65,7 @@ impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView {
where
M: MapAccess<'a>,
{
let mut custom_extent: Option<Vec<f64>> = None;
let mut focus: Option<String> = None;
let mut additional_properties: std::collections::BTreeMap<
String,
Expand All @@ -65,6 +75,13 @@ impl<'de> Deserialize<'de> for GeomapWidgetDefinitionView {

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
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" => {
focus = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
Expand All @@ -78,6 +95,7 @@ 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,
Expand Down
Loading