@@ -21,6 +21,9 @@ module DatadogAPIClient::V1
21
21
class GeomapWidgetDefinitionView
22
22
include BaseGenericModel
23
23
24
+ # A custom extent of the map defined by an array of four numbers in the order `[minLongitude, minLatitude, maxLongitude, maxLatitude]`.
25
+ attr_reader :custom_extent
26
+
24
27
# The 2-letter ISO code of a country to focus the map on. Or `WORLD`.
25
28
attr_reader :focus
26
29
@@ -30,6 +33,7 @@ class GeomapWidgetDefinitionView
30
33
# @!visibility private
31
34
def self . attribute_map
32
35
{
36
+ :'custom_extent' => :'custom_extent' ,
33
37
:'focus' => :'focus'
34
38
}
35
39
end
@@ -38,6 +42,7 @@ def self.attribute_map
38
42
# @!visibility private
39
43
def self . openapi_types
40
44
{
45
+ :'custom_extent' => :'Array<Float>' ,
41
46
:'focus' => :'String'
42
47
}
43
48
end
@@ -60,6 +65,12 @@ def initialize(attributes = {})
60
65
end
61
66
}
62
67
68
+ if attributes . key? ( :'custom_extent' )
69
+ if ( value = attributes [ :'custom_extent' ] ) . is_a? ( Array )
70
+ self . custom_extent = value
71
+ end
72
+ end
73
+
63
74
if attributes . key? ( :'focus' )
64
75
self . focus = attributes [ :'focus' ]
65
76
end
@@ -69,10 +80,25 @@ def initialize(attributes = {})
69
80
# @return true if the model is valid
70
81
# @!visibility private
71
82
def valid?
83
+ return false if !@custom_extent . nil? && @custom_extent . length > 4
84
+ return false if !@custom_extent . nil? && @custom_extent . length < 4
72
85
return false if @focus . nil?
73
86
true
74
87
end
75
88
89
+ # Custom attribute writer method with validation
90
+ # @param custom_extent [Object] Object to be assigned
91
+ # @!visibility private
92
+ def custom_extent = ( custom_extent )
93
+ if !custom_extent . nil? && custom_extent . length > 4
94
+ fail ArgumentError , 'invalid value for "custom_extent", number of items must be less than or equal to 4.'
95
+ end
96
+ if !custom_extent . nil? && custom_extent . length < 4
97
+ fail ArgumentError , 'invalid value for "custom_extent", number of items must be greater than or equal to 4.'
98
+ end
99
+ @custom_extent = custom_extent
100
+ end
101
+
76
102
# Custom attribute writer method with validation
77
103
# @param focus [Object] Object to be assigned
78
104
# @!visibility private
@@ -109,6 +135,7 @@ def to_hash
109
135
def ==( o )
110
136
return true if self . equal? ( o )
111
137
self . class == o . class &&
138
+ custom_extent == o . custom_extent &&
112
139
focus == o . focus &&
113
140
additional_properties == o . additional_properties
114
141
end
@@ -117,7 +144,7 @@ def ==(o)
117
144
# @return [Integer] Hash code
118
145
# @!visibility private
119
146
def hash
120
- [ focus , additional_properties ] . hash
147
+ [ custom_extent , focus , additional_properties ] . hash
121
148
end
122
149
end
123
150
end
0 commit comments