Skip to content

Commit a7b0dc4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit c066213 of spec repo
1 parent 2ecf0ac commit a7b0dc4

File tree

13 files changed

+666
-55
lines changed

13 files changed

+666
-55
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": "0f24b8e",
3-
"generated": "2025-07-18 16:53:06.032"
2+
"spec_repo_commit": "c066213",
3+
"generated": "2025-07-21 08:28:41.754"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 120 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6834,7 +6834,7 @@ components:
68346834
description: A case
68356835
properties:
68366836
attributes:
6837-
$ref: '#/components/schemas/CaseAttributes'
6837+
$ref: '#/components/schemas/CaseResourceAttributes'
68386838
id:
68396839
description: Case's identifier
68406840
example: aeadc05e-98a8-11ec-ac2c-da7ad0900001
@@ -6892,52 +6892,11 @@ components:
68926892
- data
68936893
type: object
68946894
CaseAttributes:
6895-
description: Case attributes
6896-
properties:
6897-
archived_at:
6898-
description: Timestamp of when the case was archived
6899-
format: date-time
6900-
nullable: true
6901-
readOnly: true
6902-
type: string
6903-
closed_at:
6904-
description: Timestamp of when the case was closed
6905-
format: date-time
6906-
nullable: true
6907-
readOnly: true
6908-
type: string
6909-
created_at:
6910-
description: Timestamp of when the case was created
6911-
format: date-time
6912-
readOnly: true
6913-
type: string
6914-
description:
6915-
description: Description
6916-
type: string
6917-
jira_issue:
6918-
$ref: '#/components/schemas/JiraIssue'
6919-
key:
6920-
description: Key
6921-
example: CASEM-4523
6922-
type: string
6923-
modified_at:
6924-
description: Timestamp of when the case was last modified
6925-
format: date-time
6926-
nullable: true
6927-
readOnly: true
6928-
type: string
6929-
priority:
6930-
$ref: '#/components/schemas/CasePriority'
6931-
service_now_ticket:
6932-
$ref: '#/components/schemas/ServiceNowTicket'
6933-
status:
6934-
$ref: '#/components/schemas/CaseStatus'
6935-
title:
6936-
description: Title
6937-
example: Memory leak investigation on API
6895+
additionalProperties:
6896+
items:
69386897
type: string
6939-
type:
6940-
$ref: '#/components/schemas/CaseType'
6898+
type: array
6899+
description: The definition of `CaseAttributes` object.
69416900
type: object
69426901
CaseCreate:
69436902
description: Case creation data
@@ -7035,6 +6994,56 @@ components:
70356994
project:
70366995
$ref: '#/components/schemas/ProjectRelationship'
70376996
type: object
6997+
CaseResourceAttributes:
6998+
description: Case resource attributes
6999+
properties:
7000+
archived_at:
7001+
description: Timestamp of when the case was archived
7002+
format: date-time
7003+
nullable: true
7004+
readOnly: true
7005+
type: string
7006+
attributes:
7007+
$ref: '#/components/schemas/CaseAttributes'
7008+
closed_at:
7009+
description: Timestamp of when the case was closed
7010+
format: date-time
7011+
nullable: true
7012+
readOnly: true
7013+
type: string
7014+
created_at:
7015+
description: Timestamp of when the case was created
7016+
format: date-time
7017+
readOnly: true
7018+
type: string
7019+
description:
7020+
description: Description
7021+
type: string
7022+
jira_issue:
7023+
$ref: '#/components/schemas/JiraIssue'
7024+
key:
7025+
description: Key
7026+
example: CASEM-4523
7027+
type: string
7028+
modified_at:
7029+
description: Timestamp of when the case was last modified
7030+
format: date-time
7031+
nullable: true
7032+
readOnly: true
7033+
type: string
7034+
priority:
7035+
$ref: '#/components/schemas/CasePriority'
7036+
service_now_ticket:
7037+
$ref: '#/components/schemas/ServiceNowTicket'
7038+
status:
7039+
$ref: '#/components/schemas/CaseStatus'
7040+
title:
7041+
description: Title
7042+
example: Memory leak investigation on API
7043+
type: string
7044+
type:
7045+
$ref: '#/components/schemas/CaseType'
7046+
type: object
70387047
CaseResourceType:
70397048
default: case
70407049
description: Case resource type
@@ -7099,6 +7108,33 @@ components:
70997108
type: string
71007109
x-enum-varnames:
71017110
- STANDARD
7111+
CaseUpdateAttributes:
7112+
description: Case update attributes
7113+
properties:
7114+
attributes:
7115+
$ref: '#/components/schemas/CaseUpdateAttributesAttributes'
7116+
type:
7117+
$ref: '#/components/schemas/CaseResourceType'
7118+
required:
7119+
- attributes
7120+
- type
7121+
type: object
7122+
CaseUpdateAttributesAttributes:
7123+
description: Case update attributes attributes
7124+
properties:
7125+
attributes:
7126+
$ref: '#/components/schemas/CaseAttributes'
7127+
required:
7128+
- attributes
7129+
type: object
7130+
CaseUpdateAttributesRequest:
7131+
description: Case update attributes request
7132+
properties:
7133+
data:
7134+
$ref: '#/components/schemas/CaseUpdateAttributes'
7135+
required:
7136+
- data
7137+
type: object
71027138
CaseUpdatePriority:
71037139
description: Case priority status
71047140
properties:
@@ -45529,6 +45565,44 @@ paths:
4552945565
summary: Assign case
4553045566
tags:
4553145567
- Case Management
45568+
/api/v2/cases/{case_id}/attributes:
45569+
post:
45570+
description: Update case attributes
45571+
operationId: UpdateAttributes
45572+
parameters:
45573+
- $ref: '#/components/parameters/CaseIDPathParameter'
45574+
requestBody:
45575+
content:
45576+
application/json:
45577+
schema:
45578+
$ref: '#/components/schemas/CaseUpdateAttributesRequest'
45579+
description: Case attributes update payload
45580+
required: true
45581+
responses:
45582+
'200':
45583+
content:
45584+
application/json:
45585+
schema:
45586+
$ref: '#/components/schemas/CaseResponse'
45587+
description: OK
45588+
'400':
45589+
$ref: '#/components/responses/BadRequestResponse'
45590+
'401':
45591+
$ref: '#/components/responses/UnauthorizedResponse'
45592+
'403':
45593+
$ref: '#/components/responses/ForbiddenResponse'
45594+
'404':
45595+
$ref: '#/components/responses/NotFoundResponse'
45596+
'429':
45597+
$ref: '#/components/responses/TooManyRequestsResponse'
45598+
security:
45599+
- apiKeyAuth: []
45600+
appKeyAuth: []
45601+
- AuthZ:
45602+
- cases_write
45603+
summary: Update case attributes
45604+
tags:
45605+
- Case Management
4553245606
/api/v2/cases/{case_id}/priority:
4553345607
post:
4553445608
description: Update case priority
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Update case attributes returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::CaseManagementAPI.new
5+
6+
# there is a valid "case" in the system
7+
CASE_ID = ENV["CASE_ID"]
8+
9+
body = DatadogAPIClient::V2::CaseUpdateAttributesRequest.new({
10+
data: DatadogAPIClient::V2::CaseUpdateAttributes.new({
11+
attributes: DatadogAPIClient::V2::CaseUpdateAttributesAttributes.new({
12+
attributes: {
13+
service: [
14+
"web-store",
15+
"web-api",
16+
], env: [
17+
"test",
18+
], team: [
19+
"engineer",
20+
],
21+
},
22+
}),
23+
type: DatadogAPIClient::V2::CaseResourceType::CASE,
24+
}),
25+
})
26+
p api_instance.update_attributes(CASE_ID, body)

