Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "dcf594e",
"generated": "2025-07-31 09:56:59.725"
"spec_repo_commit": "b75095c",
"generated": "2025-07-31 10:47:40.935"
}
76 changes: 75 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6891,14 +6891,16 @@ components:
- data
type: object
CaseAttributes:
description: Case attributes
description: Case resource attributes
properties:
archived_at:
description: Timestamp of when the case was archived
format: date-time
nullable: true
readOnly: true
type: string
attributes:
$ref: '#/components/schemas/CaseObjectAttributes'
closed_at:
description: Timestamp of when the case was closed
format: date-time
Expand Down Expand Up @@ -7003,6 +7005,13 @@ components:
required:
- data
type: object
CaseObjectAttributes:
additionalProperties:
items:
type: string
type: array
description: The definition of `CaseObjectAttributes` object.
type: object
CasePriority:
default: NOT_DEFINED
description: Case priority
Expand Down Expand Up @@ -7098,6 +7107,33 @@ components:
type: string
x-enum-varnames:
- STANDARD
CaseUpdateAttributes:
description: Case update attributes
properties:
attributes:
$ref: '#/components/schemas/CaseUpdateAttributesAttributes'
type:
$ref: '#/components/schemas/CaseResourceType'
required:
- attributes
- type
type: object
CaseUpdateAttributesAttributes:
description: Case update attributes attributes
properties:
attributes:
$ref: '#/components/schemas/CaseObjectAttributes'
required:
- attributes
type: object
CaseUpdateAttributesRequest:
description: Case update attributes request
properties:
data:
$ref: '#/components/schemas/CaseUpdateAttributes'
required:
- data
type: object
CaseUpdatePriority:
description: Case priority status
properties:
Expand Down Expand Up @@ -45579,6 +45615,44 @@ paths:
summary: Assign case
tags:
- Case Management
/api/v2/cases/{case_id}/attributes:
post:
description: Update case attributes
operationId: UpdateAttributes
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CaseUpdateAttributesRequest'
description: Case attributes update payload
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CaseResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Update case attributes
tags:
- Case Management
/api/v2/cases/{case_id}/priority:
post:
description: Update case priority
Expand Down
47 changes: 47 additions & 0 deletions examples/v2/case-management/UpdateAttributes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Update case attributes 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.CaseResourceType;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseUpdateAttributes;
import com.datadog.api.client.v2.model.CaseUpdateAttributesAttributes;
import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);

// there is a valid "case" in the system
String CASE_ID = System.getenv("CASE_ID");

CaseUpdateAttributesRequest body =
new CaseUpdateAttributesRequest()
.data(
new CaseUpdateAttributes()
.attributes(
new CaseUpdateAttributesAttributes()
.attributes(
Map.ofEntries(
Map.entry("env", Collections.singletonList("test")),
Map.entry("service", Arrays.asList("web-store", "web-api")),
Map.entry("team", Collections.singletonList("engineer")))))
.type(CaseResourceType.CASE));

try {
CaseResponse result = apiInstance.updateAttributes(CASE_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CaseManagementApi#updateAttributes");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
159 changes: 159 additions & 0 deletions src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.datadog.api.client.v2.model.CaseEmptyRequest;
import com.datadog.api.client.v2.model.CaseResponse;
import com.datadog.api.client.v2.model.CaseSortableField;
import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest;
import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest;
import com.datadog.api.client.v2.model.CaseUpdateStatusRequest;
import com.datadog.api.client.v2.model.CasesResponse;
Expand Down Expand Up @@ -1740,6 +1741,164 @@ public CompletableFuture<ApiResponse<CaseResponse>> unassignCaseWithHttpInfoAsyn
new GenericType<CaseResponse>() {});
}

/**
* Update case attributes.
*
* <p>See {@link #updateAttributesWithHttpInfo}.
*
* @param caseId Case's UUID or key (required)
* @param body Case attributes update payload (required)
* @return CaseResponse
* @throws ApiException if fails to make API call
*/
public CaseResponse updateAttributes(String caseId, CaseUpdateAttributesRequest body)
throws ApiException {
return updateAttributesWithHttpInfo(caseId, body).getData();
}

/**
* Update case attributes.
*
* <p>See {@link #updateAttributesWithHttpInfoAsync}.
*
* @param caseId Case's UUID or key (required)
* @param body Case attributes update payload (required)
* @return CompletableFuture&lt;CaseResponse&gt;
*/
public CompletableFuture<CaseResponse> updateAttributesAsync(
String caseId, CaseUpdateAttributesRequest body) {
return updateAttributesWithHttpInfoAsync(caseId, body)
.thenApply(
response -> {
return response.getData();
});
}

/**
* Update case attributes
*
* @param caseId Case's UUID or key (required)
* @param body Case attributes update payload (required)
* @return ApiResponse&lt;CaseResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* </table>
*/
public ApiResponse<CaseResponse> updateAttributesWithHttpInfo(
String caseId, CaseUpdateAttributesRequest body) throws ApiException {
Object localVarPostBody = body;

// verify the required parameter 'caseId' is set
if (caseId == null) {
throw new ApiException(
400, "Missing the required parameter 'caseId' when calling updateAttributes");
}

// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling updateAttributes");
}
// create path and map variables
String localVarPath =
"/api/v2/cases/{case_id}/attributes"
.replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder =
apiClient.createBuilder(
"v2.CaseManagementApi.updateAttributes",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CaseResponse>() {});
}

/**
* Update case attributes.
*
* <p>See {@link #updateAttributesWithHttpInfo}.
*
* @param caseId Case's UUID or key (required)
* @param body Case attributes update payload (required)
* @return CompletableFuture&lt;ApiResponse&lt;CaseResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<CaseResponse>> updateAttributesWithHttpInfoAsync(
String caseId, CaseUpdateAttributesRequest body) {
Object localVarPostBody = body;

// verify the required parameter 'caseId' is set
if (caseId == null) {
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'caseId' when calling updateAttributes"));
return result;
}

// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling updateAttributes"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/cases/{case_id}/attributes"
.replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString()));

Map<String, String> localVarHeaderParams = new HashMap<String, String>();

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.CaseManagementApi.updateAttributes",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CaseResponse>() {});
}

/**
* Update case priority.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/datadog/api/client/v2/model/Case.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public Case attributes(CaseAttributes attributes) {
}

/**
* Case attributes
* Case resource attributes
*
* @return attributes
*/
Expand Down
Loading