Skip to content

Commit 720f5e8

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document case management attributes endpoints (#2719)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 2f3adff commit 720f5e8

File tree

57 files changed

+596
-98
lines changed

Some content is hidden

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

57 files changed

+596
-98
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:55:56.724"
2+
"spec_repo_commit": "b75095c",
3+
"generated": "2025-07-31 10:46:07.850"
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

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,13 @@ datadog\_api\_client.v2.model.case\_empty\_request module
21182118
:members:
21192119
:show-inheritance:
21202120

2121+
datadog\_api\_client.v2.model.case\_object\_attributes module
2122+
-------------------------------------------------------------
2123+
2124+
.. automodule:: datadog_api_client.v2.model.case_object_attributes
2125+
:members:
2126+
:show-inheritance:
2127+
21212128
datadog\_api\_client.v2.model.case\_priority module
21222129
---------------------------------------------------
21232130

@@ -2181,6 +2188,27 @@ datadog\_api\_client.v2.model.case\_type module
21812188
:members:
21822189
:show-inheritance:
21832190

2191+
datadog\_api\_client.v2.model.case\_update\_attributes module
2192+
-------------------------------------------------------------
2193+
2194+
.. automodule:: datadog_api_client.v2.model.case_update_attributes
2195+
:members:
2196+
:show-inheritance:
2197+
2198+
datadog\_api\_client.v2.model.case\_update\_attributes\_attributes module
2199+
-------------------------------------------------------------------------
2200+
2201+
.. automodule:: datadog_api_client.v2.model.case_update_attributes_attributes
2202+
:members:
2203+
:show-inheritance:
2204+
2205+
datadog\_api\_client.v2.model.case\_update\_attributes\_request module
2206+
----------------------------------------------------------------------
2207+
2208+
.. automodule:: datadog_api_client.v2.model.case_update_attributes_request
2209+
:members:
2210+
:show-inheritance:
2211+
21842212
datadog\_api\_client.v2.model.case\_update\_priority module
21852213
-----------------------------------------------------------
21862214

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
"""
2+
Update case attributes returns "OK" response
3+
"""
4+
5+
from os import environ
6+
from datadog_api_client import ApiClient, Configuration
7+
from datadog_api_client.v2.api.case_management_api import CaseManagementApi
8+
from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes
9+
from datadog_api_client.v2.model.case_resource_type import CaseResourceType
10+
from datadog_api_client.v2.model.case_update_attributes import CaseUpdateAttributes
11+
from datadog_api_client.v2.model.case_update_attributes_attributes import CaseUpdateAttributesAttributes
12+
from datadog_api_client.v2.model.case_update_attributes_request import CaseUpdateAttributesRequest
13+
14+
# there is a valid "case" in the system
15+
CASE_ID = environ["CASE_ID"]
16+
17+
body = CaseUpdateAttributesRequest(
18+
data=CaseUpdateAttributes(
19+
attributes=CaseUpdateAttributesAttributes(
20+
attributes=CaseObjectAttributes(
21+
env=[
22+
"test",
23+
],
24+
service=[
25+
"web-store",
26+
"web-api",
27+
],
28+
team=[
29+
"engineer",
30+
],
31+
),
32+
),
33+
type=CaseResourceType.CASE,
34+
),
35+
)
36+
37+
configuration = Configuration()
38+
with ApiClient(configuration) as api_client:
39+
api_instance = CaseManagementApi(api_client)
40+
response = api_instance.update_attributes(case_id=CASE_ID, body=body)
41+
42+
print(response)

src/datadog_api_client/v2/api/case_management_api.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from datadog_api_client.v2.model.project_create_request import ProjectCreateRequest
2525
from datadog_api_client.v2.model.case_empty_request import CaseEmptyRequest
2626
from datadog_api_client.v2.model.case_assign_request import CaseAssignRequest
27+
from datadog_api_client.v2.model.case_update_attributes_request import CaseUpdateAttributesRequest
2728
from datadog_api_client.v2.model.case_update_priority_request import CaseUpdatePriorityRequest
2829
from datadog_api_client.v2.model.case_update_status_request import CaseUpdateStatusRequest
2930

@@ -309,6 +310,32 @@ def __init__(self, api_client=None):
309310
api_client=api_client,
310311
)
311312

