Skip to content

Commit 081418a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document case management attributes endpoints (#3019)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3267658 commit 081418a

File tree

54 files changed

+1097
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1097
-110
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "dcf594e",
3-
"generated": "2025-07-31 09:56:59.725"
2+
"spec_repo_commit": "b75095c",
3+
"generated": "2025-07-31 10:47:40.935"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6891,14 +6891,16 @@ components:
68916891
- data
68926892
type: object
68936893
CaseAttributes:
6894-
description: Case attributes
6894+
description: Case resource attributes
68956895
properties:
68966896
archived_at:
68976897
description: Timestamp of when the case was archived
68986898
format: date-time
68996899
nullable: true
69006900
readOnly: true
69016901
type: string
6902+
attributes:
6903+
$ref: '#/components/schemas/CaseObjectAttributes'
69026904
closed_at:
69036905
description: Timestamp of when the case was closed
69046906
format: date-time
@@ -7003,6 +7005,13 @@ components:
70037005
required:
70047006
- data
70057007
type: object
7008+
CaseObjectAttributes:
7009+
additionalProperties:
7010+
items:
7011+
type: string
7012+
type: array
7013+
description: The definition of `CaseObjectAttributes` object.
7014+
type: object
70067015
CasePriority:
70077016
default: NOT_DEFINED
70087017
description: Case priority
@@ -7098,6 +7107,33 @@ components:
70987107
type: string
70997108
x-enum-varnames:
71007109
- STANDARD
7110+
CaseUpdateAttributes:
7111+
description: Case update attributes
7112+
properties:
7113+
attributes:
7114+
$ref: '#/components/schemas/CaseUpdateAttributesAttributes'
7115+
type:
7116+
$ref: '#/components/schemas/CaseResourceType'
7117+
required:
7118+
- attributes
7119+
- type
7120+
type: object
7121+
CaseUpdateAttributesAttributes:
7122+
description: Case update attributes attributes
7123+
properties:
7124+
attributes:
7125+
$ref: '#/components/schemas/CaseObjectAttributes'
7126+
required:
7127+
- attributes
7128+
type: object
7129+
CaseUpdateAttributesRequest:
7130+
description: Case update attributes request
7131+
properties:
7132+
data:
7133+
$ref: '#/components/schemas/CaseUpdateAttributes'
7134+
required:
7135+
- data
7136+
type: object
71017137
CaseUpdatePriority:
71027138
description: Case priority status
71037139
properties:
@@ -45579,6 +45615,44 @@ paths:
4557945615
summary: Assign case
4558045616
tags:
4558145617
- Case Management
45618+
/api/v2/cases/{case_id}/attributes:
45619+
post:
45620+
description: Update case attributes
45621+
operationId: UpdateAttributes
45622+
parameters:
45623+
- $ref: '#/components/parameters/CaseIDPathParameter'
45624+
requestBody:
45625+
content:
45626+
application/json:
45627+
schema:
45628+
$ref: '#/components/schemas/CaseUpdateAttributesRequest'
45629+
description: Case attributes update payload
45630+
required: true
45631+
responses:
45632+
'200':
45633+
content:
45634+
application/json:
45635+
schema:
45636+
$ref: '#/components/schemas/CaseResponse'
45637+
description: OK
45638+
'400':
45639+
$ref: '#/components/responses/BadRequestResponse'
45640+
'401':
45641+
$ref: '#/components/responses/UnauthorizedResponse'
45642+
'403':
45643+
$ref: '#/components/responses/ForbiddenResponse'
45644+
'404':
45645+
$ref: '#/components/responses/NotFoundResponse'
45646+
'429':
45647+
$ref: '#/components/responses/TooManyRequestsResponse'
45648+
security:
45649+
- apiKeyAuth: []
45650+
appKeyAuth: []
45651+
- AuthZ:
45652+
- cases_write
45653+
summary: Update case attributes
45654+
tags:
45655+
- Case Management
4558245656
/api/v2/cases/{case_id}/priority:
4558345657
post:
4558445658
description: Update case priority
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Update case attributes returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.CaseManagementApi;
6+
import com.datadog.api.client.v2.model.CaseResourceType;
7+
import com.datadog.api.client.v2.model.CaseResponse;
8+
import com.datadog.api.client.v2.model.CaseUpdateAttributes;
9+
import com.datadog.api.client.v2.model.CaseUpdateAttributesAttributes;
10+
import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest;
11+
import java.util.Arrays;
12+
import java.util.Collections;
13+
import java.util.Map;
14+
15+
public class Example {
16+
public static void main(String[] args) {
17+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
18+
CaseManagementApi apiInstance = new CaseManagementApi(defaultClient);
19+
20+
// there is a valid "case" in the system
21+
String CASE_ID = System.getenv("CASE_ID");
22+
23+
CaseUpdateAttributesRequest body =
24+
new CaseUpdateAttributesRequest()
25+
.data(
26+
new CaseUpdateAttributes()
27+
.attributes(
28+
new CaseUpdateAttributesAttributes()
29+
.attributes(
30+
Map.ofEntries(
31+
Map.entry("env", Collections.singletonList("test")),
32+
Map.entry("service", Arrays.asList("web-store", "web-api")),
33+
Map.entry("team", Collections.singletonList("engineer")))))
34+
.type(CaseResourceType.CASE));
35+
36+
try {
37+
CaseResponse result = apiInstance.updateAttributes(CASE_ID, body);
38+
System.out.println(result);
39+
} catch (ApiException e) {
40+
System.err.println("Exception when calling CaseManagementApi#updateAttributes");
41+
System.err.println("Status code: " + e.getCode());
42+
System.err.println("Reason: " + e.getResponseBody());
43+
System.err.println("Response headers: " + e.getResponseHeaders());
44+
e.printStackTrace();
45+
}
46+
}
47+
}

src/main/java/com/datadog/api/client/v2/api/CaseManagementApi.java

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.datadog.api.client.v2.model.CaseEmptyRequest;
1212
import com.datadog.api.client.v2.model.CaseResponse;
1313
import com.datadog.api.client.v2.model.CaseSortableField;
14+
import com.datadog.api.client.v2.model.CaseUpdateAttributesRequest;
1415
import com.datadog.api.client.v2.model.CaseUpdatePriorityRequest;
1516
import com.datadog.api.client.v2.model.CaseUpdateStatusRequest;
1617
import com.datadog.api.client.v2.model.CasesResponse;
@@ -1740,6 +1741,164 @@ public CompletableFuture<ApiResponse<CaseResponse>> unassignCaseWithHttpInfoAsyn
17401741
new GenericType<CaseResponse>() {});
17411742
}
17421743