features/scenarios_model_mapping.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,10 @@
10931093
"case_id" => "String",
10941094
"body" => "CaseAssignRequest",
10951095
},
1096+
"v2.UpdateAttributes" => {
1097+
"case_id" => "String",
1098+
"body" => "CaseUpdateAttributesRequest",
1099+
},
10961100
"v2.UpdatePriority" => {
10971101
"case_id" => "String",
10981102
"body" => "CaseUpdatePriorityRequest",

features/v2/case_management.feature

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,32 @@ Feature: Case Management
263263
When the request is sent
264264
Then the response status is 200 OK
265265

266+
@team:DataDog/case-management
267+
Scenario: Update case attributes returns "Bad Request" response
268+
Given new "UpdateAttributes" request
269+
And there is a valid "case" in the system
270+
And request contains "case_id" parameter from "case.id"
271+
And body with value { "data": { "type": "case", "attributes": { "attributes": { "service": "web-store"}}}}
272+
When the request is sent
273+
Then the response status is 400 Bad Request
274+
275+
@team:DataDog/case-management
276+
Scenario: Update case attributes returns "Not Found" response
277+
Given new "UpdateAttributes" request
278+
And request contains "case_id" parameter with value "67d80aa3-36ff-44b9-a694-c501a7591737"
279+
And body with value { "data": { "type": "case", "attributes": { "attributes": {} } } }
280+
When the request is sent
281+
Then the response status is 404 Not Found
282+
283+
@team:DataDog/case-management
284+
Scenario: Update case attributes returns "OK" response
285+
Given new "UpdateAttributes" request
286+
And there is a valid "case" in the system
287+
And request contains "case_id" parameter from "case.id"
288+
And body with value {"data": {"attributes": {"attributes": {"service": ["web-store", "web-api"], "env": ["test"], "team": ["engineer"]}}, "type": "case"}}
289+
When the request is sent
290+
Then the response status is 200 OK
291+
266292
@team:DataDog/case-management
267293
Scenario: Update case priority returns "Bad Request" response
268294
Given new "UpdatePriority" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,12 @@
446446
"type": "idempotent"
447447
}
448448
},
449+
"UpdateAttributes": {
450+
"tag": "Case Management",
451+
"undo": {
452+
"type": "idempotent"
453+
}
454+
},
449455
"UpdatePriority": {
450456
"tag": "Case Management",
451457
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,6 @@ def overrides
12311231
"v2.case_assign" => "CaseAssign",
12321232
"v2.case_assign_attributes" => "CaseAssignAttributes",
12331233
"v2.case_assign_request" => "CaseAssignRequest",
1234-
"v2.case_attributes" => "CaseAttributes",
12351234
"v2.case_create" => "CaseCreate",
12361235
"v2.case_create_attributes" => "CaseCreateAttributes",
12371236
"v2.case_create_relationships" => "CaseCreateRelationships",
@@ -1240,6 +1239,7 @@ def overrides
12401239
"v2.case_empty_request" => "CaseEmptyRequest",
12411240
"v2.case_priority" => "CasePriority",
12421241
"v2.case_relationships" => "CaseRelationships",
1242+
"v2.case_resource_attributes" => "CaseResourceAttributes",
12431243
"v2.case_resource_type" => "CaseResourceType",
12441244
"v2.case_response" => "CaseResponse",
12451245
"v2.case_sortable_field" => "CaseSortableField",
@@ -1250,6 +1250,9 @@ def overrides
12501250
"v2.case_trigger" => "CaseTrigger",
12511251
"v2.case_trigger_wrapper" => "CaseTriggerWrapper",
12521252
"v2.case_type" => "CaseType",
1253+
"v2.case_update_attributes" => "CaseUpdateAttributes",
1254+
"v2.case_update_attributes_attributes" => "CaseUpdateAttributesAttributes",
1255+
"v2.case_update_attributes_request" => "CaseUpdateAttributesRequest",
12531256
"v2.case_update_priority" => "CaseUpdatePriority",
12541257
"v2.case_update_priority_attributes" => "CaseUpdatePriorityAttributes",
12551258
"v2.case_update_priority_request" => "CaseUpdatePriorityRequest",

lib/datadog_api_client/v2/api/case_management_api.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,78 @@ def unassign_case_with_http_info(case_id, body, opts = {})
796796
return data, status_code, headers
797797
end
798798

799+
# Update case attributes.
800+
#
801+
# @see #update_attributes_with_http_info
802+
def update_attributes(case_id, body, opts = {})
803+
data, _status_code, _headers = update_attributes_with_http_info(case_id, body, opts)
804+
data
805+
end
806+
807+
# Update case attributes.
808+
#
809+
# Update case attributes
810+
#
811+
# @param case_id [String] Case's UUID or key
812+
# @param body [CaseUpdateAttributesRequest] Case attributes update payload
813+
# @param opts [Hash] the optional parameters
814+
# @return [Array<(CaseResponse, Integer, Hash)>] CaseResponse data, response status code and response headers
815+
def update_attributes_with_http_info(case_id, body, opts = {})
816+
817+
if @api_client.config.debugging
818+
@api_client.config.logger.debug 'Calling API: CaseManagementAPI.update_attributes ...'
819+
end
820+
# verify the required parameter 'case_id' is set
821+
if @api_client.config.client_side_validation && case_id.nil?
822+
fail ArgumentError, "Missing the required parameter 'case_id' when calling CaseManagementAPI.update_attributes"
823+
end
824+
# verify the required parameter 'body' is set
825+
if @api_client.config.client_side_validation && body.nil?
826+
fail ArgumentError, "Missing the required parameter 'body' when calling CaseManagementAPI.update_attributes"
827+
end
828+
# resource path
829+
local_var_path = '/api/v2/cases/{case_id}/attributes'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/'))
830+
831+
# query parameters
832+
query_params = opts[:query_params] || {}
833+
834+
# header parameters
835+
header_params = opts[:header_params] || {}
836+
# HTTP header 'Accept' (if needed)
837+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
838+
# HTTP header 'Content-Type'
839+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
840+
841+
# form parameters
842+
form_params = opts[:form_params] || {}
843+
844+
# http body (model)
845+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
846+
847+
# return_type
848+
return_type = opts[:debug_return_type] || 'CaseResponse'
849+
850+
# auth_names
851+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
852+
853+
new_options = opts.merge(
854+
:operation => :update_attributes,
855+
:header_params => header_params,
856+
:query_params => query_params,
857+
:form_params => form_params,
858+
:body => post_body,
859+
:auth_names => auth_names,
860+
:return_type => return_type,
861+
:api_version => "V2"
862+
)
863+
864+
data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options)
865+
if @api_client.config.debugging
866+
@api_client.config.logger.debug "API called: CaseManagementAPI#update_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
867+
end
868+
return data, status_code, headers
869+
end
870+
799871
# Update case priority.
800872
#
801873
# @see #update_priority_with_http_info

0 commit comments

Comments
 (0)