Skip to content

Commit d9b6589

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Document case management attributes endpoints (#3236)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 949bfa2 commit d9b6589

55 files changed

Lines changed: 846 additions & 99 deletions

File tree

Some content is hidden

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

.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:57:14.491"
2+
"spec_repo_commit": "b75095c",
3+
"generated": "2025-07-31 10:47:28.624"
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

api/datadogV2/api_case_management.go

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,87 @@ func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, bo
993993
return localVarReturnValue, localVarHTTPResponse, nil
994994
}
995995

996+
// UpdateAttributes Update case attributes.
997+
// Update case attributes
998+
func (a *CaseManagementApi) UpdateAttributes(ctx _context.Context, caseId string, body CaseUpdateAttributesRequest) (CaseResponse, *_nethttp.Response, error) {
999+
var (
1000+
localVarHTTPMethod = _nethttp.MethodPost
1001+
localVarPostBody interface{}
1002+
localVarReturnValue CaseResponse
1003+
)
1004+
1005+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateAttributes")
1006+
if err != nil {
1007+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1008+
}
1009+
1010+
localVarPath := localBasePath + "/api/v2/cases/{case_id}/attributes"
1011+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")))
1012+
1013+
localVarHeaderParams := make(map[string]string)
1014+
localVarQueryParams := _neturl.Values{}
1015+
localVarFormParams := _neturl.Values{}
1016+
localVarHeaderParams["Content-Type"] = "application/json"
1017+
localVarHeaderParams["Accept"] = "application/json"
1018+
1019+
// body params
1020+
localVarPostBody = &body
1021+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1022+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1023+
if err != nil {
1024+
return localVarReturnValue, nil, err
1025+
}
1026+
} else {
1027+
datadog.SetAuthKeys(
1028+
ctx,
1029+
&localVarHeaderParams,
1030+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1031+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1032+
)
1033+
}
1034+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1035+
if err != nil {
1036+
return localVarReturnValue, nil, err
1037+
}
1038+
1039+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1040+
if err != nil || localVarHTTPResponse == nil {
1041+
return localVarReturnValue, localVarHTTPResponse, err
1042+
}
1043+
1044+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1045+
if err != nil {
1046+
return localVarReturnValue, localVarHTTPResponse, err
1047+
}
1048+
1049+
if localVarHTTPResponse.StatusCode >= 300 {
1050+
newErr := datadog.GenericOpenAPIError{
1051+
ErrorBody: localVarBody,
1052+
ErrorMessage: localVarHTTPResponse.Status,
1053+
}
1054+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
1055+
var v APIErrorResponse
1056+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1057+
if err != nil {
1058+
return localVarReturnValue, localVarHTTPResponse, newErr
1059+
}
1060+
newErr.ErrorModel = v
1061+
}
1062+
return localVarReturnValue, localVarHTTPResponse, newErr
1063+
}
1064+
1065+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1066+
if err != nil {
1067+
newErr := datadog.GenericOpenAPIError{
1068+
ErrorBody: localVarBody,
1069+
ErrorMessage: err.Error(),
1070+
}
1071+
return localVarReturnValue, localVarHTTPResponse, newErr
1072+
}
1073+
1074+
return localVarReturnValue, localVarHTTPResponse, nil
1075+
}
1076+
9961077
// UpdatePriority Update case priority.
9971078
// Update case priority
9981079
func (a *CaseManagementApi) UpdatePriority(ctx _context.Context, caseId string, body CaseUpdatePriorityRequest) (CaseResponse, *_nethttp.Response, error) {

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
// - [CaseManagementApi.SearchCases]
104104
// - [CaseManagementApi.UnarchiveCase]
105105
// - [CaseManagementApi.UnassignCase]
106+
// - [CaseManagementApi.UpdateAttributes]
106107
// - [CaseManagementApi.UpdatePriority]
107108
// - [CaseManagementApi.UpdateStatus]
108109
// - [CloudCostManagementApi.CreateCostAWSCURConfig]

api/datadogV2/model_case.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Case A case
1414
type Case struct {
15-
// Case attributes
15+
// Case resource attributes
1616
Attributes CaseAttributes `json:"attributes"`
1717
// Case's identifier
1818
Id string `json:"id"`

api/datadogV2/model_case_attributes.go

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// CaseAttributes Case attributes
13+
// CaseAttributes Case resource attributes
1414
type CaseAttributes struct {
1515
// Timestamp of when the case was archived
1616
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
17+
// The definition of `CaseObjectAttributes` object.
18+
Attributes map[string][]string `json:"attributes,omitempty"`
1719
// Timestamp of when the case was closed
1820
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
1921
// Timestamp of when the case was created
@@ -101,6 +103,34 @@ func (o *CaseAttributes) UnsetArchivedAt() {
101103
o.ArchivedAt.Unset()
102104
}
103105

106+
// GetAttributes returns the Attributes field value if set, zero value otherwise.
107+
func (o *CaseAttributes) GetAttributes() map[string][]string {
108+
if o == nil || o.Attributes == nil {
109+
var ret map[string][]string
110+
return ret
111+
}
112+
return o.Attributes
113+
}
114+
115+
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
116+
// and a boolean to check if the value has been set.
117+
func (o *CaseAttributes) GetAttributesOk() (*map[string][]string, bool) {
118+
if o == nil || o.Attributes == nil {
119+
return nil, false
120+
}
121+
return &o.Attributes, true
122+
}
123+
124+
// HasAttributes returns a boolean if a field has been set.
125+
func (o *CaseAttributes) HasAttributes() bool {
126+
return o != nil && o.Attributes != nil
127+
}
128+
129+
// SetAttributes gets a reference to the given map[string][]string and assigns it to the Attributes field.
130+
func (o *CaseAttributes) SetAttributes(v map[string][]string) {
131+
o.Attributes = v
132+
}
133+
104134
// GetClosedAt returns the ClosedAt field value if set, zero value otherwise (both if not set or set to explicit null).
105135
func (o *CaseAttributes) GetClosedAt() time.Time {
106136
if o == nil || o.ClosedAt.Get() == nil {
@@ -462,6 +492,9 @@ func (o CaseAttributes) MarshalJSON() ([]byte, error) {
462492
if o.ArchivedAt.IsSet() {
463493
toSerialize["archived_at"] = o.ArchivedAt.Get()
464494
}
495+
if o.Attributes != nil {
496+
toSerialize["attributes"] = o.Attributes
497+
}
465498
if o.ClosedAt.IsSet() {
466499
toSerialize["closed_at"] = o.ClosedAt.Get()
467500
}
@@ -510,6 +543,7 @@ func (o CaseAttributes) MarshalJSON() ([]byte, error) {
510543
func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) {
511544
all := struct {
512545
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
546+
Attributes map[string][]string `json:"attributes,omitempty"`
513547
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
514548
CreatedAt *time.Time `json:"created_at,omitempty"`
515549
Description *string `json:"description,omitempty"`
@@ -527,13 +561,14 @@ func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) {
527561
}
528562
additionalProperties := make(map[string]interface{})
529563
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
530-
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "closed_at", "created_at", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type"})
564+
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "attributes", "closed_at", "created_at", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type"})
531565
} else {
532566
return err
533567
}
534568

535569
hasInvalidField := false
536570
o.ArchivedAt = all.ArchivedAt
571+
o.Attributes = all.Attributes
537572
o.ClosedAt = all.ClosedAt
538573
o.CreatedAt = all.CreatedAt
539574
o.Description = all.Description

0 commit comments

Comments
 (0)