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:42:59.495"
"spec_repo_commit": "6b8994f",
"generated": "2025-08-13 15:23:37.731"
}
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
41 changes: 38 additions & 3 deletions api/datadogV1/model_geomap_widget_definition_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (

// GeomapWidgetDefinitionView The view of the world that the map should render.
type GeomapWidgetDefinitionView struct {
// 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]`.
CustomExtent []float64 `json:"custom_extent,omitempty"`
// The ISO code of a country, sub-division, or region to focus the map on. Or `WORLD`. Mutually exclusive with `custom_extent`.
Focus string `json:"focus"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
Expand All @@ -37,6 +39,34 @@ func NewGeomapWidgetDefinitionViewWithDefaults() *GeomapWidgetDefinitionView {
return &this
}

// GetCustomExtent returns the CustomExtent field value if set, zero value otherwise.
func (o *GeomapWidgetDefinitionView) GetCustomExtent() []float64 {
if o == nil || o.CustomExtent == nil {
var ret []float64
return ret
}
return o.CustomExtent
}

// GetCustomExtentOk returns a tuple with the CustomExtent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeomapWidgetDefinitionView) GetCustomExtentOk() (*[]float64, bool) {
if o == nil || o.CustomExtent == nil {
return nil, false
}
return &o.CustomExtent, true
}

// HasCustomExtent returns a boolean if a field has been set.
func (o *GeomapWidgetDefinitionView) HasCustomExtent() bool {
return o != nil && o.CustomExtent != nil
}

// SetCustomExtent gets a reference to the given []float64 and assigns it to the CustomExtent field.
func (o *GeomapWidgetDefinitionView) SetCustomExtent(v []float64) {
o.CustomExtent = v
}

// GetFocus returns the Focus field value.
func (o *GeomapWidgetDefinitionView) GetFocus() string {
if o == nil {
Expand Down Expand Up @@ -66,6 +96,9 @@ func (o GeomapWidgetDefinitionView) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.CustomExtent != nil {
toSerialize["custom_extent"] = o.CustomExtent
}
toSerialize["focus"] = o.Focus

for key, value := range o.AdditionalProperties {
Expand All @@ -77,7 +110,8 @@ func (o GeomapWidgetDefinitionView) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *GeomapWidgetDefinitionView) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Focus *string `json:"focus"`
CustomExtent []float64 `json:"custom_extent,omitempty"`
Focus *string `json:"focus"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand All @@ -87,10 +121,11 @@ func (o *GeomapWidgetDefinitionView) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"focus"})
datadog.DeleteKeys(additionalProperties, &[]string{"custom_extent", "focus"})
} else {
return err
}
o.CustomExtent = all.CustomExtent
o.Focus = *all.Focus

if len(additionalProperties) > 0 {
Expand Down