Skip to content

Commit 22bd7b3

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

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
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

src/datadogV2/model/model_layer_attributes.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ pub struct LayerAttributes {
2929
/// The date/time when the rotation starts (ISO 8601).
3030
#[serde(rename = "rotation_start")]
3131
pub rotation_start: Option<chrono::DateTime<chrono::Utc>>,
32+
/// The time zone for this layer.
33+
#[serde(rename = "time_zone")]
34+
pub time_zone: Option<String>,
3235
#[serde(flatten)]
3336
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
3437
#[serde(skip)]
@@ -45,6 +48,7 @@ impl LayerAttributes {
4548
name: None,
4649
restrictions: None,
4750
rotation_start: None,
51+
time_zone: None,
4852
additional_properties: std::collections::BTreeMap::new(),
4953
_unparsed: false,
5054
}
@@ -80,6 +84,11 @@ impl LayerAttributes {
8084
self
8185
}
8286

87+
pub fn time_zone(mut self, value: String) -> Self {
88+
self.time_zone = Some(value);
89+
self
90+
}
91+
8392
pub fn additional_properties(
8493
mut self,
8594
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -118,6 +127,7 @@ impl<'de> Deserialize<'de> for LayerAttributes {
118127
let mut name: Option<String> = None;
119128
let mut restrictions: Option<Vec<crate::datadogV2::model::TimeRestriction>> = None;
120129
let mut rotation_start: Option<chrono::DateTime<chrono::Utc>> = None;
130+
let mut time_zone: Option<String> = None;
121131
let mut additional_properties: std::collections::BTreeMap<
122132
String,
123133
serde_json::Value,
@@ -165,6 +175,12 @@ impl<'de> Deserialize<'de> for LayerAttributes {
165175
rotation_start =
166176
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
167177
}
178+
"time_zone" => {
179+
if v.is_null() {
180+
continue;
181+
}
182+
time_zone = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
183+
}
168184
&_ => {
169185
if let Ok(value) = serde_json::from_value(v.clone()) {
170186
additional_properties.insert(k, value);
@@ -180,6 +196,7 @@ impl<'de> Deserialize<'de> for LayerAttributes {
180196
name,
181197
restrictions,
182198
rotation_start,
199+
time_zone,
183200
additional_properties,
184201
_unparsed,
185202
};

src/datadogV2/model/model_schedule_create_request_data_attributes_layers_items.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ pub struct ScheduleCreateRequestDataAttributesLayersItems {
3232
/// The date/time when the rotation for this layer starts (in ISO 8601).
3333
#[serde(rename = "rotation_start")]
3434
pub rotation_start: chrono::DateTime<chrono::Utc>,
35+
/// The time zone for this layer.
36+
#[serde(rename = "time_zone")]
37+
pub time_zone: Option<String>,
3538
#[serde(flatten)]
3639
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
3740
#[serde(skip)]
@@ -55,6 +58,7 @@ impl ScheduleCreateRequestDataAttributesLayersItems {
5558
name,
5659
restrictions: None,
5760
rotation_start,
61+
time_zone: None,
5862
additional_properties: std::collections::BTreeMap::new(),
5963
_unparsed: false,
6064
}
@@ -70,6 +74,11 @@ impl ScheduleCreateRequestDataAttributesLayersItems {
7074
self
7175
}
7276

77+
pub fn time_zone(mut self, value: String) -> Self {
78+
self.time_zone = Some(value);
79+
self
80+
}
81+
7382
pub fn additional_properties(
7483
mut self,
7584
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -103,6 +112,7 @@ impl<'de> Deserialize<'de> for ScheduleCreateRequestDataAttributesLayersItems {
103112
let mut name: Option<String> = None;
104113
let mut restrictions: Option<Vec<crate::datadogV2::model::TimeRestriction>> = None;
105114
let mut rotation_start: Option<chrono::DateTime<chrono::Utc>> = None;
115+
let mut time_zone: Option<String> = None;
106116
let mut additional_properties: std::collections::BTreeMap<
107117
String,
108118
serde_json::Value,
@@ -141,6 +151,12 @@ impl<'de> Deserialize<'de> for ScheduleCreateRequestDataAttributesLayersItems {
141151
rotation_start =
142152
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
143153
}
154+
"time_zone" => {
155+
if v.is_null() {
156+
continue;
157+
}
158+
time_zone = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
159+
}
144160
&_ => {
145161
if let Ok(value) = serde_json::from_value(v.clone()) {
146162
additional_properties.insert(k, value);
@@ -164,6 +180,7 @@ impl<'de> Deserialize<'de> for ScheduleCreateRequestDataAttributesLayersItems {
164180
name,
165181
restrictions,
166182
rotation_start,
183+
time_zone,
167184
additional_properties,
168185
_unparsed,
169186
};

src/datadogV2/model/model_schedule_update_request_data_attributes_layers_items.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ pub struct ScheduleUpdateRequestDataAttributesLayersItems {
3636
/// The date/time at which the rotation begins (ISO 8601 format).
3737
#[serde(rename = "rotation_start")]
3838
pub rotation_start: chrono::DateTime<chrono::Utc>,
39+
/// The time zone for this layer.
40+
#[serde(rename = "time_zone")]
41+
pub time_zone: Option<String>,
3942
#[serde(flatten)]
4043
pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
4144
#[serde(skip)]
@@ -60,6 +63,7 @@ impl ScheduleUpdateRequestDataAttributesLayersItems {
6063
name,
6164
restrictions: None,
6265
rotation_start,
66+
time_zone: None,
6367
additional_properties: std::collections::BTreeMap::new(),
6468
_unparsed: false,
6569
}
@@ -80,6 +84,11 @@ impl ScheduleUpdateRequestDataAttributesLayersItems {
8084
self
8185
}
8286

87+
pub fn time_zone(mut self, value: String) -> Self {
88+
self.time_zone = Some(value);
89+
self
90+
}
91+
8392
pub fn additional_properties(
8493
mut self,
8594
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -114,6 +123,7 @@ impl<'de> Deserialize<'de> for ScheduleUpdateRequestDataAttributesLayersItems {
114123
let mut name: Option<String> = None;
115124
let mut restrictions: Option<Vec<crate::datadogV2::model::TimeRestriction>> = None;
116125
let mut rotation_start: Option<chrono::DateTime<chrono::Utc>> = None;
126+
let mut time_zone: Option<String> = None;
117127
let mut additional_properties: std::collections::BTreeMap<
118128
String,
119129
serde_json::Value,
@@ -158,6 +168,12 @@ impl<'de> Deserialize<'de> for ScheduleUpdateRequestDataAttributesLayersItems {
158168
rotation_start =
159169
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
160170
}
171+
"time_zone" => {
172+
if v.is_null() {
173+
continue;
174+
}
175+
time_zone = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
176+
}
161177
&_ => {
162178
if let Ok(value) = serde_json::from_value(v.clone()) {
163179
additional_properties.insert(k, value);
@@ -182,6 +198,7 @@ impl<'de> Deserialize<'de> for ScheduleUpdateRequestDataAttributesLayersItems {
182198
name,
183199
restrictions,
184200
rotation_start,
201+
time_zone,
185202
additional_properties,
186203
_unparsed,
187204
};

0 commit comments

Comments
 (0)