Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-05-04 18:52:23.772285",
"spec_repo_commit": "4706b973"
"regenerated": "2023-05-04 19:21:12.663548",
"spec_repo_commit": "c0cc4b41"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-05-04 18:52:23.785037",
"spec_repo_commit": "4706b973"
"regenerated": "2023-05-04 19:21:12.675857",
"spec_repo_commit": "c0cc4b41"
}
}
}
62 changes: 62 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1744,6 +1744,10 @@ components:
be muted.
example: false
type: boolean
notify_end_states:
$ref: '#/components/schemas/NotifyEndStates'
notify_end_types:
$ref: '#/components/schemas/NotifyEndTypes'
parent_id:
description: ID of the parent Downtime.
example: 123
Expand Down Expand Up @@ -1880,6 +1884,10 @@ components:
be muted.
example: false
type: boolean
notify_end_states:
$ref: '#/components/schemas/NotifyEndStates'
notify_end_types:
$ref: '#/components/schemas/NotifyEndTypes'
parent_id:
description: ID of the parent Downtime.
example: 123
Expand Down Expand Up @@ -8399,6 +8407,60 @@ components:
format: int64
type: integer
type: object
NotifyEndState:
description: A notification end state.
enum:
- alert
- no data
- warn
example: alert
type: string
x-enum-varnames:
- ALERT
- NO_DATA
- WARN
NotifyEndStates:
default:
- alert
- no data
- warn
description: States for which `notify_end_types` sends out notifications for.
example:
- alert
- no data
- warn
items:
$ref: '#/components/schemas/NotifyEndState'
type: array
NotifyEndType:
description: A notification end type.
enum:
- canceled
- expired
example: expired
type: string
x-enum-varnames:
- CANCELED
- EXPIRED
NotifyEndTypes:
default:
- expired
description: 'If set, notifies if a monitor is in an alert-worthy state (`ALERT`,
`WARNING`, or `NO DATA`)

when this downtime expires or is canceled. Applied to monitors that change
states during

the downtime (such as from `OK` to `ALERT`, `WARNING`, or `NO DATA`), and
to monitors that

