Skip to content

Commit 1781702

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 07378d9e of spec repo
1 parent 5f88599 commit 1781702

15 files changed

+185
-30
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-14 15:44:18.459381",
8-
"spec_repo_commit": "64f5e7ee"
7+
"regenerated": "2025-05-14 22:55:17.676702",
8+
"spec_repo_commit": "07378d9e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-14 15:44:18.474808",
13-
"spec_repo_commit": "64f5e7ee"
12+
"regenerated": "2025-05-14 22:55:17.692789",
13+
"spec_repo_commit": "07378d9e"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6742,6 +6742,8 @@ components:
67426742
nullable: true
67436743
readOnly: true
67446744
type: string
6745+
draft_status:
6746+
$ref: '#/components/schemas/MonitorDraftStatus'
67456747
id:
67466748
description: ID of this monitor.
67476749
format: int64
@@ -6834,6 +6836,22 @@ components:
68346836
- FIREFOX_LAPTOP_LARGE
68356837
- FIREFOX_TABLET
68366838
- FIREFOX_MOBILE_SMALL
6839+
MonitorDraftStatus:
6840+
default: published
6841+
description: 'Whether a monitor is in draft or published state. Draft monitors
6842+
do not notify recipients. Draft monitors are currently in
6843+
6844+
preview and the field is only processed for enabled customers. This accepts
6845+
the values `draft`
6846+
6847+
and `published`. Defaults to published.'
6848+
enum:
6849+
- draft
6850+
- published
6851+
type: string
6852+
x-enum-varnames:
6853+
- DRAFT
6854+
- PUBLISHED
68376855
MonitorFormulaAndFunctionCostAggregator:
68386856
description: Aggregation methods for metric queries.
68396857
enum:
@@ -7917,6 +7935,8 @@ components:
79177935
nullable: true
79187936
readOnly: true
79197937
type: string
7938+
draft_status:
7939+
$ref: '#/components/schemas/MonitorDraftStatus'
79207940
id:
79217941
description: ID of this monitor.
79227942
format: int64

examples/v1/monitors/CreateMonitor_1539578087.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v1.api.MonitorsApi;
66
import com.datadog.api.client.v1.model.Monitor;
7+
import com.datadog.api.client.v1.model.MonitorDraftStatus;
78
import com.datadog.api.client.v1.model.MonitorOptions;
89
import com.datadog.api.client.v1.model.MonitorOptionsCustomSchedule;
910
import com.datadog.api.client.v1.model.MonitorOptionsCustomScheduleRecurrence;
@@ -42,7 +43,8 @@ public static void main(String[] args) {
4243
.rrule("FREQ=DAILY;INTERVAL=1")
4344
.timezone("America/Los_Angeles")
4445
.start("2024-10-26T09:13:00"))))))
45-
.type(MonitorType.QUERY_ALERT);
46+
.type(MonitorType.QUERY_ALERT)
47+
.draftStatus(MonitorDraftStatus.PUBLISHED);
4648

