From 42fea309e183af7f5930daf61d777985fad5348d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 28 Jan 2026 10:51:26 +0000 Subject: [PATCH] Regenerate client from commit c96d162 of spec repo --- .generator/schemas/v2/openapi.yaml | 184 ++++++++ .../v2/case-management/FavoriteProject.java | 23 + .../ListUserProjectFavorites.java | 25 + .../v2/case-management/UnfavoriteProject.java | 23 + .../com/datadog/api/client/ApiClient.java | 3 + .../api/client/v2/api/CaseManagementApi.java | 433 ++++++++++++++++++ .../api/client/v2/model/ProjectFavorite.java | 209 +++++++++ .../model/ProjectFavoriteRelationships.java | 147 ++++++ .../v2/model/ProjectFavoriteResourceType.java | 57 +++ .../ProjectFavoriteUserRelationship.java | 147 ++++++ .../v2/model/ProjectFavoritesResponse.java | 154 +++++++ .../api/client/v2/api/case_management.feature | 62 +++ .../com/datadog/api/client/v2/api/undo.json | 20 + 13 files changed, 1487 insertions(+) create mode 100644 examples/v2/case-management/FavoriteProject.java create mode 100644 examples/v2/case-management/ListUserProjectFavorites.java create mode 100644 examples/v2/case-management/UnfavoriteProject.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteRelationships.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteUserRelationship.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5423824d0a6..c356f73bbfd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44827,6 +44827,57 @@ components: required: - data type: object + ProjectFavorite: + description: Project favorite + properties: + id: + description: The project's identifier + example: d4bbe1af-f36e-42f1-87c1-493ca35c320e + type: string + relationships: + $ref: '#/components/schemas/ProjectFavoriteRelationships' + type: + $ref: '#/components/schemas/ProjectFavoriteResourceType' + required: + - id + - type + - relationships + type: object + ProjectFavoriteRelationships: + description: Project favorite relationships + properties: + user: + $ref: '#/components/schemas/ProjectFavoriteUserRelationship' + required: + - user + type: object + ProjectFavoriteResourceType: + description: Project favorite resource type + enum: + - project_favorite + example: project_favorite + type: string + x-enum-varnames: + - PROJECT_FAVORITE + ProjectFavoriteUserRelationship: + description: Relationship to user + properties: + data: + $ref: '#/components/schemas/UserRelationshipData' + required: + - data + type: object + ProjectFavoritesResponse: + description: Response with project favorites + properties: + data: + description: Array of project favorites + items: + $ref: '#/components/schemas/ProjectFavorite' + type: array + required: + - data + type: object ProjectRelationship: description: Relationship to project properties: @@ -85757,6 +85808,139 @@ paths: tags: - Rum Audience Management x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/projects/favorites: + get: + description: Get all projects marked as favorite by the current user + operationId: ListUserProjectFavorites + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ProjectFavoritesResponse' + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cases_read + summary: Get user's project favorites + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/projects/{project_id}/favorites: + delete: + description: Remove a project from the current user's favorites + operationId: UnfavoriteProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + 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 project from favorites + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Add a project to the current user's favorites + operationId: FavoriteProject + parameters: + - $ref: '#/components/parameters/ProjectIDPathParameter' + 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: Add project to favorites + tags: + - Case Management + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/query/scalar: post: description: 'Query scalar values (as seen on Query Value, Table, and Toplist diff --git a/examples/v2/case-management/FavoriteProject.java b/examples/v2/case-management/FavoriteProject.java new file mode 100644 index 00000000000..6bee741bb2d --- /dev/null +++ b/examples/v2/case-management/FavoriteProject.java @@ -0,0 +1,23 @@ +// Add project to favorites 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.favoriteProject", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.favoriteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#favoriteProject"); + 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/ListUserProjectFavorites.java b/examples/v2/case-management/ListUserProjectFavorites.java new file mode 100644 index 00000000000..9e18fcf89a7 --- /dev/null +++ b/examples/v2/case-management/ListUserProjectFavorites.java @@ -0,0 +1,25 @@ +// Get user's project favorites 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.ProjectFavoritesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listUserProjectFavorites", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + ProjectFavoritesResponse result = apiInstance.listUserProjectFavorites(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#listUserProjectFavorites"); + 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/UnfavoriteProject.java b/examples/v2/case-management/UnfavoriteProject.java new file mode 100644 index 00000000000..3b1594a7898 --- /dev/null +++ b/examples/v2/case-management/UnfavoriteProject.java @@ -0,0 +1,23 @@ +// Remove project from favorites 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.unfavoriteProject", true); + CaseManagementApi apiInstance = new CaseManagementApi(defaultClient); + + try { + apiInstance.unfavoriteProject("e555e290-ed65-49bd-ae18-8acbfcf18db7"); + } catch (ApiException e) { + System.err.println("Exception when calling CaseManagementApi#unfavoriteProject"); + 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..ca092c7a620 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.favoriteProject", false); + put("v2.listUserProjectFavorites", false); + put("v2.unfavoriteProject", 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..380cc22a18a 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 @@ -20,6 +20,7 @@ import com.datadog.api.client.v2.model.CaseUpdateTitleRequest; import com.datadog.api.client.v2.model.CasesResponse; import com.datadog.api.client.v2.model.ProjectCreateRequest; +import com.datadog.api.client.v2.model.ProjectFavoritesResponse; import com.datadog.api.client.v2.model.ProjectResponse; import com.datadog.api.client.v2.model.ProjectsResponse; import com.datadog.api.client.v2.model.TimelineResponse; @@ -1246,6 +1247,157 @@ public CompletableFuture> deleteProjectWithHttpInfoAsync(Strin null); } + /** + * Add project to favorites. + * + *

