Skip to content

Commit 2f923b3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update Synthetics downtime spec for gate write ops on default-settings and add monthly weekday positions (#3847)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 32b54d0 commit 2f923b3

4 files changed

Lines changed: 188 additions & 2 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75136,6 +75136,8 @@ components:
7513675136
example: 1
7513775137
format: int64
7513875138
type: integer
75139+
weekdayPositions:
75140+
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions"
7513975141
weekdays:
7514075142
$ref: "#/components/schemas/SyntheticsDowntimeWeekdays"
7514175143
required:
@@ -75153,6 +75155,8 @@ components:
7515375155
type: integer
7515475156
until:
7515575157
$ref: "#/components/schemas/SyntheticsDowntimeTimeSlotDate"
75158+
weekdayPositions:
75159+
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPositions"
7515675160
weekdays:
7515775161
$ref: "#/components/schemas/SyntheticsDowntimeWeekdays"
7515875162
required:
@@ -75264,6 +75268,32 @@ components:
7526475268
- FRIDAY
7526575269
- SATURDAY
7526675270
- SUNDAY
75271+
SyntheticsDowntimeWeekdayPosition:
75272+
description: >-
75273+
The position of a weekday within a month for a monthly Synthetics downtime recurrence. `1` through `4` select the first through fourth occurrence of the weekday in the month, and `-1` selects the last occurrence.
75274+
enum:
75275+
- 1
75276+
- 2
75277+
- 3
75278+
- 4
75279+
- -1
75280+
example: 1
75281+
format: int64
75282+
type: integer
75283+
x-enum-varnames:
75284+
- FIRST
75285+
- SECOND
75286+
- THIRD
75287+
- FOURTH
75288+
- LAST
75289+
SyntheticsDowntimeWeekdayPositions:
75290+
description: >-
75291+
Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in combination with `weekdays` to schedule occurrences such as "the first Monday of the month".
75292+
example:
75293+
- 1
75294+
items:
75295+
$ref: "#/components/schemas/SyntheticsDowntimeWeekdayPosition"
75296+
type: array
7526775297
SyntheticsDowntimeWeekdays:
7526875298
description: Days of the week for a Synthetics downtime recurrence schedule.
7526975299
example:
@@ -143381,6 +143411,7 @@ paths:
143381143411
operator: AND
143382143412
permissions:
143383143413
- synthetics_write
143414+
- synthetics_default_settings_write
143384143415
/api/v2/synthetics/downtimes/{downtime_id}:
143385143416
delete:
143386143417
description: Delete a Synthetics downtime by its ID.
@@ -143423,6 +143454,7 @@ paths:
143423143454
operator: AND
143424143455
permissions:
143425143456
- synthetics_write
143457+
- synthetics_default_settings_write
143426143458
get:
143427143459
description: Get a Synthetics downtime by its ID.
143428143460
operationId: GetSyntheticsDowntime
@@ -143596,6 +143628,7 @@ paths:
143596143628
operator: AND
143597143629
permissions:
143598143630
- synthetics_write
143631+
- synthetics_default_settings_write
143599143632
/api/v2/synthetics/downtimes/{downtime_id}/tests/{test_id}:
143600143633
delete:
143601143634
description: Disassociate a Synthetics test from a downtime.

src/main/java/com/datadog/api/client/v2/model/SyntheticsDowntimeTimeSlotRecurrenceRequest.java

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
SyntheticsDowntimeTimeSlotRecurrenceRequest.JSON_PROPERTY_END,
2525
SyntheticsDowntimeTimeSlotRecurrenceRequest.JSON_PROPERTY_FREQUENCY,
2626
SyntheticsDowntimeTimeSlotRecurrenceRequest.JSON_PROPERTY_INTERVAL,
27+
SyntheticsDowntimeTimeSlotRecurrenceRequest.JSON_PROPERTY_WEEKDAY_POSITIONS,
2728
SyntheticsDowntimeTimeSlotRecurrenceRequest.JSON_PROPERTY_WEEKDAYS
2829
})
2930
@jakarta.annotation.Generated(
@@ -39,6 +40,9 @@ public class SyntheticsDowntimeTimeSlotRecurrenceRequest {
3940
public static final String JSON_PROPERTY_INTERVAL = "interval";
4041
private Long interval;
4142

43+
public static final String JSON_PROPERTY_WEEKDAY_POSITIONS = "weekdayPositions";
44+
private List<SyntheticsDowntimeWeekdayPosition> weekdayPositions = null;
45+
4246
public static final String JSON_PROPERTY_WEEKDAYS = "weekdays";
4347
private List<SyntheticsDowntimeWeekday> weekdays = null;
4448

@@ -120,6 +124,40 @@ public void setInterval(Long interval) {
120124
this.interval = interval;
121125
}
122126

127+
public SyntheticsDowntimeTimeSlotRecurrenceRequest weekdayPositions(
128+
List<SyntheticsDowntimeWeekdayPosition> weekdayPositions) {
129+
this.weekdayPositions = weekdayPositions;
130+
return this;
131+
}
132+
133+
public SyntheticsDowntimeTimeSlotRecurrenceRequest addWeekdayPositionsItem(
134+
SyntheticsDowntimeWeekdayPosition weekdayPositionsItem) {
135+
if (this.weekdayPositions == null) {
136+
this.weekdayPositions = new ArrayList<>();
137+
}
138+
this.weekdayPositions.add(weekdayPositionsItem);
139+
this.unparsed |= !weekdayPositionsItem.isValid();
140+
return this;
141+
}
142+
143+
/**
144+
* Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in
145+
* combination with <code>weekdays</code> to schedule occurrences such as "the first Monday of the
146+
* month".
147+
*
148+
* @return weekdayPositions
149+
*/
150+
@jakarta.annotation.Nullable
151+
@JsonProperty(JSON_PROPERTY_WEEKDAY_POSITIONS)
152+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
153+
public List<SyntheticsDowntimeWeekdayPosition> getWeekdayPositions() {
154+
return weekdayPositions;
155+
}
156+
157+
public void setWeekdayPositions(List<SyntheticsDowntimeWeekdayPosition> weekdayPositions) {
158+
this.weekdayPositions = weekdayPositions;
159+
}
160+
123161
public SyntheticsDowntimeTimeSlotRecurrenceRequest weekdays(
124162
List<SyntheticsDowntimeWeekday> weekdays) {
125163
this.weekdays = weekdays;
@@ -213,6 +251,8 @@ public boolean equals(Object o) {
213251
return Objects.equals(this.end, syntheticsDowntimeTimeSlotRecurrenceRequest.end)
214252
&& Objects.equals(this.frequency, syntheticsDowntimeTimeSlotRecurrenceRequest.frequency)
215253
&& Objects.equals(this.interval, syntheticsDowntimeTimeSlotRecurrenceRequest.interval)
254+
&& Objects.equals(
255+
this.weekdayPositions, syntheticsDowntimeTimeSlotRecurrenceRequest.weekdayPositions)
216256
&& Objects.equals(this.weekdays, syntheticsDowntimeTimeSlotRecurrenceRequest.weekdays)
217257
&& Objects.equals(
218258
this.additionalProperties,
@@ -221,7 +261,7 @@ public boolean equals(Object o) {
221261

222262
@Override
223263
public int hashCode() {
224-
return Objects.hash(end, frequency, interval, weekdays, additionalProperties);
264+
return Objects.hash(end, frequency, interval, weekdayPositions, weekdays, additionalProperties);
225265
}
226266

227267
@Override
@@ -231,6 +271,7 @@ public String toString() {
231271
sb.append(" end: ").append(toIndentedString(end)).append("\n");
232272
sb.append(" frequency: ").append(toIndentedString(frequency)).append("\n");
233273
sb.append(" interval: ").append(toIndentedString(interval)).append("\n");
274+
sb.append(" weekdayPositions: ").append(toIndentedString(weekdayPositions)).append("\n");
234275
sb.append(" weekdays: ").append(toIndentedString(weekdays)).append("\n");
235276
sb.append(" additionalProperties: ")
236277
.append(toIndentedString(additionalProperties))

src/main/java/com/datadog/api/client/v2/model/SyntheticsDowntimeTimeSlotRecurrenceResponse.java

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
SyntheticsDowntimeTimeSlotRecurrenceResponse.JSON_PROPERTY_FREQUENCY,
2525
SyntheticsDowntimeTimeSlotRecurrenceResponse.JSON_PROPERTY_INTERVAL,
2626
SyntheticsDowntimeTimeSlotRecurrenceResponse.JSON_PROPERTY_UNTIL,
27+
SyntheticsDowntimeTimeSlotRecurrenceResponse.JSON_PROPERTY_WEEKDAY_POSITIONS,
2728
SyntheticsDowntimeTimeSlotRecurrenceResponse.JSON_PROPERTY_WEEKDAYS
2829
})
2930
@jakarta.annotation.Generated(
@@ -39,6 +40,9 @@ public class SyntheticsDowntimeTimeSlotRecurrenceResponse {
3940
public static final String JSON_PROPERTY_UNTIL = "until";
4041
private SyntheticsDowntimeTimeSlotDate until;
4142

43+
public static final String JSON_PROPERTY_WEEKDAY_POSITIONS = "weekdayPositions";
44+
private List<SyntheticsDowntimeWeekdayPosition> weekdayPositions = null;
45+
4246
public static final String JSON_PROPERTY_WEEKDAYS = "weekdays";
4347
private List<SyntheticsDowntimeWeekday> weekdays = new ArrayList<>();
4448

@@ -124,6 +128,40 @@ public void setUntil(SyntheticsDowntimeTimeSlotDate until) {
124128
this.until = until;
125129
}
126130

131+
public SyntheticsDowntimeTimeSlotRecurrenceResponse weekdayPositions(
132+
List<SyntheticsDowntimeWeekdayPosition> weekdayPositions) {
133+
this.weekdayPositions = weekdayPositions;
134+
return this;
135+
}
136+
137+
public SyntheticsDowntimeTimeSlotRecurrenceResponse addWeekdayPositionsItem(
138+
SyntheticsDowntimeWeekdayPosition weekdayPositionsItem) {
139+
if (this.weekdayPositions == null) {
140+
this.weekdayPositions = new ArrayList<>();
141+
}
142+
this.weekdayPositions.add(weekdayPositionsItem);
143+
this.unparsed |= !weekdayPositionsItem.isValid();
144+
return this;
145+
}
146+
147+
/**
148+
* Positions of the weekdays within a month for a monthly Synthetics downtime recurrence. Used in
149+
* combination with <code>weekdays</code> to schedule occurrences such as "the first Monday of the
150+
* month".
151+
*
152+
* @return weekdayPositions
153+
*/
154+
@jakarta.annotation.Nullable
155+
@JsonProperty(JSON_PROPERTY_WEEKDAY_POSITIONS)
156+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
157+
public List<SyntheticsDowntimeWeekdayPosition> getWeekdayPositions() {
158+
return weekdayPositions;
159+
}
160+
161+
public void setWeekdayPositions(List<SyntheticsDowntimeWeekdayPosition> weekdayPositions) {
162+
this.weekdayPositions = weekdayPositions;
163+
}
164+
127165
public SyntheticsDowntimeTimeSlotRecurrenceResponse weekdays(
128166
List<SyntheticsDowntimeWeekday> weekdays) {
129167
this.weekdays = weekdays;
@@ -213,6 +251,8 @@ public boolean equals(Object o) {
213251
return Objects.equals(this.frequency, syntheticsDowntimeTimeSlotRecurrenceResponse.frequency)
214252
&& Objects.equals(this.interval, syntheticsDowntimeTimeSlotRecurrenceResponse.interval)
215253
&& Objects.equals(this.until, syntheticsDowntimeTimeSlotRecurrenceResponse.until)
254+
&& Objects.equals(
255+
this.weekdayPositions, syntheticsDowntimeTimeSlotRecurrenceResponse.weekdayPositions)
216256
&& Objects.equals(this.weekdays, syntheticsDowntimeTimeSlotRecurrenceResponse.weekdays)
217257
&& Objects.equals(
218258
this.additionalProperties,
@@ -221,7 +261,8 @@ public boolean equals(Object o) {
221261

222262
@Override
223263
public int hashCode() {
224-
return Objects.hash(frequency, interval, until, weekdays, additionalProperties);
264+
return Objects.hash(
265+
frequency, interval, until, weekdayPositions, weekdays, additionalProperties);
225266
}
226267

227268
@Override
@@ -231,6 +272,7 @@ public String toString() {
231272
sb.append(" frequency: ").append(toIndentedString(frequency)).append("\n");
232273
sb.append(" interval: ").append(toIndentedString(interval)).append("\n");
233274
sb.append(" until: ").append(toIndentedString(until)).append("\n");
275+
sb.append(" weekdayPositions: ").append(toIndentedString(weekdayPositions)).append("\n");
234276
sb.append(" weekdays: ").append(toIndentedString(weekdays)).append("\n");
235277
sb.append(" additionalProperties: ")
236278
.append(toIndentedString(additionalProperties))
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2019-Present Datadog, Inc.
5+
*/
6+
7+
package com.datadog.api.client.v2.model;
8+
9+
import com.datadog.api.client.ModelEnum;
10+
import com.fasterxml.jackson.annotation.JsonCreator;
11+
import com.fasterxml.jackson.core.JsonGenerator;
12+
import com.fasterxml.jackson.core.JsonProcessingException;
13+
import com.fasterxml.jackson.databind.SerializerProvider;
14+
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
15+
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
16+
import java.io.IOException;
17+
import java.util.Arrays;
18+
import java.util.HashSet;
19+
import java.util.Set;
20+
21+
/**
22+
* The position of a weekday within a month for a monthly Synthetics downtime recurrence. <code>1
23+
* </code> through <code>4</code> select the first through fourth occurrence of the weekday in the
24+
* month, and <code>-1</code> selects the last occurrence.
25+
*/
26+
@JsonSerialize(
27+
using = SyntheticsDowntimeWeekdayPosition.SyntheticsDowntimeWeekdayPositionSerializer.class)
28+
public class SyntheticsDowntimeWeekdayPosition extends ModelEnum<Long> {
29+
30+
private static final Set<Long> allowedValues =
31+
new HashSet<Long>(Arrays.asList(1l, 2l, 3l, 4l, -1l));
32+
33+
public static final SyntheticsDowntimeWeekdayPosition FIRST =
34+
new SyntheticsDowntimeWeekdayPosition(1l);
35+
public static final SyntheticsDowntimeWeekdayPosition SECOND =
36+
new SyntheticsDowntimeWeekdayPosition(2l);
37+
public static final SyntheticsDowntimeWeekdayPosition THIRD =
38+
new SyntheticsDowntimeWeekdayPosition(3l);
39+
public static final SyntheticsDowntimeWeekdayPosition FOURTH =
40+
new SyntheticsDowntimeWeekdayPosition(4l);
41+
public static final SyntheticsDowntimeWeekdayPosition LAST =
42+
new SyntheticsDowntimeWeekdayPosition(-1l);
43+
44+
SyntheticsDowntimeWeekdayPosition(Long value) {
45+
super(value, allowedValues);
46+
}
47+
48+
public static class SyntheticsDowntimeWeekdayPositionSerializer
49+
extends StdSerializer<SyntheticsDowntimeWeekdayPosition> {
50+
public SyntheticsDowntimeWeekdayPositionSerializer(Class<SyntheticsDowntimeWeekdayPosition> t) {
51+
super(t);
52+
}
53+
54+
public SyntheticsDowntimeWeekdayPositionSerializer() {
55+
this(null);
56+
}
57+
58+
@Override
59+
public void serialize(
60+
SyntheticsDowntimeWeekdayPosition value, JsonGenerator jgen, SerializerProvider provider)
61+
throws IOException, JsonProcessingException {
62+
jgen.writeObject(value.value);
63+
}
64+
}
65+
66+
@JsonCreator
67+
public static SyntheticsDowntimeWeekdayPosition fromValue(Long value) {
68+
return new SyntheticsDowntimeWeekdayPosition(value);
69+
}
70+
}

0 commit comments

Comments
 (0)