4749
try {
4850
Monitor result = apiInstance.createMonitor(body);

examples/v1/monitors/CreateMonitor_440013737.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.datadog.api.client.ApiException;
55
import com.datadog.api.client.v1.api.MonitorsApi;
66
import com.datadog.api.client.v1.model.Monitor;
7+
import com.datadog.api.client.v1.model.MonitorDraftStatus;
78
import com.datadog.api.client.v1.model.MonitorOptions;
89
import com.datadog.api.client.v1.model.MonitorThresholds;
910
import com.datadog.api.client.v1.model.MonitorType;
@@ -25,7 +26,8 @@ public static void main(String[] args) {
2526
.message("some message")
2627
.tags(Arrays.asList("test:examplemonitor", "env:ci"))
2728
.priority(3L)
28-
.options(new MonitorOptions().thresholds(new MonitorThresholds().critical(1.0)));
29+
.options(new MonitorOptions().thresholds(new MonitorThresholds().critical(1.0)))
30+
.draftStatus(MonitorDraftStatus.DRAFT);
2931

3032
try {
3133
Monitor result = apiInstance.createMonitor(body);

src/main/java/com/datadog/api/client/v1/model/Monitor.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
Monitor.JSON_PROPERTY_CREATED,
2727
Monitor.JSON_PROPERTY_CREATOR,
2828
Monitor.JSON_PROPERTY_DELETED,
29+
Monitor.JSON_PROPERTY_DRAFT_STATUS,
2930
Monitor.JSON_PROPERTY_ID,
3031
Monitor.JSON_PROPERTY_MATCHING_DOWNTIMES,
3132
Monitor.JSON_PROPERTY_MESSAGE,
@@ -54,6 +55,9 @@ public class Monitor {
5455
public static final String JSON_PROPERTY_DELETED = "deleted";
5556
private JsonNullable<OffsetDateTime> deleted = JsonNullable.<OffsetDateTime>undefined();
5657

58+
public static final String JSON_PROPERTY_DRAFT_STATUS = "draft_status";
59+
private MonitorDraftStatus draftStatus = MonitorDraftStatus.PUBLISHED;
60+
5761
public static final String JSON_PROPERTY_ID = "id";
5862
private Long id;
5963

@@ -157,6 +161,33 @@ private void setDeleted_JsonNullable(JsonNullable<OffsetDateTime> deleted) {
157161
this.deleted = deleted;
158162
}
159163

164+
public Monitor draftStatus(MonitorDraftStatus draftStatus) {
165+
this.draftStatus = draftStatus;
166+
this.unparsed |= !draftStatus.isValid();
167+
return this;
168+
}
169+
170+
/**
171+
* Whether a monitor is in draft or published state. Draft monitors do not notify recipients.
172+
* Draft monitors are currently in preview and the field is only processed for enabled customers.
173+
* This accepts the values <code>draft</code> and <code>published</code>. Defaults to published.
174+
*
175+
* @return draftStatus
176+
*/
177+
@jakarta.annotation.Nullable
178+
@JsonProperty(JSON_PROPERTY_DRAFT_STATUS)
179+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
180+
public MonitorDraftStatus getDraftStatus() {
181+
return draftStatus;
182+
}
183+
184+
public void setDraftStatus(MonitorDraftStatus draftStatus) {
185+
if (!draftStatus.isValid()) {
186+
this.unparsed = true;
187+
}
188+
this.draftStatus = draftStatus;
189+
}
190+
160191
/**
161192
* ID of this monitor.
162193
*
@@ -528,6 +559,7 @@ public boolean equals(Object o) {
528559
return Objects.equals(this.created, monitor.created)
529560
&& Objects.equals(this.creator, monitor.creator)
530561
&& Objects.equals(this.deleted, monitor.deleted)
562+
&& Objects.equals(this.draftStatus, monitor.draftStatus)
531563
&& Objects.equals(this.id, monitor.id)
532564
&& Objects.equals(this.matchingDowntimes, monitor.matchingDowntimes)
533565
&& Objects.equals(this.message, monitor.message)
@@ -551,6 +583,7 @@ public int hashCode() {
551583
created,
552584
creator,
553585
deleted,
586+
draftStatus,
554587
id,
555588
matchingDowntimes,
556589
message,
@@ -575,6 +608,7 @@ public String toString() {
575608
sb.append(" created: ").append(toIndentedString(created)).append("\n");
576609
sb.append(" creator: ").append(toIndentedString(creator)).append("\n");
577610
sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n");
611+
sb.append(" draftStatus: ").append(toIndentedString(draftStatus)).append("\n");
578612
sb.append(" id: ").append(toIndentedString(id)).append("\n");
579613
sb.append(" matchingDowntimes: ").append(toIndentedString(matchingDowntimes)).append("\n");
580614
sb.append(" message: ").append(toIndentedString(message)).append("\n");
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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.v1.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+
* Whether a monitor is in draft or published state. Draft monitors do not notify recipients. Draft
23+
* monitors are currently in preview and the field is only processed for enabled customers. This
24+
* accepts the values <code>draft</code> and <code>published</code>. Defaults to published.
25+
*/
26+
@JsonSerialize(using = MonitorDraftStatus.MonitorDraftStatusSerializer.class)
27+
public class MonitorDraftStatus extends ModelEnum<String> {
28+
29+
private static final Set<String> allowedValues =
30+
new HashSet<String>(Arrays.asList("draft", "published"));
31+
32+
public static final MonitorDraftStatus DRAFT = new MonitorDraftStatus("draft");
33+
public static final MonitorDraftStatus PUBLISHED = new MonitorDraftStatus("published");
34+
35+
MonitorDraftStatus(String value) {
36+
super(value, allowedValues);
37+
}
38+
39+
public static class MonitorDraftStatusSerializer extends StdSerializer<MonitorDraftStatus> {
40+
public MonitorDraftStatusSerializer(Class<MonitorDraftStatus> t) {
41+
super(t);
42+
}
43+
44+
public MonitorDraftStatusSerializer() {
45+
this(null);
46+
}
47+
48+
@Override
49+
public void serialize(MonitorDraftStatus value, JsonGenerator jgen, SerializerProvider provider)
50+
throws IOException, JsonProcessingException {
51+
jgen.writeObject(value.value);
52+
}
53+
}
54+
55+
@JsonCreator
56+
public static MonitorDraftStatus fromValue(String value) {
57+
return new MonitorDraftStatus(value);
58+
}
59+
}

src/main/java/com/datadog/api/client/v1/model/MonitorUpdateRequest.java

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
MonitorUpdateRequest.JSON_PROPERTY_CREATED,
2626
MonitorUpdateRequest.JSON_PROPERTY_CREATOR,
2727
MonitorUpdateRequest.JSON_PROPERTY_DELETED,
28+
MonitorUpdateRequest.JSON_PROPERTY_DRAFT_STATUS,
2829
MonitorUpdateRequest.JSON_PROPERTY_ID,
2930
MonitorUpdateRequest.JSON_PROPERTY_MESSAGE,
3031
MonitorUpdateRequest.JSON_PROPERTY_MODIFIED,
@@ -52,6 +53,9 @@ public class MonitorUpdateRequest {
5253
public static final String JSON_PROPERTY_DELETED = "deleted";
5354
private JsonNullable<OffsetDateTime> deleted = JsonNullable.<OffsetDateTime>undefined();
5455

56+
public static final String JSON_PROPERTY_DRAFT_STATUS = "draft_status";
57+
private MonitorDraftStatus draftStatus = MonitorDraftStatus.PUBLISHED;
58+
5559
public static final String JSON_PROPERTY_ID = "id";
5660
private Long id;
5761

@@ -141,6 +145,33 @@ private void setDeleted_JsonNullable(JsonNullable<OffsetDateTime> deleted) {
141145
this.deleted = deleted;
142146
}
143147

148+
public MonitorUpdateRequest draftStatus(MonitorDraftStatus draftStatus) {
149+
this.draftStatus = draftStatus;
150+
this.unparsed |= !draftStatus.isValid();
151+
return this;
152+
}
153+
154+
/**
155+
* Whether a monitor is in draft or published state. Draft monitors do not notify recipients.
156+
* Draft monitors are currently in preview and the field is only processed for enabled customers.
157+
* This accepts the values <code>draft</code> and <code>published</code>. Defaults to published.
158+
*
159+
* @return draftStatus
160+
*/
161+
@jakarta.annotation.Nullable
162+
@JsonProperty(JSON_PROPERTY_DRAFT_STATUS)
163+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
164+
public MonitorDraftStatus getDraftStatus() {
165+
return draftStatus;
166+
}
167+
168+
public void setDraftStatus(MonitorDraftStatus draftStatus) {
169+
if (!draftStatus.isValid()) {
170+
this.unparsed = true;
171+
}
172+
this.draftStatus = draftStatus;
173+
}
174+
144175
/**
145176
* ID of this monitor.
146177
*
@@ -481,6 +512,7 @@ public boolean equals(Object o) {
481512
return Objects.equals(this.created, monitorUpdateRequest.created)
482513
&& Objects.equals(this.creator, monitorUpdateRequest.creator)
483514
&& Objects.equals(this.deleted, monitorUpdateRequest.deleted)
515+
&& Objects.equals(this.draftStatus, monitorUpdateRequest.draftStatus)
484516
&& Objects.equals(this.id, monitorUpdateRequest.id)
485517
&& Objects.equals(this.message, monitorUpdateRequest.message)
486518
&& Objects.equals(this.modified, monitorUpdateRequest.modified)
@@ -503,6 +535,7 @@ public int hashCode() {
503535
created,
504536
creator,
505537
deleted,
538+
draftStatus,
506539
id,
507540
message,
508541
modified,
@@ -526,6 +559,7 @@ public String toString() {
526559
sb.append(" created: ").append(toIndentedString(created)).append("\n");
527560
sb.append(" creator: ").append(toIndentedString(creator)).append("\n");
528561
sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n");
562+
sb.append(" draftStatus: ").append(toIndentedString(draftStatus)).append("\n");
529563
sb.append(" id: ").append(toIndentedString(id)).append("\n");
530564
sb.append(" message: ").append(toIndentedString(message)).append("\n");
531565
sb.append(" modified: ").append(toIndentedString(modified)).append("\n");
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-02-02T21:04:10.597Z
1+
2025-05-14T22:27:13.829Z

src/test/resources/cassettes/features/v1/Create_a_RUM_formula_and_functions_monitor_returns_OK_response.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"httpRequest": {
44
"body": {
55
"type": "JSON",
6-
"json": "{\"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_RUM_formula_and_functions_monitor_returns_OK_response-1643835850\", \"options\": {\"thresholds\": {\"critical\": 0.8}, \"variables\": [{\"compute\": {\"aggregation\": \"count\"}, \"data_source\": \"rum\", \"group_by\": [], \"indexes\": [\"*\"], \"name\": \"query2\", \"search\": {\"query\": \"\"}}, {\"compute\": {\"aggregation\": \"count\"}, \"data_source\": \"rum\", \"group_by\": [], \"indexes\": [\"*\"], \"name\": \"query1\", \"search\": {\"query\": \"status:error\"}}]}, \"priority\": 3, \"query\": \"formula(\\\"query2 / query1 * 100\\\").last(\\\"15m\\\") >= 0.8\", \"tags\": [\"test:testcreatearumformulaandfunctionsmonitorreturnsokresponse1643835850\", \"env:ci\"], \"type\": \"rum alert\"}"
6+
"json": "{\"message\": \"some message Notify: @hipchat-channel\", \"name\": \"Test-Create_a_RUM_formula_and_functions_monitor_returns_OK_response-1747261633\", \"options\": {\"thresholds\": {\"critical\": 0.8}, \"variables\": [{\"compute\": {\"aggregation\": \"count\"}, \"data_source\": \"rum\", \"group_by\": [], \"indexes\": [\"*\"], \"name\": \"query2\", \"search\": {\"query\": \"\"}}, {\"compute\": {\"aggregation\": \"count\"}, \"data_source\": \"rum\", \"group_by\": [], \"indexes\": [\"*\"], \"name\": \"query1\", \"search\": {\"query\": \"status:error\"}}]}, \"priority\": 3, \"query\": \"formula(\\\"query2 / query1 * 100\\\").last(\\\"15m\\\") >= 0.8\", \"tags\": [\"test:testcreatearumformulaandfunctionsmonitorreturnsokresponse1747261633\", \"env:ci\"], \"type\": \"rum alert\"}"
77
},
88
"headers": {},
99
"method": "POST",
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"restricted_roles\":null,\"tags\":[\"test:testcreatearumformulaandfunctionsmonitorreturnsokresponse1643835850\",\"env:ci\"],\"deleted\":null,\"query\":\"formula(\\\"query2 / query1 * 100\\\").last(\\\"15m\\\") >= 0.8\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":62683819,\"multi\":false,\"name\":\"Test-Create_a_RUM_formula_and_functions_monitor_returns_OK_response-1643835850\",\"created\":\"2022-02-02T21:04:10.947341+00:00\",\"created_at\":1643835850000,\"creator\":{\"id\":1445416,\"handle\":\"[email protected]\",\"name\":null,\"email\":\"[email protected]\"},\"org_id\":321813,\"modified\":\"2022-02-02T21:04:10.947341+00:00\",\"priority\":3,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"rum alert\",\"options\":{\"notify_audit\":false,\"locked\":false,\"silenced\":{},\"include_tags\":true,\"thresholds\":{\"critical\":0.8},\"new_host_delay\":300,\"notify_no_data\":false,\"groupby_simple_monitor\":false,\"variables\":[{\"search\":{\"query\":\"\"},\"data_source\":\"rum\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query2\",\"indexes\":[\"*\"],\"group_by\":[]},{\"search\":{\"query\":\"status:error\"},\"data_source\":\"rum\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"indexes\":[\"*\"],\"group_by\":[]}]}}",
15+
"body": "{\"id\":172140181,\"org_id\":2,\"type\":\"rum alert\",\"name\":\"Test-Create_a_RUM_formula_and_functions_monitor_returns_OK_response-1747261633\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[\"test:testcreatearumformulaandfunctionsmonitorreturnsokresponse1747261633\",\"env:ci\"],\"query\":\"formula(\\\"query2 / query1 * 100\\\").last(\\\"15m\\\") >= 0.8\",\"options\":{\"thresholds\":{\"critical\":0.8},\"variables\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query2\",\"search\":{\"query\":\"\"}},{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"rum\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"status:error\"}}],\"notify_no_data\":false,\"notify_audit\":false,\"new_host_delay\":300,\"include_tags\":true,\"groupby_simple_monitor\":false,\"silenced\":{},\"avalanche_window\":20},\"multi\":false,\"created_at\":1747261634000,\"created\":\"2025-05-14T22:27:14.329045+00:00\",\"modified\":\"2025-05-14T22:27:14.329045+00:00\",\"deleted\":null,\"priority\":3,\"draft_status\":\"published\",\"restricted_roles\":null,\"restriction_policy\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":\"Carl Martensen\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":638339},\"run_as\":null,\"restricted\":true}\n",
1616
"headers": {
1717
"Content-Type": [
1818
"application/json"
@@ -27,18 +27,18 @@
2727
"timeToLive": {
2828
"unlimited": true
2929
},
30-
"id": "7a58052f-14ee-83a6-2dfc-2809be4dc559"
30+
"id": "eef12d43-f020-a800-f373-e9557add2e5e"
3131
},
3232
{
3333
"httpRequest": {
3434
"headers": {},
3535
"method": "DELETE",
36-
"path": "/api/v1/monitor/62683819",
36+
"path": "/api/v1/monitor/172140181",
3737
"keepAlive": false,
3838
"secure": true
3939
},
4040
"httpResponse": {
41-
"body": "{\"deleted_monitor_id\":62683819}",
41+
"body": "{\"deleted_monitor_id\":172140181}\n",
4242
"headers": {
4343
"Content-Type": [
4444
"application/json"
@@ -53,6 +53,6 @@
5353
"timeToLive": {
5454
"unlimited": true
5555
},
56-
"id": "2c04155e-cb9e-82a5-da2f-b42d5676fc54"
56+
"id": "f63b2a6e-7ed4-4642-d421-e39aa05e50b5"
5757
}
5858
]
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2023-11-09T17:58:50.774Z
1+
2025-05-14T22:28:29.992Z

0 commit comments

Comments
 (0)