From 09885d4cf8abef66940a7f0c72d1fd28881e1f68 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 27 Jan 2026 16:49:15 +0000 Subject: [PATCH] Regenerate client from commit d98173c of spec repo --- .generator/schemas/v2/openapi.yaml | 202 +++++++ .../v2/case-management/ListCaseWatchers.java | 26 + examples/v2/case-management/UnwatchCase.java | 24 + examples/v2/case-management/WatchCase.java | 24 + .../com/datadog/api/client/ApiClient.java | 3 + .../api/client/v2/api/CaseManagementApi.java | 498 ++++++++++++++++++ .../datadog/api/client/v2/model/Watcher.java | 209 ++++++++ .../client/v2/model/WatcherRelationships.java | 145 +++++ .../client/v2/model/WatcherResourceType.java | 54 ++ .../v2/model/WatcherUserRelationship.java | 145 +++++ .../api/client/v2/model/WatchersResponse.java | 154 ++++++ .../api/client/v2/api/case_management.feature | 78 +++ .../com/datadog/api/client/v2/api/undo.json | 20 + 13 files changed, 1582 insertions(+) create mode 100644 examples/v2/case-management/ListCaseWatchers.java create mode 100644 examples/v2/case-management/UnwatchCase.java create mode 100644 examples/v2/case-management/WatchCase.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/Watcher.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/WatcherRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/WatcherResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/WatcherUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/WatchersResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ca425e6bd9f..685088a65d1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1125,6 +1125,14 @@ components: schema: example: 00000000-0000-9999-0000-000000000000 type: string + UserUUIDPathParameter: + description: User UUID + example: 8146583c-0b5f-11ec-abf8-da7ad0900001 + in: path + name: user_id + required: true + schema: + type: string WorkflowId: description: The ID of the workflow. in: path @@ -64692,6 +64700,57 @@ components: - X_CONTENT_TYPE_HEADER_MISSING - X_PATH_INJECTION - XSS + Watcher: + description: Case watcher + properties: + id: + description: User UUID of the watcher + example: 8146583c-0b5f-11ec-abf8-da7ad0900001 + type: string + relationships: + $ref: '#/components/schemas/WatcherRelationships' + type: + $ref: '#/components/schemas/WatcherResourceType' + required: + - id + - type + - relationships + type: object + WatcherRelationships: + description: Watcher relationships + properties: + user: + $ref: '#/components/schemas/WatcherUserRelationship' + required: + - user + type: object + WatcherResourceType: + description: Watcher resource type + enum: + - watcher + example: watcher + type: string + x-enum-varnames: + - WATCHER + WatcherUserRelationship: + description: Relationship to user + properties: + data: + $ref: '#/components/schemas/UserRelationshipData' + required: + - data + type: object + WatchersResponse: + description: Response with case watchers + properties: + data: + description: Array of watchers + items: + $ref: '#/components/schemas/Watcher' + type: array + required: + - data + type: object Weekday: description: A day of the week. enum: @@ -70202,6 +70261,149 @@ paths: summary: Unassign case tags: - Case Management + /api/v2/cases/{case_id}/watchers: + get: + description: Get all users watching a case + operationId: ListCaseWatchers + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/WatchersResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get case watchers + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/cases/{case_id}/watchers/{user_id}: + delete: + description: Remove a user from the watchers list for a case + operationId: UnwatchCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + - $ref: '#/components/parameters/UserUUIDPathParameter' + responses: + '204': + description: No Content + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Remove user as watcher + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Add a user as a watcher for a case + operationId: WatchCase + parameters: + - $ref: '#/components/parameters/CaseIDPathParameter' + - $ref: '#/components/parameters/UserUUIDPathParameter' + responses: + '201': + description: Created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_write + summary: Add user as watcher + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in public beta and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/catalog/entity: get: description: Get a list of entities from Software Catalog. diff --git a/examples/v2/case-management/ListCaseWatchers.java b/examples/v2/case-management/ListCaseWatchers.java new file mode 100644 index 00000000000..4608bb78125 --- /dev/null +++ b/examples/v2/case-management/ListCaseWatchers.java @@ -0,0 +1,26 @@ +// Get case watchers returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; +import com.datadog.api.client.v2.model.WatchersResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listCaseWatchers", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + WatchersResponse result = + apiInstance.listCaseWatchers("f98a5a5b-e0ff-45d4-b2f5-afe6e74de504"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listCaseWatchers"); + 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/case-management/UnwatchCase.java b/examples/v2/case-management/UnwatchCase.java new file mode 100644 index 00000000000..84e387c0e47 --- /dev/null +++ b/examples/v2/case-management/UnwatchCase.java @@ -0,0 +1,24 @@ +// Remove user as watcher returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.unwatchCase", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.unwatchCase( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#unwatchCase"); + 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/case-management/WatchCase.java b/examples/v2/case-management/WatchCase.java new file mode 100644 index 00000000000..aa6b38324b6 --- /dev/null +++ b/examples/v2/case-management/WatchCase.java @@ -0,0 +1,24 @@ +// Add user as watcher returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CaseManagementApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.watchCase", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.watchCase( + "f98a5a5b-e0ff-45d4-b2f5-afe6e74de504", "8146583c-0b5f-11ec-abf8-da7ad0900001"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#watchCase"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index e18ff8356b4..f00073478ab 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -775,6 +775,9 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.listCaseWatchers", false); + put("v2.unwatchCase", false); + put("v2.watchCase", false); put("v2.cancelThreatHuntingJob", false); put("v2.convertJobResultToSignal", false); put("v2.deleteThreatHuntingJob", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java index 5143d6939ab..656c03e98a7 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java @@ -23,6 +23,7 @@ import com.datadog.api.client.v2.model.ProjectResponse; import com.datadog.api.client.v2.model.ProjectsResponse; import com.datadog.api.client.v2.model.TimelineResponse; +import com.datadog.api.client.v2.model.WatchersResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -1627,6 +1628,160 @@ public CompletableFuture> getProjectsWithHttpInfoA new GenericType() {}); } + /** + * Get case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return WatchersResponse + * @throws ApiException if fails to make API call + */ + public WatchersResponse listCaseWatchers(String caseId) throws ApiException { + return listCaseWatchersWithHttpInfo(caseId).getData(); + } + + /** + * Get case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<WatchersResponse> + */ + public CompletableFuture listCaseWatchersAsync(String caseId) { + return listCaseWatchersWithHttpInfoAsync(caseId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all users watching a case + * + * @param caseId Case's UUID or key (required) + * @return ApiResponse<WatchersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse listCaseWatchersWithHttpInfo(String caseId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listCaseWatchers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseWatchers"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseWatchers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get case watchers. + * + *