1744+
/**
1745+
* Update case attributes.
1746+
*
1747+
* <p>See {@link #updateAttributesWithHttpInfo}.
1748+
*
1749+
* @param caseId Case's UUID or key (required)
1750+
* @param body Case attributes update payload (required)
1751+
* @return CaseResponse
1752+
* @throws ApiException if fails to make API call
1753+
*/
1754+
public CaseResponse updateAttributes(String caseId, CaseUpdateAttributesRequest body)
1755+
throws ApiException {
1756+
return updateAttributesWithHttpInfo(caseId, body).getData();
1757+
}
1758+
1759+
/**
1760+
* Update case attributes.
1761+
*
1762+
* <p>See {@link #updateAttributesWithHttpInfoAsync}.
1763+
*
1764+
* @param caseId Case's UUID or key (required)
1765+
* @param body Case attributes update payload (required)
1766+
* @return CompletableFuture&lt;CaseResponse&gt;
1767+
*/
1768+
public CompletableFuture<CaseResponse> updateAttributesAsync(
1769+
String caseId, CaseUpdateAttributesRequest body) {
1770+
return updateAttributesWithHttpInfoAsync(caseId, body)
1771+
.thenApply(
1772+
response -> {
1773+
return response.getData();
1774+
});
1775+
}
1776+
1777+
/**
1778+
* Update case attributes
1779+
*
1780+
* @param caseId Case's UUID or key (required)
1781+
* @param body Case attributes update payload (required)
1782+
* @return ApiResponse&lt;CaseResponse&gt;
1783+
* @throws ApiException if fails to make API call
1784+
* @http.response.details
1785+
* <table border="1">
1786+
* <caption>Response details</caption>
1787+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1788+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
1789+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
1790+
* <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr>
1791+
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
1792+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
1793+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
1794+
* </table>
1795+
*/
1796+
public ApiResponse<CaseResponse> updateAttributesWithHttpInfo(
1797+
String caseId, CaseUpdateAttributesRequest body) throws ApiException {
1798+
Object localVarPostBody = body;
1799+
1800+
// verify the required parameter 'caseId' is set
1801+
if (caseId == null) {
1802+
throw new ApiException(
1803+
400, "Missing the required parameter 'caseId' when calling updateAttributes");
1804+
}
1805+
1806+
// verify the required parameter 'body' is set
1807+
if (body == null) {
1808+
throw new ApiException(
1809+
400, "Missing the required parameter 'body' when calling updateAttributes");
1810+
}
1811+
// create path and map variables
1812+
String localVarPath =
1813+
"/api/v2/cases/{case_id}/attributes"
1814+
.replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString()));
1815+
1816+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1817+
1818+
Invocation.Builder builder =
1819+
apiClient.createBuilder(
1820+
"v2.CaseManagementApi.updateAttributes",
1821+
localVarPath,
1822+
new ArrayList<Pair>(),
1823+
localVarHeaderParams,
1824+
new HashMap<String, String>(),
1825+
new String[] {"application/json"},
1826+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1827+
return apiClient.invokeAPI(
1828+
"POST",
1829+
builder,
1830+
localVarHeaderParams,
1831+
new String[] {"application/json"},
1832+
localVarPostBody,
1833+
new HashMap<String, Object>(),
1834+
false,
1835+
new GenericType<CaseResponse>() {});
1836+
}
1837+
1838+
/**
1839+
* Update case attributes.
1840+
*
1841+
* <p>See {@link #updateAttributesWithHttpInfo}.
1842+
*
1843+
* @param caseId Case's UUID or key (required)
1844+
* @param body Case attributes update payload (required)
1845+
* @return CompletableFuture&lt;ApiResponse&lt;CaseResponse&gt;&gt;
1846+
*/
1847+
public CompletableFuture<ApiResponse<CaseResponse>> updateAttributesWithHttpInfoAsync(
1848+
String caseId, CaseUpdateAttributesRequest body) {
1849+
Object localVarPostBody = body;
1850+
1851+
// verify the required parameter 'caseId' is set
1852+
if (caseId == null) {
1853+
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
1854+
result.completeExceptionally(
1855+
new ApiException(
1856+
400, "Missing the required parameter 'caseId' when calling updateAttributes"));
1857+
return result;
1858+
}
1859+
1860+
// verify the required parameter 'body' is set
1861+
if (body == null) {
1862+
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
1863+
result.completeExceptionally(
1864+
new ApiException(
1865+
400, "Missing the required parameter 'body' when calling updateAttributes"));
1866+
return result;
1867+
}
1868+
// create path and map variables
1869+
String localVarPath =
1870+
"/api/v2/cases/{case_id}/attributes"
1871+
.replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString()));
1872+
1873+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1874+
1875+
Invocation.Builder builder;
1876+
try {
1877+
builder =
1878+
apiClient.createBuilder(
1879+
"v2.CaseManagementApi.updateAttributes",
1880+
localVarPath,
1881+
new ArrayList<Pair>(),
1882+
localVarHeaderParams,
1883+
new HashMap<String, String>(),
1884+
new String[] {"application/json"},
1885+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
1886+
} catch (ApiException ex) {
1887+
CompletableFuture<ApiResponse<CaseResponse>> result = new CompletableFuture<>();
1888+
result.completeExceptionally(ex);
1889+
return result;
1890+
}
1891+
return apiClient.invokeAPIAsync(
1892+
"POST",
1893+
builder,
1894+
localVarHeaderParams,
1895+
new String[] {"application/json"},
1896+
localVarPostBody,
1897+
new HashMap<String, Object>(),
1898+
false,
1899+
new GenericType<CaseResponse>() {});
1900+
}
1901+
17431902
/**
17441903
* Update case priority.
17451904
*

src/main/java/com/datadog/api/client/v2/model/Case.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public Case attributes(CaseAttributes attributes) {
6161
}
6262

6363
/**
64-
* Case attributes
64+
* Case resource attributes
6565
*
6666
* @return attributes
6767
*/

0 commit comments

Comments
 (0)