313+
self._update_attributes_endpoint = _Endpoint(
314+
settings={
315+
"response_type": (CaseResponse,),
316+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
317+
"endpoint_path": "/api/v2/cases/{case_id}/attributes",
318+
"operation_id": "update_attributes",
319+
"http_method": "POST",
320+
"version": "v2",
321+
},
322+
params_map={
323+
"case_id": {
324+
"required": True,
325+
"openapi_types": (str,),
326+
"attribute": "case_id",
327+
"location": "path",
328+
},
329+
"body": {
330+
"required": True,
331+
"openapi_types": (CaseUpdateAttributesRequest,),
332+
"location": "body",
333+
},
334+
},
335+
headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
336+
api_client=api_client,
337+
)
338+
312339
self._update_priority_endpoint = _Endpoint(
313340
settings={
314341
"response_type": (CaseResponse,),
@@ -644,6 +671,28 @@ def unassign_case(
644671

645672
return self._unassign_case_endpoint.call_with_http_info(**kwargs)
646673

674+
def update_attributes(
675+
self,
676+
case_id: str,
677+
body: CaseUpdateAttributesRequest,
678+
) -> CaseResponse:
679+
"""Update case attributes.
680+
681+
Update case attributes
682+
683+
:param case_id: Case's UUID or key
684+
:type case_id: str
685+
:param body: Case attributes update payload
686+
:type body: CaseUpdateAttributesRequest
687+
:rtype: CaseResponse
688+
"""
689+
kwargs: Dict[str, Any] = {}
690+
kwargs["case_id"] = case_id
691+
692+
kwargs["body"] = body
693+
694+
return self._update_attributes_endpoint.call_with_http_info(**kwargs)
695+
647696
def update_priority(
648697
self,
649698
case_id: str,

src/datadog_api_client/v2/model/case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
"""
5252
A case
5353
54-
:param attributes: Case attributes
54+
:param attributes: Case resource attributes
5555
:type attributes: CaseAttributes
5656
5757
:param id: Case's identifier

src/datadog_api_client/v2/model/case_attributes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
if TYPE_CHECKING:
19+
from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes
1920
from datadog_api_client.v2.model.jira_issue import JiraIssue
2021
from datadog_api_client.v2.model.case_priority import CasePriority
2122
from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket
@@ -26,6 +27,7 @@
2627
class CaseAttributes(ModelNormal):
2728
@cached_property
2829
def openapi_types(_):
30+
from datadog_api_client.v2.model.case_object_attributes import CaseObjectAttributes
2931
from datadog_api_client.v2.model.jira_issue import JiraIssue
3032
from datadog_api_client.v2.model.case_priority import CasePriority
3133
from datadog_api_client.v2.model.service_now_ticket import ServiceNowTicket
@@ -34,6 +36,7 @@ def openapi_types(_):
3436

3537
return {
3638
"archived_at": (datetime, none_type),
39+
"attributes": (CaseObjectAttributes,),
3740
"closed_at": (datetime, none_type),
3841
"created_at": (datetime,),
3942
"description": (str,),
@@ -49,6 +52,7 @@ def openapi_types(_):
4952

5053
attribute_map = {
5154
"archived_at": "archived_at",
55+
"attributes": "attributes",
5256
"closed_at": "closed_at",
5357
"created_at": "created_at",
5458
"description": "description",
@@ -73,6 +77,7 @@ def openapi_types(_):
7377
def __init__(
7478
self_,
7579
archived_at: Union[datetime, none_type, UnsetType] = unset,
80+
attributes: Union[CaseObjectAttributes, UnsetType] = unset,
7681
closed_at: Union[datetime, none_type, UnsetType] = unset,
7782
created_at: Union[datetime, UnsetType] = unset,
7883
description: Union[str, UnsetType] = unset,
@@ -87,11 +92,14 @@ def __init__(
8792
**kwargs,
8893
):
8994
"""
90-
Case attributes
95+
Case resource attributes
9196
9297
:param archived_at: Timestamp of when the case was archived
9398
:type archived_at: datetime, none_type, optional
9499
100+
:param attributes: The definition of ``CaseObjectAttributes`` object.
101+
:type attributes: CaseObjectAttributes, optional
102+
95103
:param closed_at: Timestamp of when the case was closed
96104
:type closed_at: datetime, none_type, optional
97105
@@ -127,6 +135,8 @@ def __init__(
127135
"""
128136
if archived_at is not unset:
129137
kwargs["archived_at"] = archived_at
138+
if attributes is not unset:
139+
kwargs["attributes"] = attributes
130140
if closed_at is not unset:
131141
kwargs["closed_at"] = closed_at
132142
if created_at is not unset:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelNormal,
9+
cached_property,
10+
)
11+
12+
13+
class CaseObjectAttributes(ModelNormal):
14+
@cached_property
15+
def additional_properties_type(_):
16+
return ([str],)
17+
18+
def __init__(self_, **kwargs):
19+
"""
20+
The definition of ``CaseObjectAttributes`` object.
21+
"""
22+
super().__init__(kwargs)

0 commit comments

Comments
 (0)