See {@link #listCaseWatchersWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @return CompletableFuture<ApiResponse<WatchersResponse>> + */ + public CompletableFuture> listCaseWatchersWithHttpInfoAsync( + String caseId) { + // Check if unstable operation is enabled + String operationId = "listCaseWatchers"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling listCaseWatchers")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listCaseWatchers", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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() {}); + } + /** Manage optional parameters to searchCases. */ public static class SearchCasesOptionalParameters { private Long pageSize; @@ -2226,6 +2381,180 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn new GenericType() {}); } + /** + * Remove user as watcher. + * + *

See {@link #unwatchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @throws ApiException if fails to make API call + */ + public void unwatchCase(String caseId, String userId) throws ApiException { + unwatchCaseWithHttpInfo(caseId, userId); + } + + /** + * Remove user as watcher. + * + *

See {@link #unwatchCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return CompletableFuture + */ + public CompletableFuture unwatchCaseAsync(String caseId, String userId) { + return unwatchCaseWithHttpInfoAsync(caseId, userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a user from the watchers list for a case + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse unwatchCaseWithHttpInfo(String caseId, String userId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "unwatchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling unwatchCase"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException( + 400, "Missing the required parameter 'userId' when calling unwatchCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unwatchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Remove user as watcher. + * + *

See {@link #unwatchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unwatchCaseWithHttpInfoAsync( + String caseId, String userId) { + // Check if unstable operation is enabled + String operationId = "unwatchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'caseId' when calling unwatchCase")); + return result; + } + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'userId' when calling unwatchCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unwatchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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); + } + /** * Update case attributes. * @@ -3204,4 +3533,173 @@ public CompletableFuture> updateStatusWithHttpInfoAsyn false, new GenericType() {}); } + + /** + * Add user as watcher. + * + *

See {@link #watchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @throws ApiException if fails to make API call + */ + public void watchCase(String caseId, String userId) throws ApiException { + watchCaseWithHttpInfo(caseId, userId); + } + + /** + * Add user as watcher. + * + *

See {@link #watchCaseWithHttpInfoAsync}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return CompletableFuture + */ + public CompletableFuture watchCaseAsync(String caseId, String userId) { + return watchCaseWithHttpInfoAsync(caseId, userId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Add a user as a watcher for a case + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse watchCaseWithHttpInfo(String caseId, String userId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "watchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException(400, "Missing the required parameter 'caseId' when calling watchCase"); + } + + // verify the required parameter 'userId' is set + if (userId == null) { + throw new ApiException(400, "Missing the required parameter 'userId' when calling watchCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.watchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Add user as watcher. + * + *

See {@link #watchCaseWithHttpInfo}. + * + * @param caseId Case's UUID or key (required) + * @param userId User UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> watchCaseWithHttpInfoAsync( + String caseId, String userId) { + // Check if unstable operation is enabled + String operationId = "watchCase"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling watchCase")); + return result; + } + + // verify the required parameter 'userId' is set + if (userId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'userId' when calling watchCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/cases/{case_id}/watchers/{user_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())) + .replaceAll("\\{" + "user_id" + "\\}", apiClient.escapeString(userId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.watchCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/Watcher.java b/src/main/java/com/datadog/api/client/v2/model/Watcher.java new file mode 100644 index 00000000000..8c11158df98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Watcher.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Case watcher */ +@JsonPropertyOrder({ + Watcher.JSON_PROPERTY_ID, + Watcher.JSON_PROPERTY_RELATIONSHIPS, + Watcher.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Watcher { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private WatcherRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WatcherResourceType type; + + public Watcher() {} + + @JsonCreator + public Watcher( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + WatcherRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) WatcherResourceType type) { + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public Watcher id(String id) { + this.id = id; + return this; + } + + /** + * User UUID of the watcher + * + * @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 Watcher relationships(WatcherRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Watcher relationships + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WatcherRelationships getRelationships() { + return relationships; + } + + public void setRelationships(WatcherRelationships relationships) { + this.relationships = relationships; + } + + public Watcher type(WatcherResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Watcher resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WatcherResourceType getType() { + return type; + } + + public void setType(WatcherResourceType 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 Watcher + */ + @JsonAnySetter + public Watcher 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 Watcher object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Watcher watcher = (Watcher) o; + return Objects.equals(this.id, watcher.id) + && Objects.equals(this.relationships, watcher.relationships) + && Objects.equals(this.type, watcher.type) + && Objects.equals(this.additionalProperties, watcher.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Watcher {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).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/WatcherRelationships.java b/src/main/java/com/datadog/api/client/v2/model/WatcherRelationships.java new file mode 100644 index 00000000000..4850898dca5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WatcherRelationships.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; + +/** Watcher relationships */ +@JsonPropertyOrder({WatcherRelationships.JSON_PROPERTY_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WatcherRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_USER = "user"; + private WatcherUserRelationship user; + + public WatcherRelationships() {} + + @JsonCreator + public WatcherRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_USER) WatcherUserRelationship user) { + this.user = user; + this.unparsed |= user.unparsed; + } + + public WatcherRelationships user(WatcherUserRelationship user) { + this.user = user; + this.unparsed |= user.unparsed; + return this; + } + + /** + * Relationship to user + * + * @return user + */ + @JsonProperty(JSON_PROPERTY_USER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WatcherUserRelationship getUser() { + return user; + } + + public void setUser(WatcherUserRelationship user) { + this.user = user; + } + + /** + * 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 WatcherRelationships + */ + @JsonAnySetter + public WatcherRelationships 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 WatcherRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatcherRelationships watcherRelationships = (WatcherRelationships) o; + return Objects.equals(this.user, watcherRelationships.user) + && Objects.equals(this.additionalProperties, watcherRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(user, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatcherRelationships {\n"); + sb.append(" user: ").append(toIndentedString(user)).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/WatcherResourceType.java b/src/main/java/com/datadog/api/client/v2/model/WatcherResourceType.java new file mode 100644 index 00000000000..d0814205c78 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WatcherResourceType.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** Watcher resource type */ +@JsonSerialize(using = WatcherResourceType.WatcherResourceTypeSerializer.class) +public class WatcherResourceType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("watcher")); + + public static final WatcherResourceType WATCHER = new WatcherResourceType("watcher"); + + WatcherResourceType(String value) { + super(value, allowedValues); + } + + public static class WatcherResourceTypeSerializer extends StdSerializer { + public WatcherResourceTypeSerializer(Class t) { + super(t); + } + + public WatcherResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + WatcherResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WatcherResourceType fromValue(String value) { + return new WatcherResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WatcherUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/WatcherUserRelationship.java new file mode 100644 index 00000000000..c1e1e582a2a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WatcherUserRelationship.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; + +/** Relationship to user */ +@JsonPropertyOrder({WatcherUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WatcherUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserRelationshipData data; + + public WatcherUserRelationship() {} + + @JsonCreator + public WatcherUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public WatcherUserRelationship data(UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship to user object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UserRelationshipData getData() { + return data; + } + + public void setData(UserRelationshipData 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 WatcherUserRelationship + */ + @JsonAnySetter + public WatcherUserRelationship 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 WatcherUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatcherUserRelationship watcherUserRelationship = (WatcherUserRelationship) o; + return Objects.equals(this.data, watcherUserRelationship.data) + && Objects.equals(this.additionalProperties, watcherUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatcherUserRelationship {\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/WatchersResponse.java b/src/main/java/com/datadog/api/client/v2/model/WatchersResponse.java new file mode 100644 index 00000000000..952c0de0214 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WatchersResponse.java @@ -0,0 +1,154 @@ +/* + * 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 case watchers */ +@JsonPropertyOrder({WatchersResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WatchersResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public WatchersResponse() {} + + @JsonCreator + public WatchersResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public WatchersResponse data(List data) { + this.data = data; + for (Watcher item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public WatchersResponse addDataItem(Watcher dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of watchers + * + * @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 WatchersResponse + */ + @JsonAnySetter + public WatchersResponse 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 WatchersResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WatchersResponse watchersResponse = (WatchersResponse) o; + return Objects.equals(this.data, watchersResponse.data) + && Objects.equals(this.additionalProperties, watchersResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WatchersResponse {\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/case_management.feature b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature index 2f239155671..4f3de0519bd 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/case_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/case_management.feature @@ -10,6 +10,33 @@ Feature: Case Management And a valid "appKeyAuth" key in the system And an instance of "CaseManagement" API + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Bad Request" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Created" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/case-management + Scenario: Add user as watcher returns "Not Found" response + Given operation "WatchCase" enabled + And new "WatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/case-management Scenario: Archive case returns "Bad Request" response Given new "ArchiveCase" request @@ -203,6 +230,30 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "Bad Request" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "Not Found" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/case-management + Scenario: Get case watchers returns "OK" response + Given operation "ListCaseWatchers" enabled + And new "ListCaseWatchers" request + And request contains "case_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip @team:DataDog/case-management Scenario: Get the details of a case returns "Bad Request" response Given new "GetCase" request @@ -261,6 +312,33 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "Bad Request" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "No Content" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/case-management + Scenario: Remove user as watcher returns "Not Found" response + Given operation "UnwatchCase" enabled + And new "UnwatchCase" request + And request contains "case_id" parameter from "REPLACE.ME" + And request contains "user_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/case-management Scenario: Search cases returns "Bad Request" response Given new "SearchCases" request 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 5a347bddf11..6e3e67d08e9 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 @@ -819,6 +819,26 @@ "type": "idempotent" } }, + "ListCaseWatchers": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UnwatchCase": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "WatchCase": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "ListCatalogEntity": { "tag": "Software Catalog", "undo": {