Skip to content

Commit 81ae8dd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
[BGL-1927] Add timezone to on-call layer (#3474)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e829d85 commit 81ae8dd

File tree

4 files changed

+120
-3
lines changed

4 files changed

+120
-3
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28204,6 +28204,10 @@ components:
2820428204
description: The date/time when the rotation starts (ISO 8601).
2820528205
format: date-time
2820628206
type: string
28207+
time_zone:
28208+
description: The time zone for this layer.
28209+
example: America/New_York
28210+
type: string
2820728211
type: object
2820828212
LayerAttributesInterval:
2820928213
description: Defines how often the rotation repeats, using a combination of
@@ -44308,6 +44312,10 @@ components:
4430844312
example: '2025-01-01T00:00:00Z'
4430944313
format: date-time
4431044314
type: string
44315+
time_zone:
44316+
description: The time zone for this layer.
44317+
example: America/New_York
44318+
type: string
4431144319
required:
4431244320
- name
4431344321
- interval
@@ -44658,6 +44666,10 @@ components:
4465844666
example: '2025-02-01T00:00:00Z'
4465944667
format: date-time
4466044668
type: string
44669+
time_zone:
44670+
description: The time zone for this layer.
44671+
example: America/New_York
44672+
type: string
4466144673
required:
4466244674
- effective_date
4466344675
- interval

api/datadogV2/model_layer_attributes.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ type LayerAttributes struct {
2424
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
2525
// The date/time when the rotation starts (ISO 8601).
2626
RotationStart *time.Time `json:"rotation_start,omitempty"`
27+
// The time zone for this layer.
28+
TimeZone *string `json:"time_zone,omitempty"`
2729
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2830
UnparsedObject map[string]interface{} `json:"-"`
2931
AdditionalProperties map[string]interface{} `json:"-"`
@@ -214,6 +216,34 @@ func (o *LayerAttributes) SetRotationStart(v time.Time) {
214216
o.RotationStart = &v
215217
}
216218

219+
// GetTimeZone returns the TimeZone field value if set, zero value otherwise.
220+
func (o *LayerAttributes) GetTimeZone() string {
221+
if o == nil || o.TimeZone == nil {
222+
var ret string
223+
return ret
224+
}
225+
return *o.TimeZone
226+
}
227+
228+
// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise
229+
// and a boolean to check if the value has been set.
230+
func (o *LayerAttributes) GetTimeZoneOk() (*string, bool) {
231+
if o == nil || o.TimeZone == nil {
232+
return nil, false
233+
}
234+
return o.TimeZone, true
235+
}
236+
237+
// HasTimeZone returns a boolean if a field has been set.
238+
func (o *LayerAttributes) HasTimeZone() bool {
239+
return o != nil && o.TimeZone != nil
240+
}
241+
242+
// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field.
243+
func (o *LayerAttributes) SetTimeZone(v string) {
244+
o.TimeZone = &v
245+
}
246+
217247
// MarshalJSON serializes the struct using spec logic.
218248
func (o LayerAttributes) MarshalJSON() ([]byte, error) {
219249
toSerialize := map[string]interface{}{}
@@ -250,6 +280,9 @@ func (o LayerAttributes) MarshalJSON() ([]byte, error) {
250280
toSerialize["rotation_start"] = o.RotationStart.Format("2006-01-02T15:04:05.000Z07:00")
251281
}
252282
}
283+
if o.TimeZone != nil {
284+
toSerialize["time_zone"] = o.TimeZone
285+
}
253286

254287
for key, value := range o.AdditionalProperties {
255288
toSerialize[key] = value
@@ -266,13 +299,14 @@ func (o *LayerAttributes) UnmarshalJSON(bytes []byte) (err error) {
266299
Name *string `json:"name,omitempty"`
267300
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
268301
RotationStart *time.Time `json:"rotation_start,omitempty"`
302+
TimeZone *string `json:"time_zone,omitempty"`
269303
}{}
270304
if err = datadog.Unmarshal(bytes, &all); err != nil {
271305
return datadog.Unmarshal(bytes, &o.UnparsedObject)
272306
}
273307
additionalProperties := make(map[string]interface{})
274308
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
275-
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "interval", "name", "restrictions", "rotation_start"})
309+
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "interval", "name", "restrictions", "rotation_start", "time_zone"})
276310
} else {
277311
return err
278312
}
@@ -287,6 +321,7 @@ func (o *LayerAttributes) UnmarshalJSON(bytes []byte) (err error) {
287321
o.Name = all.Name
288322
o.Restrictions = all.Restrictions
289323
o.RotationStart = all.RotationStart
324+
o.TimeZone = all.TimeZone
290325

291326
if len(additionalProperties) > 0 {
292327
o.AdditionalProperties = additionalProperties

api/datadogV2/model_schedule_create_request_data_attributes_layers_items.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ type ScheduleCreateRequestDataAttributesLayersItems struct {
2727
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
2828
// The date/time when the rotation for this layer starts (in ISO 8601).
2929
RotationStart time.Time `json:"rotation_start"`
30+
// The time zone for this layer.
31+
TimeZone *string `json:"time_zone,omitempty"`
3032
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
3133
UnparsedObject map[string]interface{} `json:"-"`
3234
AdditionalProperties map[string]interface{} `json:"-"`
@@ -225,6 +227,34 @@ func (o *ScheduleCreateRequestDataAttributesLayersItems) SetRotationStart(v time
225227
o.RotationStart = v
226228
}
227229

230+
// GetTimeZone returns the TimeZone field value if set, zero value otherwise.
231+
func (o *ScheduleCreateRequestDataAttributesLayersItems) GetTimeZone() string {
232+
if o == nil || o.TimeZone == nil {
233+
var ret string
234+
return ret
235+
}
236+
return *o.TimeZone
237+
}
238+
239+
// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise
240+
// and a boolean to check if the value has been set.
241+
func (o *ScheduleCreateRequestDataAttributesLayersItems) GetTimeZoneOk() (*string, bool) {
242+
if o == nil || o.TimeZone == nil {
243+
return nil, false
244+
}
245+
return o.TimeZone, true
246+
}
247+
248+
// HasTimeZone returns a boolean if a field has been set.
249+
func (o *ScheduleCreateRequestDataAttributesLayersItems) HasTimeZone() bool {
250+
return o != nil && o.TimeZone != nil
251+
}
252+
253+
// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field.
254+
func (o *ScheduleCreateRequestDataAttributesLayersItems) SetTimeZone(v string) {
255+
o.TimeZone = &v
256+
}
257+
228258
// MarshalJSON serializes the struct using spec logic.
229259
func (o ScheduleCreateRequestDataAttributesLayersItems) MarshalJSON() ([]byte, error) {
230260
toSerialize := map[string]interface{}{}
@@ -254,6 +284,9 @@ func (o ScheduleCreateRequestDataAttributesLayersItems) MarshalJSON() ([]byte, e
254284
} else {
255285
toSerialize["rotation_start"] = o.RotationStart.Format("2006-01-02T15:04:05.000Z07:00")
256286
}
287+
if o.TimeZone != nil {
288+
toSerialize["time_zone"] = o.TimeZone
289+
}
257290

258291
for key, value := range o.AdditionalProperties {
259292
toSerialize[key] = value
@@ -271,6 +304,7 @@ func (o *ScheduleCreateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
271304
Name *string `json:"name"`
272305
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
273306
RotationStart *time.Time `json:"rotation_start"`
307+
TimeZone *string `json:"time_zone,omitempty"`
274308
}{}
275309
if err = datadog.Unmarshal(bytes, &all); err != nil {
276310
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -292,7 +326,7 @@ func (o *ScheduleCreateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
292326
}
293327
additionalProperties := make(map[string]interface{})
294328
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
295-
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "interval", "members", "name", "restrictions", "rotation_start"})
329+
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "interval", "members", "name", "restrictions", "rotation_start", "time_zone"})
296330
} else {
297331
return err
298332
}
@@ -308,6 +342,7 @@ func (o *ScheduleCreateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
308342
o.Name = *all.Name
309343
o.Restrictions = all.Restrictions
310344
o.RotationStart = *all.RotationStart
345+
o.TimeZone = all.TimeZone
311346

312347
if len(additionalProperties) > 0 {
313348
o.AdditionalProperties = additionalProperties

api/datadogV2/model_schedule_update_request_data_attributes_layers_items.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ type ScheduleUpdateRequestDataAttributesLayersItems struct {
3030
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
3131
// The date/time at which the rotation begins (ISO 8601 format).
3232
RotationStart time.Time `json:"rotation_start"`
33+
// The time zone for this layer.
34+
TimeZone *string `json:"time_zone,omitempty"`
3335
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
3436
UnparsedObject map[string]interface{} `json:"-"`
3537
AdditionalProperties map[string]interface{} `json:"-"`
@@ -256,6 +258,34 @@ func (o *ScheduleUpdateRequestDataAttributesLayersItems) SetRotationStart(v time
256258
o.RotationStart = v
257259
}
258260

261+
// GetTimeZone returns the TimeZone field value if set, zero value otherwise.
262+
func (o *ScheduleUpdateRequestDataAttributesLayersItems) GetTimeZone() string {
263+
if o == nil || o.TimeZone == nil {
264+
var ret string
265+
return ret
266+
}
267+
return *o.TimeZone
268+
}
269+
270+
// GetTimeZoneOk returns a tuple with the TimeZone field value if set, nil otherwise
271+
// and a boolean to check if the value has been set.
272+
func (o *ScheduleUpdateRequestDataAttributesLayersItems) GetTimeZoneOk() (*string, bool) {
273+
if o == nil || o.TimeZone == nil {
274+
return nil, false
275+
}
276+
return o.TimeZone, true
277+
}
278+
279+
// HasTimeZone returns a boolean if a field has been set.
280+
func (o *ScheduleUpdateRequestDataAttributesLayersItems) HasTimeZone() bool {
281+
return o != nil && o.TimeZone != nil
282+
}
283+
284+
// SetTimeZone gets a reference to the given string and assigns it to the TimeZone field.
285+
func (o *ScheduleUpdateRequestDataAttributesLayersItems) SetTimeZone(v string) {
286+
o.TimeZone = &v
287+
}
288+
259289
// MarshalJSON serializes the struct using spec logic.
260290
func (o ScheduleUpdateRequestDataAttributesLayersItems) MarshalJSON() ([]byte, error) {
261291
toSerialize := map[string]interface{}{}
@@ -288,6 +318,9 @@ func (o ScheduleUpdateRequestDataAttributesLayersItems) MarshalJSON() ([]byte, e
288318
} else {
289319
toSerialize["rotation_start"] = o.RotationStart.Format("2006-01-02T15:04:05.000Z07:00")
290320
}
321+
if o.TimeZone != nil {
322+
toSerialize["time_zone"] = o.TimeZone
323+
}
291324

292325
for key, value := range o.AdditionalProperties {
293326
toSerialize[key] = value
@@ -306,6 +339,7 @@ func (o *ScheduleUpdateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
306339
Name *string `json:"name"`
307340
Restrictions []TimeRestriction `json:"restrictions,omitempty"`
308341
RotationStart *time.Time `json:"rotation_start"`
342+
TimeZone *string `json:"time_zone,omitempty"`
309343
}{}
310344
if err = datadog.Unmarshal(bytes, &all); err != nil {
311345
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -327,7 +361,7 @@ func (o *ScheduleUpdateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
327361
}
328362
additionalProperties := make(map[string]interface{})
329363
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
330-
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "id", "interval", "members", "name", "restrictions", "rotation_start"})
364+
datadog.DeleteKeys(additionalProperties, &[]string{"effective_date", "end_date", "id", "interval", "members", "name", "restrictions", "rotation_start", "time_zone"})
331365
} else {
332366
return err
333367
}
@@ -344,6 +378,7 @@ func (o *ScheduleUpdateRequestDataAttributesLayersItems) UnmarshalJSON(bytes []b
344378
o.Name = *all.Name
345379
o.Restrictions = all.Restrictions
346380
o.RotationStart = *all.RotationStart
381+
o.TimeZone = all.TimeZone
347382

348383
if len(additionalProperties) > 0 {
349384
o.AdditionalProperties = additionalProperties

0 commit comments

Comments
 (0)