See {@link #favoriteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @throws ApiException if fails to make API call + */ + public void favoriteProject(String projectId) throws ApiException { + favoriteProjectWithHttpInfo(projectId); + } + + /** + * Add project to favorites. + * + *

See {@link #favoriteProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture + */ + public CompletableFuture favoriteProjectAsync(String projectId) { + return favoriteProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Add a project to the current user's favorites + * + * @param projectId Project 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 favoriteProjectWithHttpInfo(String projectId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "favoriteProject"; + 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 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling favoriteProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.favoriteProject", + 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 project to favorites. + * + *

See {@link #favoriteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> favoriteProjectWithHttpInfoAsync(String projectId) { + // Check if unstable operation is enabled + String operationId = "favoriteProject"; + 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 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling favoriteProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.favoriteProject", + 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); + } + /** * Get the details of a case. * @@ -1627,6 +1779,136 @@ public CompletableFuture> getProjectsWithHttpInfoA new GenericType() {}); } + /** + * Get user's project favorites. + * + *

See {@link #listUserProjectFavoritesWithHttpInfo}. + * + * @return ProjectFavoritesResponse + * @throws ApiException if fails to make API call + */ + public ProjectFavoritesResponse listUserProjectFavorites() throws ApiException { + return listUserProjectFavoritesWithHttpInfo().getData(); + } + + /** + * Get user's project favorites. + * + *

See {@link #listUserProjectFavoritesWithHttpInfoAsync}. + * + * @return CompletableFuture<ProjectFavoritesResponse> + */ + public CompletableFuture listUserProjectFavoritesAsync() { + return listUserProjectFavoritesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all projects marked as favorite by the current user + * + * @return ApiResponse<ProjectFavoritesResponse> + * @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 -
429 Too many requests -
+ */ + public ApiResponse listUserProjectFavoritesWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listUserProjectFavorites"; + 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; + // create path and map variables + String localVarPath = "/api/v2/projects/favorites"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listUserProjectFavorites", + 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 user's project favorites. + * + *

See {@link #listUserProjectFavoritesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<ProjectFavoritesResponse>> + */ + public CompletableFuture> + listUserProjectFavoritesWithHttpInfoAsync() { + // Check if unstable operation is enabled + String operationId = "listUserProjectFavorites"; + 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; + // create path and map variables + String localVarPath = "/api/v2/projects/favorites"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.listUserProjectFavorites", + 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 +2508,157 @@ public CompletableFuture> unassignCaseWithHttpInfoAsyn new GenericType() {}); } + /** + * Remove project from favorites. + * + *

See {@link #unfavoriteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @throws ApiException if fails to make API call + */ + public void unfavoriteProject(String projectId) throws ApiException { + unfavoriteProjectWithHttpInfo(projectId); + } + + /** + * Remove project from favorites. + * + *

See {@link #unfavoriteProjectWithHttpInfoAsync}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture + */ + public CompletableFuture unfavoriteProjectAsync(String projectId) { + return unfavoriteProjectWithHttpInfoAsync(projectId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Remove a project from the current user's favorites + * + * @param projectId Project 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 unfavoriteProjectWithHttpInfo(String projectId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "unfavoriteProject"; + 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 'projectId' is set + if (projectId == null) { + throw new ApiException( + 400, "Missing the required parameter 'projectId' when calling unfavoriteProject"); + } + // create path and map variables + String localVarPath = + "/api/v2/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unfavoriteProject", + 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 project from favorites. + * + *

See {@link #unfavoriteProjectWithHttpInfo}. + * + * @param projectId Project UUID (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> unfavoriteProjectWithHttpInfoAsync(String projectId) { + // Check if unstable operation is enabled + String operationId = "unfavoriteProject"; + 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 'projectId' is set + if (projectId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'projectId' when calling unfavoriteProject")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/projects/{project_id}/favorites" + .replaceAll("\\{" + "project_id" + "\\}", apiClient.escapeString(projectId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CaseManagementApi.unfavoriteProject", + 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. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.java new file mode 100644 index 00000000000..2959565b033 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavorite.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; + +/** Project favorite */ +@JsonPropertyOrder({ + ProjectFavorite.JSON_PROPERTY_ID, + ProjectFavorite.JSON_PROPERTY_RELATIONSHIPS, + ProjectFavorite.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavorite { + @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 ProjectFavoriteRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ProjectFavoriteResourceType type; + + public ProjectFavorite() {} + + @JsonCreator + public ProjectFavorite( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_RELATIONSHIPS) + ProjectFavoriteRelationships relationships, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ProjectFavoriteResourceType type) { + this.id = id; + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ProjectFavorite id(String id) { + this.id = id; + return this; + } + + /** + * The project's identifier + * + * @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 ProjectFavorite relationships(ProjectFavoriteRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Project favorite relationships + * + * @return relationships + */ + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectFavoriteRelationships getRelationships() { + return relationships; + } + + public void setRelationships(ProjectFavoriteRelationships relationships) { + this.relationships = relationships; + } + + public ProjectFavorite type(ProjectFavoriteResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Project favorite resource type + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ProjectFavoriteResourceType getType() { + return type; + } + + public void setType(ProjectFavoriteResourceType 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 ProjectFavorite + */ + @JsonAnySetter + public ProjectFavorite 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 ProjectFavorite object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavorite projectFavorite = (ProjectFavorite) o; + return Objects.equals(this.id, projectFavorite.id) + && Objects.equals(this.relationships, projectFavorite.relationships) + && Objects.equals(this.type, projectFavorite.type) + && Objects.equals(this.additionalProperties, projectFavorite.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavorite {\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/ProjectFavoriteRelationships.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteRelationships.java new file mode 100644 index 00000000000..f4de7369ddf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteRelationships.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Project favorite relationships */ +@JsonPropertyOrder({ProjectFavoriteRelationships.JSON_PROPERTY_USER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavoriteRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_USER = "user"; + private ProjectFavoriteUserRelationship user; + + public ProjectFavoriteRelationships() {} + + @JsonCreator + public ProjectFavoriteRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_USER) + ProjectFavoriteUserRelationship user) { + this.user = user; + this.unparsed |= user.unparsed; + } + + public ProjectFavoriteRelationships user(ProjectFavoriteUserRelationship 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 ProjectFavoriteUserRelationship getUser() { + return user; + } + + public void setUser(ProjectFavoriteUserRelationship 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 ProjectFavoriteRelationships + */ + @JsonAnySetter + public ProjectFavoriteRelationships 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 ProjectFavoriteRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavoriteRelationships projectFavoriteRelationships = (ProjectFavoriteRelationships) o; + return Objects.equals(this.user, projectFavoriteRelationships.user) + && Objects.equals( + this.additionalProperties, projectFavoriteRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(user, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavoriteRelationships {\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/ProjectFavoriteResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java new file mode 100644 index 00000000000..82b36bf6ac2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteResourceType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** Project favorite resource type */ +@JsonSerialize(using = ProjectFavoriteResourceType.ProjectFavoriteResourceTypeSerializer.class) +public class ProjectFavoriteResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("project_favorite")); + + public static final ProjectFavoriteResourceType PROJECT_FAVORITE = + new ProjectFavoriteResourceType("project_favorite"); + + ProjectFavoriteResourceType(String value) { + super(value, allowedValues); + } + + public static class ProjectFavoriteResourceTypeSerializer + extends StdSerializer { + public ProjectFavoriteResourceTypeSerializer(Class t) { + super(t); + } + + public ProjectFavoriteResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ProjectFavoriteResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ProjectFavoriteResourceType fromValue(String value) { + return new ProjectFavoriteResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteUserRelationship.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteUserRelationship.java new file mode 100644 index 00000000000..40750b5e5ca --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoriteUserRelationship.java @@ -0,0 +1,147 @@ +/* + * 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({ProjectFavoriteUserRelationship.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavoriteUserRelationship { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UserRelationshipData data; + + public ProjectFavoriteUserRelationship() {} + + @JsonCreator + public ProjectFavoriteUserRelationship( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) UserRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public ProjectFavoriteUserRelationship 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 ProjectFavoriteUserRelationship + */ + @JsonAnySetter + public ProjectFavoriteUserRelationship 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 ProjectFavoriteUserRelationship object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavoriteUserRelationship projectFavoriteUserRelationship = + (ProjectFavoriteUserRelationship) o; + return Objects.equals(this.data, projectFavoriteUserRelationship.data) + && Objects.equals( + this.additionalProperties, projectFavoriteUserRelationship.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavoriteUserRelationship {\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/ProjectFavoritesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.java new file mode 100644 index 00000000000..75e6801cf8a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ProjectFavoritesResponse.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 project favorites */ +@JsonPropertyOrder({ProjectFavoritesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ProjectFavoritesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public ProjectFavoritesResponse() {} + + @JsonCreator + public ProjectFavoritesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public ProjectFavoritesResponse data(List data) { + this.data = data; + for (ProjectFavorite item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ProjectFavoritesResponse addDataItem(ProjectFavorite dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Array of project favorites + * + * @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 ProjectFavoritesResponse + */ + @JsonAnySetter + public ProjectFavoritesResponse 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 ProjectFavoritesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProjectFavoritesResponse projectFavoritesResponse = (ProjectFavoritesResponse) o; + return Objects.equals(this.data, projectFavoritesResponse.data) + && Objects.equals(this.additionalProperties, projectFavoritesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProjectFavoritesResponse {\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..18f549d42ab 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,30 @@ 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 project to favorites returns "Bad Request" response + Given operation "FavoriteProject" enabled + And new "FavoriteProject" request + And request contains "project_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 project to favorites returns "No Content" response + Given operation "FavoriteProject" enabled + And new "FavoriteProject" request + And request contains "project_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: Add project to favorites returns "Not Found" response + Given operation "FavoriteProject" enabled + And new "FavoriteProject" request + And request contains "project_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 @@ -247,6 +271,20 @@ Feature: Case Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/case-management + Scenario: Get user's project favorites returns "Bad Request" response + Given operation "ListUserProjectFavorites" enabled + And new "ListUserProjectFavorites" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/case-management + Scenario: Get user's project favorites returns "OK" response + Given operation "ListUserProjectFavorites" enabled + And new "ListUserProjectFavorites" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/case-management Scenario: Remove a project returns "API error response" response Given new "DeleteProject" request @@ -261,6 +299,30 @@ Feature: Case Management When the request is sent Then the response status is 204 No Content + @generated @skip @team:DataDog/case-management + Scenario: Remove project from favorites returns "Bad Request" response + Given operation "UnfavoriteProject" enabled + And new "UnfavoriteProject" request + And request contains "project_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 project from favorites returns "No Content" response + Given operation "UnfavoriteProject" enabled + And new "UnfavoriteProject" request + And request contains "project_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 project from favorites returns "Not Found" response + Given operation "UnfavoriteProject" enabled + And new "UnfavoriteProject" request + And request contains "project_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..17f4c6d172c 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 @@ -3445,6 +3445,26 @@ "type": "safe" } }, + "ListUserProjectFavorites": { + "tag": "Case Management", + "undo": { + "type": "safe" + } + }, + "UnfavoriteProject": { + "tag": "Case Management", + "undo": { + "type": "idempotent" + } + }, + "FavoriteProject": { + "tag": "Case Management", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "QueryScalarData": { "tag": "Metrics", "undo": {