already have an alert-worthy state when downtime begins.'
example:
- canceled
- expired
items:
$ref: '#/components/schemas/NotifyEndType'
type: array
OnMissingDataOption:
description: 'Controls how groups or monitors are treated if an evaluation does
not return any data points.
Expand Down
6 changes: 5 additions & 1 deletion examples/v1/downtimes/CreateDowntime_2908359488.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.datadog.api.client.v1.api.DowntimesApi;
import com.datadog.api.client.v1.model.Downtime;
import com.datadog.api.client.v1.model.DowntimeRecurrence;
import com.datadog.api.client.v1.model.NotifyEndState;
import com.datadog.api.client.v1.model.NotifyEndType;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collections;
Expand All @@ -27,7 +29,9 @@ public static void main(String[] args) {
.end(OffsetDateTime.now().plusHours(1).toInstant().getEpochSecond())
.timezone("Etc/UTC")
.muteFirstRecoveryNotification(true)
.monitorTags(Collections.singletonList("tag0"));
.monitorTags(Collections.singletonList("tag0"))
.notifyEndStates(Collections.singletonList(NotifyEndState.ALERT))
.notifyEndTypes(Collections.singletonList(NotifyEndType.CANCELED));

try {
Downtime result = apiInstance.createDowntime(body);
Expand Down
7 changes: 6 additions & 1 deletion examples/v1/downtimes/CreateDowntime_3059354445.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import com.datadog.api.client.v1.api.DowntimesApi;
import com.datadog.api.client.v1.model.Downtime;
import com.datadog.api.client.v1.model.DowntimeRecurrence;
import com.datadog.api.client.v1.model.NotifyEndState;
import com.datadog.api.client.v1.model.NotifyEndType;
import java.time.OffsetDateTime;
import java.util.Arrays;
import java.util.Collections;

public class Example {
Expand All @@ -21,7 +24,9 @@ public static void main(String[] args) {
.end(OffsetDateTime.now().plusHours(1).toInstant().getEpochSecond())
.timezone("Etc/UTC")
.muteFirstRecoveryNotification(true)
.monitorTags(Collections.singletonList("tag0"));
.monitorTags(Collections.singletonList("tag0"))
.notifyEndStates(Arrays.asList(NotifyEndState.ALERT, NotifyEndState.WARN))
.notifyEndTypes(Collections.singletonList(NotifyEndType.EXPIRED));

try {
Downtime result = apiInstance.createDowntime(body);
Expand Down
78 changes: 78 additions & 0 deletions src/main/java/com/datadog/api/client/v1/model/Downtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
Downtime.JSON_PROPERTY_MONITOR_ID,
Downtime.JSON_PROPERTY_MONITOR_TAGS,
Downtime.JSON_PROPERTY_MUTE_FIRST_RECOVERY_NOTIFICATION,
Downtime.JSON_PROPERTY_NOTIFY_END_STATES,
Downtime.JSON_PROPERTY_NOTIFY_END_TYPES,
Downtime.JSON_PROPERTY_PARENT_ID,
Downtime.JSON_PROPERTY_RECURRENCE,
Downtime.JSON_PROPERTY_SCOPE,
Expand Down Expand Up @@ -81,6 +83,12 @@ public class Downtime {
"mute_first_recovery_notification";
private Boolean muteFirstRecoveryNotification;

public static final String JSON_PROPERTY_NOTIFY_END_STATES = "notify_end_states";
private List<NotifyEndState> notifyEndStates = null;

public static final String JSON_PROPERTY_NOTIFY_END_TYPES = "notify_end_types";
private List<NotifyEndType> notifyEndTypes = null;

public static final String JSON_PROPERTY_PARENT_ID = "parent_id";
private JsonNullable<Long> parentId = JsonNullable.<Long>undefined();

Expand Down Expand Up @@ -374,6 +382,70 @@ public void setMuteFirstRecoveryNotification(Boolean muteFirstRecoveryNotificati
this.muteFirstRecoveryNotification = muteFirstRecoveryNotification;
}

public Downtime notifyEndStates(List<NotifyEndState> notifyEndStates) {
this.notifyEndStates = notifyEndStates;
return this;
}

public Downtime addNotifyEndStatesItem(NotifyEndState notifyEndStatesItem) {
if (this.notifyEndStates == null) {
this.notifyEndStates = new ArrayList<>();
}
this.notifyEndStates.add(notifyEndStatesItem);
this.unparsed |= !notifyEndStatesItem.isValid();
return this;
}

/**
* States for which <code>notify_end_types</code> sends out notifications for.
*
* @return notifyEndStates
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NOTIFY_END_STATES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<NotifyEndState> getNotifyEndStates() {
return notifyEndStates;
}

public void setNotifyEndStates(List<NotifyEndState> notifyEndStates) {
this.notifyEndStates = notifyEndStates;
}

public Downtime notifyEndTypes(List<NotifyEndType> notifyEndTypes) {
this.notifyEndTypes = notifyEndTypes;
return this;
}

public Downtime addNotifyEndTypesItem(NotifyEndType notifyEndTypesItem) {
if (this.notifyEndTypes == null) {
this.notifyEndTypes = new ArrayList<>();
}
this.notifyEndTypes.add(notifyEndTypesItem);
this.unparsed |= !notifyEndTypesItem.isValid();
return this;
}

/**
* If set, notifies if a monitor is in an alert-worthy state (<code>ALERT</code>, <code>WARNING
* </code>, or <code>NO DATA</code>) when this downtime expires or is canceled. Applied to
* monitors that change states during the downtime (such as from <code>OK</code> to <code>ALERT
* </code>, <code>WARNING</code>, or <code>NO DATA</code>), and to monitors that already have an
* alert-worthy state when downtime begins.
*
* @return notifyEndTypes
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NOTIFY_END_TYPES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<NotifyEndType> getNotifyEndTypes() {
return notifyEndTypes;
}

public void setNotifyEndTypes(List<NotifyEndType> notifyEndTypes) {
this.notifyEndTypes = notifyEndTypes;
}

public Downtime parentId(Long parentId) {
this.parentId = JsonNullable.<Long>of(parentId);
return this;
Expand Down Expand Up @@ -560,6 +632,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.monitorTags, downtime.monitorTags)
&& Objects.equals(
this.muteFirstRecoveryNotification, downtime.muteFirstRecoveryNotification)
&& Objects.equals(this.notifyEndStates, downtime.notifyEndStates)
&& Objects.equals(this.notifyEndTypes, downtime.notifyEndTypes)
&& Objects.equals(this.parentId, downtime.parentId)
&& Objects.equals(this.recurrence, downtime.recurrence)
&& Objects.equals(this.scope, downtime.scope)
Expand All @@ -583,6 +657,8 @@ public int hashCode() {
monitorId,
monitorTags,
muteFirstRecoveryNotification,
notifyEndStates,
notifyEndTypes,
parentId,
recurrence,
scope,
Expand All @@ -609,6 +685,8 @@ public String toString() {
sb.append(" muteFirstRecoveryNotification: ")
.append(toIndentedString(muteFirstRecoveryNotification))
.append("\n");
sb.append(" notifyEndStates: ").append(toIndentedString(notifyEndStates)).append("\n");
sb.append(" notifyEndTypes: ").append(toIndentedString(notifyEndTypes)).append("\n");
sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n");
sb.append(" recurrence: ").append(toIndentedString(recurrence)).append("\n");
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
DowntimeChild.JSON_PROPERTY_MONITOR_ID,
DowntimeChild.JSON_PROPERTY_MONITOR_TAGS,
DowntimeChild.JSON_PROPERTY_MUTE_FIRST_RECOVERY_NOTIFICATION,
DowntimeChild.JSON_PROPERTY_NOTIFY_END_STATES,
DowntimeChild.JSON_PROPERTY_NOTIFY_END_TYPES,
DowntimeChild.JSON_PROPERTY_PARENT_ID,
DowntimeChild.JSON_PROPERTY_RECURRENCE,
DowntimeChild.JSON_PROPERTY_SCOPE,
Expand Down Expand Up @@ -76,6 +78,12 @@ public class DowntimeChild {
"mute_first_recovery_notification";
private Boolean muteFirstRecoveryNotification;

public static final String JSON_PROPERTY_NOTIFY_END_STATES = "notify_end_states";
private List<NotifyEndState> notifyEndStates = null;

public static final String JSON_PROPERTY_NOTIFY_END_TYPES = "notify_end_types";
private List<NotifyEndType> notifyEndTypes = null;

public static final String JSON_PROPERTY_PARENT_ID = "parent_id";
private JsonNullable<Long> parentId = JsonNullable.<Long>undefined();

Expand Down Expand Up @@ -342,6 +350,70 @@ public void setMuteFirstRecoveryNotification(Boolean muteFirstRecoveryNotificati
this.muteFirstRecoveryNotification = muteFirstRecoveryNotification;
}

public DowntimeChild notifyEndStates(List<NotifyEndState> notifyEndStates) {
this.notifyEndStates = notifyEndStates;
return this;
}

public DowntimeChild addNotifyEndStatesItem(NotifyEndState notifyEndStatesItem) {
if (this.notifyEndStates == null) {
this.notifyEndStates = new ArrayList<>();
}
this.notifyEndStates.add(notifyEndStatesItem);
this.unparsed |= !notifyEndStatesItem.isValid();
return this;
}

/**
* States for which <code>notify_end_types</code> sends out notifications for.
*
* @return notifyEndStates
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NOTIFY_END_STATES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<NotifyEndState> getNotifyEndStates() {
return notifyEndStates;
}

public void setNotifyEndStates(List<NotifyEndState> notifyEndStates) {
this.notifyEndStates = notifyEndStates;
}

public DowntimeChild notifyEndTypes(List<NotifyEndType> notifyEndTypes) {
this.notifyEndTypes = notifyEndTypes;
return this;
}

public DowntimeChild addNotifyEndTypesItem(NotifyEndType notifyEndTypesItem) {
if (this.notifyEndTypes == null) {
this.notifyEndTypes = new ArrayList<>();
}
this.notifyEndTypes.add(notifyEndTypesItem);
this.unparsed |= !notifyEndTypesItem.isValid();
return this;
}

/**
* If set, notifies if a monitor is in an alert-worthy state (<code>ALERT</code>, <code>WARNING
* </code>, or <code>NO DATA</code>) when this downtime expires or is canceled. Applied to
* monitors that change states during the downtime (such as from <code>OK</code> to <code>ALERT
* </code>, <code>WARNING</code>, or <code>NO DATA</code>), and to monitors that already have an
* alert-worthy state when downtime begins.
*
* @return notifyEndTypes
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_NOTIFY_END_TYPES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public List<NotifyEndType> getNotifyEndTypes() {
return notifyEndTypes;
}

public void setNotifyEndTypes(List<NotifyEndType> notifyEndTypes) {
this.notifyEndTypes = notifyEndTypes;
}

public DowntimeChild parentId(Long parentId) {
this.parentId = JsonNullable.<Long>of(parentId);
return this;
Expand Down Expand Up @@ -527,6 +599,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.monitorTags, downtimeChild.monitorTags)
&& Objects.equals(
this.muteFirstRecoveryNotification, downtimeChild.muteFirstRecoveryNotification)
&& Objects.equals(this.notifyEndStates, downtimeChild.notifyEndStates)
&& Objects.equals(this.notifyEndTypes, downtimeChild.notifyEndTypes)
&& Objects.equals(this.parentId, downtimeChild.parentId)
&& Objects.equals(this.recurrence, downtimeChild.recurrence)
&& Objects.equals(this.scope, downtimeChild.scope)
Expand All @@ -549,6 +623,8 @@ public int hashCode() {
monitorId,
monitorTags,
muteFirstRecoveryNotification,
notifyEndStates,
notifyEndTypes,
parentId,
recurrence,
scope,
Expand All @@ -574,6 +650,8 @@ public String toString() {
sb.append(" muteFirstRecoveryNotification: ")
.append(toIndentedString(muteFirstRecoveryNotification))
.append("\n");
sb.append(" notifyEndStates: ").append(toIndentedString(notifyEndStates)).append("\n");
sb.append(" notifyEndTypes: ").append(toIndentedString(notifyEndTypes)).append("\n");
sb.append(" parentId: ").append(toIndentedString(parentId)).append("\n");
sb.append(" recurrence: ").append(toIndentedString(recurrence)).append("\n");
sb.append(" scope: ").append(toIndentedString(scope)).append("\n");
Expand Down
Loading