diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 4bc99f94bc1..045a30b94d7 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -1088,6 +1088,13 @@ components:
required: true
schema:
type: string
+ OpsgenieAccountIDPathParameter:
+ description: The UUID of the Opsgenie account.
+ in: path
+ name: account_id
+ required: true
+ schema:
+ type: string
OpsgenieServiceIDPathParameter:
description: The UUID of the service.
in: path
@@ -61684,6 +61691,129 @@ components:
format: binary
type: string
type: object
+ OpsgenieAccountCreateAttributes:
+ description: The Opsgenie account attributes for a create request.
+ properties:
+ api_key:
+ description: The Opsgenie API key for your Opsgenie account.
+ example: "00000000-0000-0000-0000-000000000000"
+ minLength: 1
+ type: string
+ region:
+ $ref: "#/components/schemas/OpsgenieServiceRegionType"
+ required:
+ - api_key
+ - region
+ type: object
+ OpsgenieAccountCreateData:
+ description: Opsgenie account data for a create request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpsgenieAccountCreateAttributes"
+ type:
+ $ref: "#/components/schemas/OpsgenieAccountType"
+ required:
+ - type
+ - attributes
+ type: object
+ OpsgenieAccountCreateRequest:
+ description: Create request for an Opsgenie account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpsgenieAccountCreateData"
+ required:
+ - data
+ type: object
+ OpsgenieAccountResponse:
+ description: Response containing an Opsgenie account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpsgenieAccountResponseData"
+ required:
+ - data
+ type: object
+ OpsgenieAccountResponseAttributes:
+ description: The attributes from an Opsgenie account response.
+ properties:
+ region:
+ $ref: "#/components/schemas/OpsgenieServiceRegionType"
+ type: object
+ OpsgenieAccountResponseData:
+ description: Opsgenie account data from a response.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpsgenieAccountResponseAttributes"
+ id:
+ description: The ID of the Opsgenie account.
+ example: "596da4af-0563-4097-90ff-07230c3f9db3"
+ maxLength: 100
+ minLength: 1
+ type: string
+ type:
+ $ref: "#/components/schemas/OpsgenieAccountType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ OpsgenieAccountType:
+ default: opsgenie-account
+ description: Opsgenie account resource type.
+ enum:
+ - opsgenie-account
+ example: opsgenie-account
+ type: string
+ x-enum-varnames:
+ - OPSGENIE_ACCOUNT
+ OpsgenieAccountUpdateAttributes:
+ description: The Opsgenie account attributes for an update request.
+ properties:
+ api_key:
+ description: The Opsgenie API key for your Opsgenie account.
+ example: "00000000-0000-0000-0000-000000000000"
+ minLength: 1
+ type: string
+ region:
+ $ref: "#/components/schemas/OpsgenieServiceRegionType"
+ type: object
+ OpsgenieAccountUpdateData:
+ description: Opsgenie account data for an update request.
+ properties:
+ attributes:
+ $ref: "#/components/schemas/OpsgenieAccountUpdateAttributes"
+ id:
+ description: The ID of the Opsgenie account.
+ example: "596da4af-0563-4097-90ff-07230c3f9db3"
+ maxLength: 100
+ minLength: 1
+ type: string
+ type:
+ $ref: "#/components/schemas/OpsgenieAccountType"
+ required:
+ - id
+ - type
+ - attributes
+ type: object
+ OpsgenieAccountUpdateRequest:
+ description: Update request for an Opsgenie account.
+ properties:
+ data:
+ $ref: "#/components/schemas/OpsgenieAccountUpdateData"
+ required:
+ - data
+ type: object
+ OpsgenieAccountsResponse:
+ description: Response with a list of Opsgenie accounts.
+ properties:
+ data:
+ description: An array of Opsgenie accounts.
+ example: [{"attributes": {"region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}, {"attributes": {"region": "eu"}, "id": "0d2937f1-b561-44fa-914a-99910f848014", "type": "opsgenie-account"}]
+ items:
+ $ref: "#/components/schemas/OpsgenieAccountResponseData"
+ type: array
+ required:
+ - data
+ type: object
OpsgenieServiceCreateAttributes:
description: The Opsgenie service attributes for a create request.
properties:
@@ -124953,6 +125083,161 @@ paths:
summary: Update tenancy config
tags:
- OCI Integration
+ /api/v2/integration/opsgenie/accounts:
+ get:
+ description: Get a list of all Opsgenie accounts from the Datadog Opsgenie integration.
+ operationId: ListOpsgenieAccounts
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ - attributes:
+ region: us
+ id: 00000000-0000-0000-0000-000000000001
+ type: opsgenie-account
+ schema:
+ $ref: "#/components/schemas/OpsgenieAccountsResponse"
+ description: OK
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Get all Opsgenie accounts
+ tags:
+ - Opsgenie Integration
+ "x-permission":
+ operator: OR
+ permissions:
+ - integrations_read
+ post:
+ description: Create a new Opsgenie account in the Datadog Opsgenie integration.
+ operationId: CreateOpsgenieAccount
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ api_key: 00000000-0000-0000-0000-000000000000
+ region: us
+ type: opsgenie-account
+ schema:
+ $ref: "#/components/schemas/OpsgenieAccountCreateRequest"
+ description: Opsgenie account payload.
+ required: true
+ responses:
+ "201":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ region: us
+ id: 00000000-0000-0000-0000-000000000002
+ type: opsgenie-account
+ schema:
+ $ref: "#/components/schemas/OpsgenieAccountResponse"
+ description: CREATED
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Create a new Opsgenie account
+ tags:
+ - Opsgenie Integration
+ x-codegen-request-body-name: body
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
+ /api/v2/integration/opsgenie/accounts/{account_id}:
+ delete:
+ description: Delete a single Opsgenie account from the Datadog Opsgenie integration.
+ operationId: DeleteOpsgenieAccount
+ parameters:
+ - $ref: "#/components/parameters/OpsgenieAccountIDPathParameter"
+ responses:
+ "204":
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Delete an Opsgenie account
+ tags:
+ - Opsgenie Integration
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
+ patch:
+ description: Update a single Opsgenie account in the Datadog Opsgenie integration.
+ operationId: UpdateOpsgenieAccount
+ parameters:
+ - $ref: "#/components/parameters/OpsgenieAccountIDPathParameter"
+ requestBody:
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ api_key: 00000000-0000-0000-0000-000000000000
+ region: us
+ id: 596da4af-0563-4097-90ff-07230c3f9db3
+ type: opsgenie-account
+ schema:
+ $ref: "#/components/schemas/OpsgenieAccountUpdateRequest"
+ description: Opsgenie account payload.
+ required: true
+ responses:
+ "200":
+ content:
+ application/json:
+ examples:
+ default:
+ value:
+ data:
+ attributes:
+ region: us
+ id: 00000000-0000-0000-0000-000000000003
+ type: opsgenie-account
+ schema:
+ $ref: "#/components/schemas/OpsgenieAccountResponse"
+ description: OK
+ "400":
+ $ref: "#/components/responses/BadRequestResponse"
+ "403":
+ $ref: "#/components/responses/ForbiddenResponse"
+ "404":
+ $ref: "#/components/responses/NotFoundResponse"
+ "422":
+ $ref: "#/components/responses/UnprocessableEntityResponse"
+ "429":
+ $ref: "#/components/responses/TooManyRequestsResponse"
+ summary: Update an Opsgenie account
+ tags:
+ - Opsgenie Integration
+ x-codegen-request-body-name: body
+ "x-permission":
+ operator: OR
+ permissions:
+ - manage_integrations
/api/v2/integration/opsgenie/services:
get:
description: Get a list of all services from the Datadog Opsgenie integration.
diff --git a/examples/v2/opsgenie-integration/CreateOpsgenieAccount.java b/examples/v2/opsgenie-integration/CreateOpsgenieAccount.java
new file mode 100644
index 00000000000..c18740f27e5
--- /dev/null
+++ b/examples/v2/opsgenie-integration/CreateOpsgenieAccount.java
@@ -0,0 +1,39 @@
+// Create a new Opsgenie account returns "CREATED" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpsgenieIntegrationApi;
+import com.datadog.api.client.v2.model.OpsgenieAccountCreateAttributes;
+import com.datadog.api.client.v2.model.OpsgenieAccountCreateData;
+import com.datadog.api.client.v2.model.OpsgenieAccountCreateRequest;
+import com.datadog.api.client.v2.model.OpsgenieAccountResponse;
+import com.datadog.api.client.v2.model.OpsgenieAccountType;
+import com.datadog.api.client.v2.model.OpsgenieServiceRegionType;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ OpsgenieIntegrationApi apiInstance = new OpsgenieIntegrationApi(defaultClient);
+
+ OpsgenieAccountCreateRequest body =
+ new OpsgenieAccountCreateRequest()
+ .data(
+ new OpsgenieAccountCreateData()
+ .attributes(
+ new OpsgenieAccountCreateAttributes()
+ .apiKey("00000000-0000-0000-0000-000000000000")
+ .region(OpsgenieServiceRegionType.US))
+ .type(OpsgenieAccountType.OPSGENIE_ACCOUNT));
+
+ try {
+ OpsgenieAccountResponse result = apiInstance.createOpsgenieAccount(body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OpsgenieIntegrationApi#createOpsgenieAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.java b/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.java
new file mode 100644
index 00000000000..688a4628e51
--- /dev/null
+++ b/examples/v2/opsgenie-integration/DeleteOpsgenieAccount.java
@@ -0,0 +1,22 @@
+// Delete an Opsgenie account returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpsgenieIntegrationApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ OpsgenieIntegrationApi apiInstance = new OpsgenieIntegrationApi(defaultClient);
+
+ try {
+ apiInstance.deleteOpsgenieAccount("account_id");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OpsgenieIntegrationApi#deleteOpsgenieAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/opsgenie-integration/ListOpsgenieAccounts.java b/examples/v2/opsgenie-integration/ListOpsgenieAccounts.java
new file mode 100644
index 00000000000..875859f7eca
--- /dev/null
+++ b/examples/v2/opsgenie-integration/ListOpsgenieAccounts.java
@@ -0,0 +1,24 @@
+// Get all Opsgenie accounts returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpsgenieIntegrationApi;
+import com.datadog.api.client.v2.model.OpsgenieAccountsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ OpsgenieIntegrationApi apiInstance = new OpsgenieIntegrationApi(defaultClient);
+
+ try {
+ OpsgenieAccountsResponse result = apiInstance.listOpsgenieAccounts();
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OpsgenieIntegrationApi#listOpsgenieAccounts");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.java b/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.java
new file mode 100644
index 00000000000..fae74ad68ca
--- /dev/null
+++ b/examples/v2/opsgenie-integration/UpdateOpsgenieAccount.java
@@ -0,0 +1,40 @@
+// Update an Opsgenie account returns "OK" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.OpsgenieIntegrationApi;
+import com.datadog.api.client.v2.model.OpsgenieAccountResponse;
+import com.datadog.api.client.v2.model.OpsgenieAccountType;
+import com.datadog.api.client.v2.model.OpsgenieAccountUpdateAttributes;
+import com.datadog.api.client.v2.model.OpsgenieAccountUpdateData;
+import com.datadog.api.client.v2.model.OpsgenieAccountUpdateRequest;
+import com.datadog.api.client.v2.model.OpsgenieServiceRegionType;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ OpsgenieIntegrationApi apiInstance = new OpsgenieIntegrationApi(defaultClient);
+
+ OpsgenieAccountUpdateRequest body =
+ new OpsgenieAccountUpdateRequest()
+ .data(
+ new OpsgenieAccountUpdateData()
+ .attributes(
+ new OpsgenieAccountUpdateAttributes()
+ .apiKey("00000000-0000-0000-0000-000000000000")
+ .region(OpsgenieServiceRegionType.US))
+ .id("596da4af-0563-4097-90ff-07230c3f9db3")
+ .type(OpsgenieAccountType.OPSGENIE_ACCOUNT));
+
+ try {
+ OpsgenieAccountResponse result = apiInstance.updateOpsgenieAccount("account_id", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling OpsgenieIntegrationApi#updateOpsgenieAccount");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/api/OpsgenieIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/OpsgenieIntegrationApi.java
index 69031856ac8..a0e66abe3b7 100644
--- a/src/main/java/com/datadog/api/client/v2/api/OpsgenieIntegrationApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/OpsgenieIntegrationApi.java
@@ -4,6 +4,10 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.OpsgenieAccountCreateRequest;
+import com.datadog.api.client.v2.model.OpsgenieAccountResponse;
+import com.datadog.api.client.v2.model.OpsgenieAccountUpdateRequest;
+import com.datadog.api.client.v2.model.OpsgenieAccountsResponse;
import com.datadog.api.client.v2.model.OpsgenieServiceCreateRequest;
import com.datadog.api.client.v2.model.OpsgenieServiceResponse;
import com.datadog.api.client.v2.model.OpsgenieServiceUpdateRequest;
@@ -46,6 +50,139 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ * Create a new Opsgenie account.
+ *
+ *
See {@link #createOpsgenieAccountWithHttpInfo}.
+ *
+ * @param body Opsgenie account payload. (required)
+ * @return OpsgenieAccountResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpsgenieAccountResponse createOpsgenieAccount(OpsgenieAccountCreateRequest body)
+ throws ApiException {
+ return createOpsgenieAccountWithHttpInfo(body).getData();
+ }
+
+ /**
+ * Create a new Opsgenie account.
+ *
+ *
See {@link #createOpsgenieAccountWithHttpInfoAsync}.
+ *
+ * @param body Opsgenie account payload. (required)
+ * @return CompletableFuture<OpsgenieAccountResponse>
+ */
+ public CompletableFuture createOpsgenieAccountAsync(
+ OpsgenieAccountCreateRequest body) {
+ return createOpsgenieAccountWithHttpInfoAsync(body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a new Opsgenie account in the Datadog Opsgenie integration.
+ *
+ * @param body Opsgenie account payload. (required)
+ * @return ApiResponse<OpsgenieAccountResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 201 | CREATED | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createOpsgenieAccountWithHttpInfo(
+ OpsgenieAccountCreateRequest body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createOpsgenieAccount");
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/integration/opsgenie/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.createOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create a new Opsgenie account.
+ *
+ * See {@link #createOpsgenieAccountWithHttpInfo}.
+ *
+ * @param body Opsgenie account payload. (required)
+ * @return CompletableFuture<ApiResponse<OpsgenieAccountResponse>>
+ */
+ public CompletableFuture>
+ createOpsgenieAccountWithHttpInfoAsync(OpsgenieAccountCreateRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createOpsgenieAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath = "/api/v2/integration/opsgenie/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.createOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Create a new service object.
*
@@ -180,6 +317,141 @@ public ApiResponse createOpsgenieServiceWithHttpInfo(
new GenericType() {});
}
+ /**
+ * Delete an Opsgenie account.
+ *
+ * See {@link #deleteOpsgenieAccountWithHttpInfo}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteOpsgenieAccount(String accountId) throws ApiException {
+ deleteOpsgenieAccountWithHttpInfo(accountId);
+ }
+
+ /**
+ * Delete an Opsgenie account.
+ *
+ *
See {@link #deleteOpsgenieAccountWithHttpInfoAsync}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteOpsgenieAccountAsync(String accountId) {
+ return deleteOpsgenieAccountWithHttpInfoAsync(accountId)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete a single Opsgenie account from the Datadog Opsgenie integration.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 204 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteOpsgenieAccountWithHttpInfo(String accountId) throws ApiException {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'accountId' when calling deleteOpsgenieAccount");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration/opsgenie/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.deleteOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete an Opsgenie account.
+ *
+ * See {@link #deleteOpsgenieAccountWithHttpInfo}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteOpsgenieAccountWithHttpInfoAsync(
+ String accountId) {
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling deleteOpsgenieAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration/opsgenie/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.deleteOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
/**
* Delete a single service object.
*
@@ -469,6 +741,117 @@ public ApiResponse getOpsgenieServiceWithHttpInfo(
new GenericType() {});
}
+ /**
+ * Get all Opsgenie accounts.
+ *
+ * See {@link #listOpsgenieAccountsWithHttpInfo}.
+ *
+ * @return OpsgenieAccountsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpsgenieAccountsResponse listOpsgenieAccounts() throws ApiException {
+ return listOpsgenieAccountsWithHttpInfo().getData();
+ }
+
+ /**
+ * Get all Opsgenie accounts.
+ *
+ *
See {@link #listOpsgenieAccountsWithHttpInfoAsync}.
+ *
+ * @return CompletableFuture<OpsgenieAccountsResponse>
+ */
+ public CompletableFuture listOpsgenieAccountsAsync() {
+ return listOpsgenieAccountsWithHttpInfoAsync()
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get a list of all Opsgenie accounts from the Datadog Opsgenie integration.
+ *
+ * @return ApiResponse<OpsgenieAccountsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 403 | Forbidden | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listOpsgenieAccountsWithHttpInfo()
+ throws ApiException {
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/integration/opsgenie/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.listOpsgenieAccounts",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Get all Opsgenie accounts.
+ *
+ * See {@link #listOpsgenieAccountsWithHttpInfo}.
+ *
+ * @return CompletableFuture<ApiResponse<OpsgenieAccountsResponse>>
+ */
+ public CompletableFuture>
+ listOpsgenieAccountsWithHttpInfoAsync() {
+ Object localVarPostBody = null;
+ // create path and map variables
+ String localVarPath = "/api/v2/integration/opsgenie/accounts";
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.listOpsgenieAccounts",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Get all service objects.
*
@@ -580,6 +963,165 @@ public ApiResponse listOpsgenieServicesWithHttpInfo()
new GenericType() {});
}
+ /**
+ * Update an Opsgenie account.
+ *
+ * See {@link #updateOpsgenieAccountWithHttpInfo}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @param body Opsgenie account payload. (required)
+ * @return OpsgenieAccountResponse
+ * @throws ApiException if fails to make API call
+ */
+ public OpsgenieAccountResponse updateOpsgenieAccount(
+ String accountId, OpsgenieAccountUpdateRequest body) throws ApiException {
+ return updateOpsgenieAccountWithHttpInfo(accountId, body).getData();
+ }
+
+ /**
+ * Update an Opsgenie account.
+ *
+ *
See {@link #updateOpsgenieAccountWithHttpInfoAsync}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @param body Opsgenie account payload. (required)
+ * @return CompletableFuture<OpsgenieAccountResponse>
+ */
+ public CompletableFuture updateOpsgenieAccountAsync(
+ String accountId, OpsgenieAccountUpdateRequest body) {
+ return updateOpsgenieAccountWithHttpInfoAsync(accountId, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update a single Opsgenie account in the Datadog Opsgenie integration.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @param body Opsgenie account payload. (required)
+ * @return ApiResponse<OpsgenieAccountResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | OK | - |
+ * | 400 | Bad Request | - |
+ * | 403 | Forbidden | - |
+ * | 404 | Not Found | - |
+ * | 422 | The server cannot process the request because it contains invalid data. | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse updateOpsgenieAccountWithHttpInfo(
+ String accountId, OpsgenieAccountUpdateRequest body) throws ApiException {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'accountId' when calling updateOpsgenieAccount");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateOpsgenieAccount");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration/opsgenie/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.updateOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update an Opsgenie account.
+ *
+ * See {@link #updateOpsgenieAccountWithHttpInfo}.
+ *
+ * @param accountId The UUID of the Opsgenie account. (required)
+ * @param body Opsgenie account payload. (required)
+ * @return CompletableFuture<ApiResponse<OpsgenieAccountResponse>>
+ */
+ public CompletableFuture>
+ updateOpsgenieAccountWithHttpInfoAsync(String accountId, OpsgenieAccountUpdateRequest body) {
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'accountId' is set
+ if (accountId == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'accountId' when calling updateOpsgenieAccount"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateOpsgenieAccount"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/integration/opsgenie/accounts/{account_id}"
+ .replaceAll("\\{" + "account_id" + "\\}", apiClient.escapeString(accountId.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.OpsgenieIntegrationApi.updateOpsgenieAccount",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
/**
* Update a single service object.
*
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateAttributes.java
new file mode 100644
index 00000000000..e4222efaf40
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateAttributes.java
@@ -0,0 +1,181 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The Opsgenie account attributes for a create request. */
+@JsonPropertyOrder({
+ OpsgenieAccountCreateAttributes.JSON_PROPERTY_API_KEY,
+ OpsgenieAccountCreateAttributes.JSON_PROPERTY_REGION
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountCreateAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_API_KEY = "api_key";
+ private String apiKey;
+
+ public static final String JSON_PROPERTY_REGION = "region";
+ private OpsgenieServiceRegionType region;
+
+ public OpsgenieAccountCreateAttributes() {}
+
+ @JsonCreator
+ public OpsgenieAccountCreateAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_API_KEY) String apiKey,
+ @JsonProperty(required = true, value = JSON_PROPERTY_REGION)
+ OpsgenieServiceRegionType region) {
+ this.apiKey = apiKey;
+ this.region = region;
+ this.unparsed |= !region.isValid();
+ }
+
+ public OpsgenieAccountCreateAttributes apiKey(String apiKey) {
+ this.apiKey = apiKey;
+ return this;
+ }
+
+ /**
+ * The Opsgenie API key for your Opsgenie account.
+ *
+ * @return apiKey
+ */
+ @JsonProperty(JSON_PROPERTY_API_KEY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public OpsgenieAccountCreateAttributes region(OpsgenieServiceRegionType region) {
+ this.region = region;
+ this.unparsed |= !region.isValid();
+ return this;
+ }
+
+ /**
+ * The region for the Opsgenie service.
+ *
+ * @return region
+ */
+ @JsonProperty(JSON_PROPERTY_REGION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieServiceRegionType getRegion() {
+ return region;
+ }
+
+ public void setRegion(OpsgenieServiceRegionType region) {
+ if (!region.isValid()) {
+ this.unparsed = true;
+ }
+ this.region = region;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountCreateAttributes
+ */
+ @JsonAnySetter
+ public OpsgenieAccountCreateAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountCreateAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountCreateAttributes opsgenieAccountCreateAttributes =
+ (OpsgenieAccountCreateAttributes) o;
+ return Objects.equals(this.apiKey, opsgenieAccountCreateAttributes.apiKey)
+ && Objects.equals(this.region, opsgenieAccountCreateAttributes.region)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountCreateAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(apiKey, region, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountCreateAttributes {\n");
+ sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n");
+ sb.append(" region: ").append(toIndentedString(region)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateData.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateData.java
new file mode 100644
index 00000000000..83524ed60c0
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateData.java
@@ -0,0 +1,182 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Opsgenie account data for a create request. */
+@JsonPropertyOrder({
+ OpsgenieAccountCreateData.JSON_PROPERTY_ATTRIBUTES,
+ OpsgenieAccountCreateData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountCreateData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private OpsgenieAccountCreateAttributes attributes;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private OpsgenieAccountType type = OpsgenieAccountType.OPSGENIE_ACCOUNT;
+
+ public OpsgenieAccountCreateData() {}
+
+ @JsonCreator
+ public OpsgenieAccountCreateData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ OpsgenieAccountCreateAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OpsgenieAccountType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public OpsgenieAccountCreateData attributes(OpsgenieAccountCreateAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * The Opsgenie account attributes for a create request.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountCreateAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(OpsgenieAccountCreateAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public OpsgenieAccountCreateData type(OpsgenieAccountType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Opsgenie account resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountType getType() {
+ return type;
+ }
+
+ public void setType(OpsgenieAccountType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountCreateData
+ */
+ @JsonAnySetter
+ public OpsgenieAccountCreateData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountCreateData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountCreateData opsgenieAccountCreateData = (OpsgenieAccountCreateData) o;
+ return Objects.equals(this.attributes, opsgenieAccountCreateData.attributes)
+ && Objects.equals(this.type, opsgenieAccountCreateData.type)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountCreateData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountCreateData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateRequest.java
new file mode 100644
index 00000000000..1e0a6580299
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountCreateRequest.java
@@ -0,0 +1,146 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Create request for an Opsgenie account. */
+@JsonPropertyOrder({OpsgenieAccountCreateRequest.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountCreateRequest {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private OpsgenieAccountCreateData data;
+
+ public OpsgenieAccountCreateRequest() {}
+
+ @JsonCreator
+ public OpsgenieAccountCreateRequest(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OpsgenieAccountCreateData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public OpsgenieAccountCreateRequest data(OpsgenieAccountCreateData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Opsgenie account data for a create request.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountCreateData getData() {
+ return data;
+ }
+
+ public void setData(OpsgenieAccountCreateData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountCreateRequest
+ */
+ @JsonAnySetter
+ public OpsgenieAccountCreateRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountCreateRequest object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountCreateRequest opsgenieAccountCreateRequest = (OpsgenieAccountCreateRequest) o;
+ return Objects.equals(this.data, opsgenieAccountCreateRequest.data)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountCreateRequest.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountCreateRequest {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponse.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponse.java
new file mode 100644
index 00000000000..5b99079c80f
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponse.java
@@ -0,0 +1,145 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Response containing an Opsgenie account. */
+@JsonPropertyOrder({OpsgenieAccountResponse.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private OpsgenieAccountResponseData data;
+
+ public OpsgenieAccountResponse() {}
+
+ @JsonCreator
+ public OpsgenieAccountResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OpsgenieAccountResponseData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public OpsgenieAccountResponse data(OpsgenieAccountResponseData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Opsgenie account data from a response.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountResponseData getData() {
+ return data;
+ }
+
+ public void setData(OpsgenieAccountResponseData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountResponse
+ */
+ @JsonAnySetter
+ public OpsgenieAccountResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountResponse opsgenieAccountResponse = (OpsgenieAccountResponse) o;
+ return Objects.equals(this.data, opsgenieAccountResponse.data)
+ && Objects.equals(this.additionalProperties, opsgenieAccountResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseAttributes.java
new file mode 100644
index 00000000000..fa64f5a72c5
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseAttributes.java
@@ -0,0 +1,141 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The attributes from an Opsgenie account response. */
+@JsonPropertyOrder({OpsgenieAccountResponseAttributes.JSON_PROPERTY_REGION})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountResponseAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_REGION = "region";
+ private OpsgenieServiceRegionType region;
+
+ public OpsgenieAccountResponseAttributes region(OpsgenieServiceRegionType region) {
+ this.region = region;
+ this.unparsed |= !region.isValid();
+ return this;
+ }
+
+ /**
+ * The region for the Opsgenie service.
+ *
+ * @return region
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_REGION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public OpsgenieServiceRegionType getRegion() {
+ return region;
+ }
+
+ public void setRegion(OpsgenieServiceRegionType region) {
+ if (!region.isValid()) {
+ this.unparsed = true;
+ }
+ this.region = region;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountResponseAttributes
+ */
+ @JsonAnySetter
+ public OpsgenieAccountResponseAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountResponseAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountResponseAttributes opsgenieAccountResponseAttributes =
+ (OpsgenieAccountResponseAttributes) o;
+ return Objects.equals(this.region, opsgenieAccountResponseAttributes.region)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountResponseAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(region, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountResponseAttributes {\n");
+ sb.append(" region: ").append(toIndentedString(region)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseData.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseData.java
new file mode 100644
index 00000000000..1540b46edea
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountResponseData.java
@@ -0,0 +1,210 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Opsgenie account data from a response. */
+@JsonPropertyOrder({
+ OpsgenieAccountResponseData.JSON_PROPERTY_ATTRIBUTES,
+ OpsgenieAccountResponseData.JSON_PROPERTY_ID,
+ OpsgenieAccountResponseData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountResponseData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private OpsgenieAccountResponseAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private OpsgenieAccountType type = OpsgenieAccountType.OPSGENIE_ACCOUNT;
+
+ public OpsgenieAccountResponseData() {}
+
+ @JsonCreator
+ public OpsgenieAccountResponseData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ OpsgenieAccountResponseAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OpsgenieAccountType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public OpsgenieAccountResponseData attributes(OpsgenieAccountResponseAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * The attributes from an Opsgenie account response.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountResponseAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(OpsgenieAccountResponseAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public OpsgenieAccountResponseData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The ID of the Opsgenie account.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public OpsgenieAccountResponseData type(OpsgenieAccountType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Opsgenie account resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountType getType() {
+ return type;
+ }
+
+ public void setType(OpsgenieAccountType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountResponseData
+ */
+ @JsonAnySetter
+ public OpsgenieAccountResponseData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountResponseData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountResponseData opsgenieAccountResponseData = (OpsgenieAccountResponseData) o;
+ return Objects.equals(this.attributes, opsgenieAccountResponseData.attributes)
+ && Objects.equals(this.id, opsgenieAccountResponseData.id)
+ && Objects.equals(this.type, opsgenieAccountResponseData.type)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountResponseData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountResponseData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountType.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountType.java
new file mode 100644
index 00000000000..0d2107de72b
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountType.java
@@ -0,0 +1,56 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.ModelEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/** Opsgenie account resource type. */
+@JsonSerialize(using = OpsgenieAccountType.OpsgenieAccountTypeSerializer.class)
+public class OpsgenieAccountType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(Arrays.asList("opsgenie-account"));
+
+ public static final OpsgenieAccountType OPSGENIE_ACCOUNT =
+ new OpsgenieAccountType("opsgenie-account");
+
+ OpsgenieAccountType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class OpsgenieAccountTypeSerializer extends StdSerializer {
+ public OpsgenieAccountTypeSerializer(Class t) {
+ super(t);
+ }
+
+ public OpsgenieAccountTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(
+ OpsgenieAccountType value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static OpsgenieAccountType fromValue(String value) {
+ return new OpsgenieAccountType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateAttributes.java
new file mode 100644
index 00000000000..5864e9da265
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateAttributes.java
@@ -0,0 +1,170 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** The Opsgenie account attributes for an update request. */
+@JsonPropertyOrder({
+ OpsgenieAccountUpdateAttributes.JSON_PROPERTY_API_KEY,
+ OpsgenieAccountUpdateAttributes.JSON_PROPERTY_REGION
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountUpdateAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_API_KEY = "api_key";
+ private String apiKey;
+
+ public static final String JSON_PROPERTY_REGION = "region";
+ private OpsgenieServiceRegionType region;
+
+ public OpsgenieAccountUpdateAttributes apiKey(String apiKey) {
+ this.apiKey = apiKey;
+ return this;
+ }
+
+ /**
+ * The Opsgenie API key for your Opsgenie account.
+ *
+ * @return apiKey
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_API_KEY)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getApiKey() {
+ return apiKey;
+ }
+
+ public void setApiKey(String apiKey) {
+ this.apiKey = apiKey;
+ }
+
+ public OpsgenieAccountUpdateAttributes region(OpsgenieServiceRegionType region) {
+ this.region = region;
+ this.unparsed |= !region.isValid();
+ return this;
+ }
+
+ /**
+ * The region for the Opsgenie service.
+ *
+ * @return region
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_REGION)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public OpsgenieServiceRegionType getRegion() {
+ return region;
+ }
+
+ public void setRegion(OpsgenieServiceRegionType region) {
+ if (!region.isValid()) {
+ this.unparsed = true;
+ }
+ this.region = region;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountUpdateAttributes
+ */
+ @JsonAnySetter
+ public OpsgenieAccountUpdateAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountUpdateAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountUpdateAttributes opsgenieAccountUpdateAttributes =
+ (OpsgenieAccountUpdateAttributes) o;
+ return Objects.equals(this.apiKey, opsgenieAccountUpdateAttributes.apiKey)
+ && Objects.equals(this.region, opsgenieAccountUpdateAttributes.region)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountUpdateAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(apiKey, region, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountUpdateAttributes {\n");
+ sb.append(" apiKey: ").append(toIndentedString(apiKey)).append("\n");
+ sb.append(" region: ").append(toIndentedString(region)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateData.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateData.java
new file mode 100644
index 00000000000..2a58c744ea4
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateData.java
@@ -0,0 +1,210 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Opsgenie account data for an update request. */
+@JsonPropertyOrder({
+ OpsgenieAccountUpdateData.JSON_PROPERTY_ATTRIBUTES,
+ OpsgenieAccountUpdateData.JSON_PROPERTY_ID,
+ OpsgenieAccountUpdateData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountUpdateData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private OpsgenieAccountUpdateAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private OpsgenieAccountType type = OpsgenieAccountType.OPSGENIE_ACCOUNT;
+
+ public OpsgenieAccountUpdateData() {}
+
+ @JsonCreator
+ public OpsgenieAccountUpdateData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ OpsgenieAccountUpdateAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OpsgenieAccountType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public OpsgenieAccountUpdateData attributes(OpsgenieAccountUpdateAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * The Opsgenie account attributes for an update request.
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountUpdateAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(OpsgenieAccountUpdateAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public OpsgenieAccountUpdateData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * The ID of the Opsgenie account.
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public OpsgenieAccountUpdateData type(OpsgenieAccountType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Opsgenie account resource type.
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountType getType() {
+ return type;
+ }
+
+ public void setType(OpsgenieAccountType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountUpdateData
+ */
+ @JsonAnySetter
+ public OpsgenieAccountUpdateData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountUpdateData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountUpdateData opsgenieAccountUpdateData = (OpsgenieAccountUpdateData) o;
+ return Objects.equals(this.attributes, opsgenieAccountUpdateData.attributes)
+ && Objects.equals(this.id, opsgenieAccountUpdateData.id)
+ && Objects.equals(this.type, opsgenieAccountUpdateData.type)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountUpdateData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountUpdateData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateRequest.java
new file mode 100644
index 00000000000..1a5def63dfe
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountUpdateRequest.java
@@ -0,0 +1,146 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** Update request for an Opsgenie account. */
+@JsonPropertyOrder({OpsgenieAccountUpdateRequest.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountUpdateRequest {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private OpsgenieAccountUpdateData data;
+
+ public OpsgenieAccountUpdateRequest() {}
+
+ @JsonCreator
+ public OpsgenieAccountUpdateRequest(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) OpsgenieAccountUpdateData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public OpsgenieAccountUpdateRequest data(OpsgenieAccountUpdateData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Opsgenie account data for an update request.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OpsgenieAccountUpdateData getData() {
+ return data;
+ }
+
+ public void setData(OpsgenieAccountUpdateData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountUpdateRequest
+ */
+ @JsonAnySetter
+ public OpsgenieAccountUpdateRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountUpdateRequest object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountUpdateRequest opsgenieAccountUpdateRequest = (OpsgenieAccountUpdateRequest) o;
+ return Objects.equals(this.data, opsgenieAccountUpdateRequest.data)
+ && Objects.equals(
+ this.additionalProperties, opsgenieAccountUpdateRequest.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountUpdateRequest {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountsResponse.java b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountsResponse.java
new file mode 100644
index 00000000000..9bb09e24502
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/OpsgenieAccountsResponse.java
@@ -0,0 +1,155 @@
+/*
+ * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
+ * This product includes software developed at Datadog (https://www.datadoghq.com/).
+ * Copyright 2019-Present Datadog, Inc.
+ */
+
+package com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** Response with a list of Opsgenie accounts. */
+@JsonPropertyOrder({OpsgenieAccountsResponse.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class OpsgenieAccountsResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private List data = new ArrayList<>();
+
+ public OpsgenieAccountsResponse() {}
+
+ @JsonCreator
+ public OpsgenieAccountsResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA)
+ List data) {
+ this.data = data;
+ }
+
+ public OpsgenieAccountsResponse data(List data) {
+ this.data = data;
+ for (OpsgenieAccountResponseData item : data) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public OpsgenieAccountsResponse addDataItem(OpsgenieAccountResponseData dataItem) {
+ this.data.add(dataItem);
+ this.unparsed |= dataItem.unparsed;
+ return this;
+ }
+
+ /**
+ * An array of Opsgenie accounts.
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getData() {
+ return data;
+ }
+
+ public void setData(List data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return OpsgenieAccountsResponse
+ */
+ @JsonAnySetter
+ public OpsgenieAccountsResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this OpsgenieAccountsResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ OpsgenieAccountsResponse opsgenieAccountsResponse = (OpsgenieAccountsResponse) o;
+ return Objects.equals(this.data, opsgenieAccountsResponse.data)
+ && Objects.equals(this.additionalProperties, opsgenieAccountsResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class OpsgenieAccountsResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json
index 7139a86ede5..41a3abc9b51 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/given.json
+++ b/src/test/resources/com/datadog/api/client/v2/api/given.json
@@ -674,6 +674,18 @@
"tag": "Microsoft Teams Integration",
"operationId": "CreateWorkflowsWebhookHandle"
},
+ {
+ "parameters": [
+ {
+ "name": "body",
+ "value": "{\n \"data\": {\n \"attributes\": {\n \"api_key\": \"00000000-0000-0000-0000-000000000000\",\n \"region\": \"us\"\n },\n \"type\": \"opsgenie-account\"\n }\n}"
+ }
+ ],
+ "step": "there is a valid \"opsgenie_account\" in the system",
+ "key": "opsgenie_account",
+ "tag": "Opsgenie Integration",
+ "operationId": "CreateOpsgenieAccount"
+ },
{
"parameters": [
{
diff --git a/src/test/resources/com/datadog/api/client/v2/api/opsgenie_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/opsgenie_integration.feature
index 5df3907ac03..453d4a30277 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/opsgenie_integration.feature
+++ b/src/test/resources/com/datadog/api/client/v2/api/opsgenie_integration.feature
@@ -9,6 +9,20 @@ Feature: Opsgenie Integration
And a valid "appKeyAuth" key in the system
And an instance of "OpsgenieIntegration" API
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Create a new Opsgenie account returns "Bad Request" response
+ Given new "CreateOpsgenieAccount" request
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Create a new Opsgenie account returns "CREATED" response
+ Given new "CreateOpsgenieAccount" request
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 201 CREATED
+
@skip @team:Datadog/collaboration-integrations
Scenario: Create a new service object returns "Bad Request" response
Given new "CreateOpsgenieService" request
@@ -54,6 +68,27 @@ Feature: Opsgenie Integration
When the request is sent
Then the response status is 204 OK
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Delete an Opsgenie account returns "Bad Request" response
+ Given new "DeleteOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Delete an Opsgenie account returns "Not Found" response
+ Given new "DeleteOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 404 Not Found
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Delete an Opsgenie account returns "OK" response
+ Given new "DeleteOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ When the request is sent
+ Then the response status is 204 OK
+
@generated @skip @team:Datadog/collaboration-integrations
Scenario: Get a single service object returns "Bad Request" response
Given new "GetOpsgenieService" request
@@ -85,6 +120,12 @@ Feature: Opsgenie Integration
And the response "data.attributes.name" has the same value as "opsgenie_service.data.attributes.name"
And the response "data.attributes.region" is equal to "us"
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Get all Opsgenie accounts returns "OK" response
+ Given new "ListOpsgenieAccounts" request
+ When the request is sent
+ Then the response status is 200 OK
+
@team:Datadog/collaboration-integrations
Scenario: Get all service objects returns "OK" response
Given there is a valid "opsgenie_service" in the system
@@ -127,3 +168,35 @@ Feature: Opsgenie Integration
Then the response status is 200 OK
And the response "data.attributes.name" is equal to "{{ opsgenie_service.data.attributes.name }}--updated"
And the response "data.attributes.region" is equal to "eu"
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Update an Opsgenie account returns "Bad Request" response
+ Given new "UpdateOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 400 Bad Request
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Update an Opsgenie account returns "Not Found" response
+ Given new "UpdateOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 404 Not Found
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Update an Opsgenie account returns "OK" response
+ Given new "UpdateOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 200 OK
+
+ @generated @skip @team:Datadog/collaboration-integrations
+ Scenario: Update an Opsgenie account returns "The server cannot process the request because it contains invalid data." response
+ Given new "UpdateOpsgenieAccount" request
+ And request contains "account_id" parameter from "REPLACE.ME"
+ And body with value {"data": {"attributes": {"api_key": "00000000-0000-0000-0000-000000000000", "region": "us"}, "id": "596da4af-0563-4097-90ff-07230c3f9db3", "type": "opsgenie-account"}}
+ When the request is sent
+ Then the response status is 422 The server cannot process the request because it contains invalid data.
diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json
index b6003df8683..e16c17893f6 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/undo.json
+++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json
@@ -3456,6 +3456,37 @@
"type": "idempotent"
}
},
+ "ListOpsgenieAccounts": {
+ "tag": "Opsgenie Integration",
+ "undo": {
+ "type": "safe"
+ }
+ },
+ "CreateOpsgenieAccount": {
+ "tag": "Opsgenie Integration",
+ "undo": {
+ "operationId": "DeleteOpsgenieAccount",
+ "parameters": [
+ {
+ "name": "account_id",
+ "source": "data.id"
+ }
+ ],
+ "type": "unsafe"
+ }
+ },
+ "DeleteOpsgenieAccount": {
+ "tag": "Opsgenie Integration",
+ "undo": {
+ "type": "idempotent"
+ }
+ },
+ "UpdateOpsgenieAccount": {
+ "tag": "Opsgenie Integration",
+ "undo": {
+ "type": "idempotent"
+ }
+ },
"ListOpsgenieServices": {
"tag": "Opsgenie Integration",
"undo": {