Skip to content

Commit 36655b8

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 199c222 of spec repo
1 parent 74f82c0 commit 36655b8

35 files changed

+6596
-26
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 702 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Create an event email address returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressAlertType;
7+
import com.datadog.api.client.v2.model.EventEmailAddressCreateAttributes;
8+
import com.datadog.api.client.v2.model.EventEmailAddressCreateData;
9+
import com.datadog.api.client.v2.model.EventEmailAddressCreateRequest;
10+
import com.datadog.api.client.v2.model.EventEmailAddressFormat;
11+
import com.datadog.api.client.v2.model.EventEmailAddressResourceType;
12+
import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse;
13+
import java.util.Arrays;
14+
import java.util.Collections;
15+
16+
public class Example {
17+
public static void main(String[] args) {
18+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
19+
defaultClient.setUnstableOperationEnabled("v2.createEventEmailAddress", true);
20+
EventsApi apiInstance = new EventsApi(defaultClient);
21+
22+
EventEmailAddressCreateRequest body =
23+
new EventEmailAddressCreateRequest()
24+
.data(
25+
new EventEmailAddressCreateData()
26+
.attributes(
27+
new EventEmailAddressCreateAttributes()
28+
.alertType(EventEmailAddressAlertType.INFO)
29+
.description("Email address for production alerts.")
30+
.format(EventEmailAddressFormat.JSON)
31+
.notifyHandles(Collections.singletonList("@slack-my-channel"))
32+
.tags(Arrays.asList("env:production", "team:my-team")))
33+
.type(EventEmailAddressResourceType.EVENT_EMAILS));
34+
35+
try {
36+
EventEmailAddressSingleResponse result = apiInstance.createEventEmailAddress(body);
37+
System.out.println(result);
38+
} catch (ApiException e) {
39+
System.err.println("Exception when calling EventsApi#createEventEmailAddress");
40+
System.err.println("Status code: " + e.getCode());
41+
System.err.println("Reason: " + e.getResponseBody());
42+
System.err.println("Response headers: " + e.getResponseHeaders());
43+
e.printStackTrace();
44+
}
45+
}
46+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Create an on-call event email address returns "Created" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressAlertType;
7+
import com.datadog.api.client.v2.model.EventEmailAddressFormat;
8+
import com.datadog.api.client.v2.model.EventEmailAddressResourceType;
9+
import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse;
10+
import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateAttributes;
11+
import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateData;
12+
import com.datadog.api.client.v2.model.OnCallEventEmailAddressCreateRequest;
13+
import java.util.Arrays;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
defaultClient.setUnstableOperationEnabled("v2.createOnCallEventEmailAddress", true);
19+
EventsApi apiInstance = new EventsApi(defaultClient);
20+
21+
OnCallEventEmailAddressCreateRequest body =
22+
new OnCallEventEmailAddressCreateRequest()
23+
.data(
24+
new OnCallEventEmailAddressCreateData()
25+
.attributes(
26+
new OnCallEventEmailAddressCreateAttributes()
27+
.alertType(EventEmailAddressAlertType.INFO)
28+
.description("On-call email address for my team.")
29+
.format(EventEmailAddressFormat.JSON)
30+
.tags(Arrays.asList("env:production", "team:my-team"))
31+
.teamHandle("my-team"))
32+
.type(EventEmailAddressResourceType.EVENT_EMAILS));
33+
34+
try {
35+
EventEmailAddressSingleResponse result = apiInstance.createOnCallEventEmailAddress(body);
36+
System.out.println(result);
37+
} catch (ApiException e) {
38+
System.err.println("Exception when calling EventsApi#createOnCallEventEmailAddress");
39+
System.err.println("Status code: " + e.getCode());
40+
System.err.println("Reason: " + e.getResponseBody());
41+
System.err.println("Response headers: " + e.getResponseHeaders());
42+
e.printStackTrace();
43+
}
44+
}
45+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Revoke an event email address returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import java.util.UUID;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.deleteEventEmailAddress", true);
12+
EventsApi apiInstance = new EventsApi(defaultClient);
13+
14+
try {
15+
apiInstance.deleteEventEmailAddress(UUID.fromString("00000000-0000-0000-0000-000000000001"));
16+
} catch (ApiException e) {
17+
System.err.println("Exception when calling EventsApi#deleteEventEmailAddress");
18+
System.err.println("Status code: " + e.getCode());
19+
System.err.println("Reason: " + e.getResponseBody());
20+
System.err.println("Response headers: " + e.getResponseHeaders());
21+
e.printStackTrace();
22+
}
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Revoke an on-call event email address returns "No Content" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import java.util.UUID;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.deleteOnCallEventEmailAddress", true);
12+
EventsApi apiInstance = new EventsApi(defaultClient);
13+
14+
try {
15+
apiInstance.deleteOnCallEventEmailAddress(
16+
UUID.fromString("00000000-0000-0000-0000-000000000001"));
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling EventsApi#deleteOnCallEventEmailAddress");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Get an event email address returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse;
7+
import java.util.UUID;
8+
9+
public class Example {
10+
public static void main(String[] args) {
11+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
12+
defaultClient.setUnstableOperationEnabled("v2.getEventEmailAddress", true);
13+
EventsApi apiInstance = new EventsApi(defaultClient);
14+
15+
try {
16+
EventEmailAddressSingleResponse result =
17+
apiInstance.getEventEmailAddress(UUID.fromString("00000000-0000-0000-0000-000000000001"));
18+
System.out.println(result);
19+
} catch (ApiException e) {
20+
System.err.println("Exception when calling EventsApi#getEventEmailAddress");
21+
System.err.println("Status code: " + e.getCode());
22+
System.err.println("Reason: " + e.getResponseBody());
23+
System.err.println("Response headers: " + e.getResponseHeaders());
24+
e.printStackTrace();
25+
}
26+
}
27+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// List event email addresses returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.listEventEmailAddresses", true);
12+
EventsApi apiInstance = new EventsApi(defaultClient);
13+
14+
try {
15+
EventEmailAddressesResponse result = apiInstance.listEventEmailAddresses();
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling EventsApi#listEventEmailAddresses");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// List on-call event email addresses returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressesResponse;
7+
8+
public class Example {
9+
public static void main(String[] args) {
10+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
11+
defaultClient.setUnstableOperationEnabled("v2.listOnCallEventEmailAddresses", true);
12+
EventsApi apiInstance = new EventsApi(defaultClient);
13+
14+
try {
15+
EventEmailAddressesResponse result = apiInstance.listOnCallEventEmailAddresses("my-team");
16+
System.out.println(result);
17+
} catch (ApiException e) {
18+
System.err.println("Exception when calling EventsApi#listOnCallEventEmailAddresses");
19+
System.err.println("Status code: " + e.getCode());
20+
System.err.println("Reason: " + e.getResponseBody());
21+
System.err.println("Response headers: " + e.getResponseHeaders());
22+
e.printStackTrace();
23+
}
24+
}
25+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Update an event email address returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.EventsApi;
6+
import com.datadog.api.client.v2.model.EventEmailAddressAlertType;
7+
import com.datadog.api.client.v2.model.EventEmailAddressResourceType;
8+
import com.datadog.api.client.v2.model.EventEmailAddressSingleResponse;
9+
import com.datadog.api.client.v2.model.EventEmailAddressUpdateAttributes;
10+
import com.datadog.api.client.v2.model.EventEmailAddressUpdateData;
11+
import com.datadog.api.client.v2.model.EventEmailAddressUpdateRequest;
12+
import java.util.Arrays;
13+
import java.util.Collections;
14+
import java.util.UUID;
15+
16+
public class Example {
17+
public static void main(String[] args) {
18+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
19+
defaultClient.setUnstableOperationEnabled("v2.updateEventEmailAddress", true);
20+
EventsApi apiInstance = new EventsApi(defaultClient);
21+
22+
EventEmailAddressUpdateRequest body =
23+
new EventEmailAddressUpdateRequest()
24+
.data(
25+
new EventEmailAddressUpdateData()
26+
.attributes(
27+
new EventEmailAddressUpdateAttributes()
28+
.alertType(EventEmailAddressAlertType.INFO)
29+
.description("Updated description for the email address.")
30+
.notifyHandles(Collections.singletonList("@slack-my-channel"))
31+
.tags(Arrays.asList("env:production", "team:my-team")))
32+
.type(EventEmailAddressResourceType.EVENT_EMAILS));
33+
34+
try {
35+
EventEmailAddressSingleResponse result =
36+
apiInstance.updateEventEmailAddress(
37+
UUID.fromString("00000000-0000-0000-0000-000000000001"), body);
38+
System.out.println(result);
39+
} catch (ApiException e) {
40+
System.err.println("Exception when calling EventsApi#updateEventEmailAddress");
41+
System.err.println("Status code: " + e.getCode());
42+
System.err.println("Reason: " + e.getResponseBody());
43+
System.err.println("Response headers: " + e.getResponseHeaders());
44+
e.printStackTrace();
45+
}
46+
}
47+
}

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,14 @@ public class ApiClient {
833833
put("v2.getDeploymentRule", false);
834834
put("v2.updateDeploymentGate", false);
835835
put("v2.updateDeploymentRule", false);
836+
put("v2.createEventEmailAddress", false);
837+
put("v2.createOnCallEventEmailAddress", false);
838+
put("v2.deleteEventEmailAddress", false);
839+
put("v2.deleteOnCallEventEmailAddress", false);
840+
put("v2.getEventEmailAddress", false);
841+
put("v2.listEventEmailAddresses", false);
842+
put("v2.listOnCallEventEmailAddresses", false);
843+
put("v2.updateEventEmailAddress", false);
836844
put("v2.createHamrOrgConnection", false);
837845
put("v2.getHamrOrgConnection", false);
838846
put("v2.createGlobalIncidentHandle", false);

0 commit comments

Comments
 (0)