Skip to content

Commit 68e860c

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update /api/v2/cases endpoint to add custom attributes support (#3045)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent fd7afb0 commit 68e860c

File tree

47 files changed

+186
-131
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

+186
-131
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/datadog_api_client/v2/model/case_create_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union, TYPE_CHECKING
6+
from typing import Dict, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -14,22 +14,26 @@
1414

1515

1616
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue
1718
from datadog_api_client.v2.model.case_priority import CasePriority
1819

1920

2021
class CaseCreateAttributes(ModelNormal):
2122
@cached_property
2223
def openapi_types(_):
24+
from datadog_api_client.v2.model.custom_attribute_value import CustomAttributeValue
2325
from datadog_api_client.v2.model.case_priority import CasePriority
2426

2527
return {
28+
"custom_attributes": ({str: (CustomAttributeValue,)},),
2629
"description": (str,),
2730
"priority": (CasePriority,),
2831
"title": (str,),
2932
"type_id": (str,),
3033
}
3134

3235
attribute_map = {
36+
"custom_attributes": "custom_attributes",
3337
"description": "description",
3438
"priority": "priority",
3539
"title": "title",
@@ -40,13 +44,17 @@ def __init__(
4044
self_,
4145
title: str,
4246
type_id: str,
47+
custom_attributes: Union[Dict[str, CustomAttributeValue], UnsetType] = unset,
4348
description: Union[str, UnsetType] = unset,
4449
priority: Union[CasePriority, UnsetType] = unset,
4550
**kwargs,
4651
):
4752
"""
4853
Case creation attributes
4954
55+
:param custom_attributes: Case custom attributes
56+
:type custom_attributes: {str: (CustomAttributeValue,)}, optional
57+
5058
:param description: Description
5159
:type description: str, optional
5260
@@ -59,6 +67,8 @@ def __init__(
5967
:param type_id: Case type UUID
6068
:type type_id: str
6169
"""
70+
if custom_attributes is not unset:
71+
kwargs["custom_attributes"] = custom_attributes
6272
if description is not unset:
6373
kwargs["description"] = description
6474
if priority is not unset:

src/datadog_api_client/v2/model/custom_attribute_type.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ class CustomAttributeType(ModelSimple):
1616
"""
1717
Custom attributes type
1818
19-
:param value: Must be one of ["URL", "TEXT", "NUMBER"].
19+
:param value: Must be one of ["URL", "TEXT", "NUMBER", "SELECT"].
2020
:type value: str
2121
"""
2222

2323
allowed_values = {
2424
"URL",
2525
"TEXT",
2626
"NUMBER",
27+
"SELECT",
2728
}
2829
URL: ClassVar["CustomAttributeType"]
2930
TEXT: ClassVar["CustomAttributeType"]
3031
NUMBER: ClassVar["CustomAttributeType"]
32+
SELECT: ClassVar["CustomAttributeType"]
3133

3234
@cached_property
3335
def openapi_types(_):
@@ -39,3 +41,4 @@ def openapi_types(_):
3941
CustomAttributeType.URL = CustomAttributeType("URL")
4042
CustomAttributeType.TEXT = CustomAttributeType("TEXT")
4143
CustomAttributeType.NUMBER = CustomAttributeType("NUMBER")
44+
CustomAttributeType.SELECT = CustomAttributeType("SELECT")
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

tests/v2/cassettes/test_scenarios/test_archive_case_returns_bad_request_response.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/cases
1111
response:
1212
body:
13-
string: '{"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
14-
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":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":"frog"}}]}'
13+
string: '{"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
14+
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":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
15+
Account"}}]}'
1516
headers:
1617
content-type:
1718
- application/vnd.api+json
@@ -26,7 +27,7 @@ interactions:
2627
content-type:
2728
- application/json
2829
method: POST
29-
uri: https://api.datadoghq.com/api/v2/cases/3601878d-b851-43b6-900f-0deb35e536d7/archive
30+
uri: https://api.datadoghq.com/api/v2/cases/e3f011bc-8ae6-4ec2-b80d-3069e73bc6a1/archive
3031
response:
3132
body:
3233
string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type
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

tests/v2/cassettes/test_scenarios/test_archive_case_returns_ok_response.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/cases
1111
response:
1212
body:
13-
string: '{"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
14-
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":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":"frog"}}]}'
13+
string: '{"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
14+
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":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
15+
Account"}}]}'
1516
headers:
1617
content-type:
1718
- application/vnd.api+json
@@ -26,11 +27,12 @@ interactions:
2627
content-type:
2728
- application/json
2829
method: POST
29-
uri: https://api.datadoghq.com/api/v2/cases/b5cf9b44-cb77-4487-a436-0e3ef4e88d49/archive
30+
uri: https://api.datadoghq.com/api/v2/cases/926e6b8a-4af6-43b2-8a29-33813af68594/archive
3031
response:
3132
body:
32-
string: '{"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
33-
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":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":"frog"}}]}'
33+
string: '{"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
34+
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":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
35+
Account"}}]}'
3436
headers:
3537
content-type:
3638
- application/vnd.api+json
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

tests/v2/cassettes/test_scenarios/test_assign_case_returns_bad_request_response.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ interactions:
1010
uri: https://api.datadoghq.com/api/v2/cases
1111
response:
1212
body:
13-
string: '{"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
14-
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":"frog@datadoghq.com","handle":"frog@datadoghq.com","name":"frog"}}]}'
13+
string: '{"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
14+
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":"team-intg-tools-libs-spam@datadoghq.com","handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI
15+
Account"}}]}'
1516
headers:
1617
content-type:
1718
- application/vnd.api+json
@@ -26,7 +27,7 @@ interactions:
2627
content-type:
2728
- application/json
2829
method: POST
29-
uri: https://api.datadoghq.com/api/v2/cases/1beeecc8-5c4f-4194-a785-e5c60234e263/assign
30+
uri: https://api.datadoghq.com/api/v2/cases/b3cef7a0-9637-43fb-88cf-d9ac56310a7b/assign
3031
response:
3132
body:
3233
string: '{"errors":[{"status":"400","title":"Bad Request"}]}'
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)