Skip to content

Commit a0ff54d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update /api/v2/cases endpoint to add custom attributes support (#3350)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 8b4a7b5 commit a0ff54d

File tree

47 files changed

+161
-116
lines changed

Some content is hidden

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

47 files changed

+161
-116
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9168,6 +9168,11 @@ components:
91689168
CaseCreateAttributes:
91699169
description: Case creation attributes
91709170
properties:
9171+
custom_attributes:
9172+
additionalProperties:
9173+
$ref: '#/components/schemas/CustomAttributeValue'
9174+
description: Case custom attributes
9175+
type: object
91719176
description:
91729177
description: Description
91739178
type: string
@@ -14712,30 +14717,32 @@ components:
1471214717
type: number
1471314718
type: array
1471414719
CustomAttributeMultiStringValue:
14715-
description: Value of multi TEXT/URL custom attribute
14720+
description: Value of multi TEXT/URL/SELECT custom attribute
1471614721
items:
14717-
description: TEXT/URL Value
14722+
description: TEXT/URL/SELECT Value
1471814723
type: string
1471914724
type: array
1472014725
CustomAttributeNumberValue:
1472114726
description: Value of NUMBER custom attribute
1472214727
format: double
1472314728
type: number
1472414729
CustomAttributeStringValue:
14725-
description: Value of TEXT/URL custom attribute
14730+
description: Value of TEXT/URL/SELECT custom attribute
1472614731
type: string
1472714732
CustomAttributeType:
1472814733
description: Custom attributes type
1472914734
enum:
1473014735
- URL
1473114736
- TEXT
1473214737
- NUMBER
14738+
- SELECT
1473314739
example: NUMBER
1473414740
type: string
1473514741
x-enum-varnames:
1473614742
- URL
1473714743
- TEXT
1473814744
- NUMBER
14745+
- SELECT
1473914746
CustomAttributeValue:
1474014747
description: Custom attribute values
1474114748
properties:

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/** Case creation attributes */
2121
@JsonPropertyOrder({
22+
CaseCreateAttributes.JSON_PROPERTY_CUSTOM_ATTRIBUTES,
2223
CaseCreateAttributes.JSON_PROPERTY_DESCRIPTION,
2324
CaseCreateAttributes.JSON_PROPERTY_PRIORITY,
2425
CaseCreateAttributes.JSON_PROPERTY_TITLE,
@@ -28,6 +29,9 @@
2829
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
2930
public class CaseCreateAttributes {
3031
@JsonIgnore public boolean unparsed = false;
32+
public static final String JSON_PROPERTY_CUSTOM_ATTRIBUTES = "custom_attributes";
33+
private Map<String, CustomAttributeValue> customAttributes = null;
34+
3135
public static final String JSON_PROPERTY_DESCRIPTION = "description";
3236
private String description;
3337

@@ -50,6 +54,36 @@ public CaseCreateAttributes(
5054
this.typeId = typeId;
5155
}
5256

57+
public CaseCreateAttributes customAttributes(Map<String, CustomAttributeValue> customAttributes) {
58+
this.customAttributes = customAttributes;
59+
return this;
60+
}
61+
62+
public CaseCreateAttributes putCustomAttributesItem(
63+
String key, CustomAttributeValue customAttributesItem) {
64+
if (this.customAttributes == null) {
65+
this.customAttributes = new HashMap<>();
66+
}
67+
this.customAttributes.put(key, customAttributesItem);
68+
return this;
69+
}
70+
71+
/**
72+
* Case custom attributes
73+
*
74+
* @return customAttributes
75+
*/
76+
@jakarta.annotation.Nullable
77+
@JsonProperty(JSON_PROPERTY_CUSTOM_ATTRIBUTES)
78+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
79+
public Map<String, CustomAttributeValue> getCustomAttributes() {
80+
return customAttributes;
81+
}
82+
83+
public void setCustomAttributes(Map<String, CustomAttributeValue> customAttributes) {
84+
this.customAttributes = customAttributes;
85+
}
86+
5387
public CaseCreateAttributes description(String description) {
5488
this.description = description;
5589
return this;
@@ -192,7 +226,8 @@ public boolean equals(Object o) {
192226
return false;
193227
}
194228
CaseCreateAttributes caseCreateAttributes = (CaseCreateAttributes) o;
195-
return Objects.equals(this.description, caseCreateAttributes.description)
229+
return Objects.equals(this.customAttributes, caseCreateAttributes.customAttributes)
230+
&& Objects.equals(this.description, caseCreateAttributes.description)
196231
&& Objects.equals(this.priority, caseCreateAttributes.priority)
197232
&& Objects.equals(this.title, caseCreateAttributes.title)
198233
&& Objects.equals(this.typeId, caseCreateAttributes.typeId)
@@ -201,13 +236,15 @@ public boolean equals(Object o) {
201236

202237
@Override
203238
public int hashCode() {
204-
return Objects.hash(description, priority, title, typeId, additionalProperties);
239+
return Objects.hash(
240+
customAttributes, description, priority, title, typeId, additionalProperties);
205241
}
206242

207243
@Override
208244
public String toString() {
209245
StringBuilder sb = new StringBuilder();
210246
sb.append("class CaseCreateAttributes {\n");
247+
sb.append(" customAttributes: ").append(toIndentedString(customAttributes)).append("\n");
211248
sb.append(" description: ").append(toIndentedString(description)).append("\n");
212249
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
213250
sb.append(" title: ").append(toIndentedString(title)).append("\n");

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
public class CustomAttributeType extends ModelEnum<String> {
2424

2525
private static final Set<String> allowedValues =
26-
new HashSet<String>(Arrays.asList("URL", "TEXT", "NUMBER"));
26+
new HashSet<String>(Arrays.asList("URL", "TEXT", "NUMBER", "SELECT"));
2727

2828
public static final CustomAttributeType URL = new CustomAttributeType("URL");
2929
public static final CustomAttributeType TEXT = new CustomAttributeType("TEXT");
3030
public static final CustomAttributeType NUMBER = new CustomAttributeType("NUMBER");
31+
public static final CustomAttributeType SELECT = new CustomAttributeType("SELECT");
3132

3233
CustomAttributeType(String value) {
3334
super(value, allowedValues);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-01T12:46:29.817Z
1+
2025-12-30T13:49:44.747Z

src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"data\":{\"id\":\"3601878d-b851-43b6-900f-0deb35e536d7\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-10-01T12:46:30.261735Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"3601878d-b851-43b6-900f-0deb35e536d7\",\"key\":\"DDFC-82968\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"83056\",\"status\":\"OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"[email protected]\",\"name\":\"frog\"}}]}",
15+
"body": "{\"data\":{\"id\":\"e3f011bc-8ae6-4ec2-b80d-3069e73bc6a1\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-12-30T13:49:45.033566Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"e3f011bc-8ae6-4ec2-b80d-3069e73bc6a1\",\"key\":\"DDFC-98805\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"99261\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/vnd.api+json"
@@ -37,7 +37,7 @@
3737
},
3838
"headers": {},
3939
"method": "POST",
40-
"path": "/api/v2/cases/3601878d-b851-43b6-900f-0deb35e536d7/archive",
40+
"path": "/api/v2/cases/e3f011bc-8ae6-4ec2-b80d-3069e73bc6a1/archive",
4141
"keepAlive": false,
4242
"secure": true
4343
},
@@ -57,6 +57,6 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "e1a10cf1-3e3c-c706-790a-1973ce7c87c7"
60+
"id": "ab7d7635-9dd8-75bc-f0cf-3417055b82d9"
6161
}
6262
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-01T12:46:31.029Z
1+
2025-12-30T13:49:45.212Z

src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"data\":{\"id\":\"b5cf9b44-cb77-4487-a436-0e3ef4e88d49\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-10-01T12:46:31.456149Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"b5cf9b44-cb77-4487-a436-0e3ef4e88d49\",\"key\":\"DDFC-82969\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"83057\",\"status\":\"OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"[email protected]\",\"name\":\"frog\"}}]}",
15+
"body": "{\"data\":{\"id\":\"926e6b8a-4af6-43b2-8a29-33813af68594\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-12-30T13:49:45.269528Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"926e6b8a-4af6-43b2-8a29-33813af68594\",\"key\":\"DDFC-98806\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"99262\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/vnd.api+json"
@@ -37,12 +37,12 @@
3737
},
3838
"headers": {},
3939
"method": "POST",
40-
"path": "/api/v2/cases/b5cf9b44-cb77-4487-a436-0e3ef4e88d49/archive",
40+
"path": "/api/v2/cases/926e6b8a-4af6-43b2-8a29-33813af68594/archive",
4141
"keepAlive": false,
4242
"secure": true
4343
},
4444
"httpResponse": {
45-
"body": "{\"data\":{\"id\":\"b5cf9b44-cb77-4487-a436-0e3ef4e88d49\",\"type\":\"case\",\"attributes\":{\"archived_at\":\"2025-10-01T12:46:31.920596976Z\",\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-10-01T12:46:31.456149Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"b5cf9b44-cb77-4487-a436-0e3ef4e88d49\",\"key\":\"DDFC-82969\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2025-10-01T12:46:31.920597Z\",\"priority\":\"P4\",\"public_id\":\"83057\",\"status\":\"OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"[email protected]\",\"name\":\"frog\"}}]}",
45+
"body": "{\"data\":{\"id\":\"926e6b8a-4af6-43b2-8a29-33813af68594\",\"type\":\"case\",\"attributes\":{\"archived_at\":\"2025-12-30T13:49:45.40368576Z\",\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-12-30T13:49:45.269528Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"926e6b8a-4af6-43b2-8a29-33813af68594\",\"key\":\"DDFC-98806\",\"merge_status\":\"NOT_MERGED\",\"modified_at\":\"2025-12-30T13:49:45.403686Z\",\"priority\":\"P4\",\"public_id\":\"99262\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"modified_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}",
4646
"headers": {
4747
"Content-Type": [
4848
"application/vnd.api+json"
@@ -57,6 +57,6 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "57529eb3-3888-9ea0-582e-398aac78c8cc"
60+
"id": "d9673a60-73f9-7390-7584-792968835a2b"
6161
}
6262
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-01T12:46:31.968Z
1+
2025-12-30T13:49:45.450Z

src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"secure": true
1313
},
1414
"httpResponse": {
15-
"body": "{\"data\":{\"id\":\"1beeecc8-5c4f-4194-a785-e5c60234e263\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-10-01T12:46:32.453117Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"1beeecc8-5c4f-4194-a785-e5c60234e263\",\"key\":\"DDFC-82970\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"83058\",\"status\":\"OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"[email protected]\",\"name\":\"frog\"}}]}",
15+
"body": "{\"data\":{\"id\":\"b3cef7a0-9637-43fb-88cf-d9ac56310a7b\",\"type\":\"case\",\"attributes\":{\"attributes\":{},\"comment_count\":0,\"created_at\":\"2025-12-30T13:49:45.508531Z\",\"creation_source\":\"MANUAL\",\"custom_attributes\":{},\"description\":\"\",\"insights\":[],\"internal_id\":\"b3cef7a0-9637-43fb-88cf-d9ac56310a7b\",\"key\":\"DDFC-98807\",\"merge_status\":\"NOT_MERGED\",\"priority\":\"P4\",\"public_id\":\"99263\",\"status\":\"OPEN\",\"status_group\":\"SG_OPEN\",\"status_name\":\"Open\",\"title\":\"My new case\",\"type\":\"STANDARD\",\"type_id\":\"00000000-0000-0000-0000-000000000001\"},\"relationships\":{\"created_by\":{\"data\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\"}},\"project\":{\"data\":{\"id\":\"d4bbe1af-f36e-42f1-87c1-493ca35c320e\",\"type\":\"project\"}}}},\"included\":[{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"type\":\"user\",\"attributes\":{\"active\":true,\"email\":\"[email protected]\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}]}",
1616
"headers": {
1717
"Content-Type": [
1818
"application/vnd.api+json"
@@ -37,7 +37,7 @@
3737
},
3838
"headers": {},
3939
"method": "POST",
40-
"path": "/api/v2/cases/1beeecc8-5c4f-4194-a785-e5c60234e263/assign",
40+
"path": "/api/v2/cases/b3cef7a0-9637-43fb-88cf-d9ac56310a7b/assign",
4141
"keepAlive": false,
4242
"secure": true
4343
},
@@ -57,6 +57,6 @@
5757
"timeToLive": {
5858
"unlimited": true
5959
},
60-
"id": "30bda267-2a5e-f496-0edc-0461cb732a9b"
60+
"id": "ed3d10de-dc2d-ee05-2933-dd494eefe952"
6161
}
6262
]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-10-01T12:46:34.590Z
1+
2025-12-30T13:49:45.709Z

0 commit comments

Comments
 (0)