Skip to content

Document case management attributes endpoints #803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "06ccc32",
"generated": "2025-07-21 14:00:09.710"
"spec_repo_commit": "c4338a8",
"generated": "2025-07-21 18:52:35.485"
}
166 changes: 120 additions & 46 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6834,7 +6834,7 @@ components:
description: A case
properties:
attributes:
$ref: '#/components/schemas/CaseAttributes'
$ref: '#/components/schemas/CaseResourceAttributes'
id:
description: Case's identifier
example: aeadc05e-98a8-11ec-ac2c-da7ad0900001
Expand Down Expand Up @@ -6892,52 +6892,11 @@ components:
- data
type: object
CaseAttributes:
description: Case attributes
properties:
archived_at:
description: Timestamp of when the case was archived
format: date-time
nullable: true
readOnly: true
type: string
closed_at:
description: Timestamp of when the case was closed
format: date-time
nullable: true
readOnly: true
type: string
created_at:
description: Timestamp of when the case was created
format: date-time
readOnly: true
type: string
description:
description: Description
type: string
jira_issue:
$ref: '#/components/schemas/JiraIssue'
key:
description: Key
example: CASEM-4523
type: string
modified_at:
description: Timestamp of when the case was last modified
format: date-time
nullable: true
readOnly: true
type: string
priority:
$ref: '#/components/schemas/CasePriority'
service_now_ticket:
$ref: '#/components/schemas/ServiceNowTicket'
status:
$ref: '#/components/schemas/CaseStatus'
title:
description: Title
example: Memory leak investigation on API
additionalProperties:
items:
type: string
type:
$ref: '#/components/schemas/CaseType'
type: array
description: The definition of `CaseAttributes` object.
type: object
CaseCreate:
description: Case creation data
Expand Down Expand Up @@ -7035,6 +6994,56 @@ components:
project:
$ref: '#/components/schemas/ProjectRelationship'
type: object
CaseResourceAttributes:
description: Case resource attributes
properties:
archived_at:
description: Timestamp of when the case was archived
format: date-time
nullable: true
readOnly: true
type: string
attributes:
$ref: '#/components/schemas/CaseAttributes'
closed_at:
description: Timestamp of when the case was closed
format: date-time
nullable: true
readOnly: true
type: string
created_at:
description: Timestamp of when the case was created
format: date-time
readOnly: true
type: string
description:
description: Description
type: string
jira_issue:
$ref: '#/components/schemas/JiraIssue'
key:
description: Key
example: CASEM-4523
type: string
modified_at:
description: Timestamp of when the case was last modified
format: date-time
nullable: true
readOnly: true
type: string
priority:
$ref: '#/components/schemas/CasePriority'
service_now_ticket:
$ref: '#/components/schemas/ServiceNowTicket'
status:
$ref: '#/components/schemas/CaseStatus'
title:
description: Title
example: Memory leak investigation on API
type: string
type:
$ref: '#/components/schemas/CaseType'
type: object
CaseResourceType:
default: case
description: Case resource type
Expand Down Expand Up @@ -7099,6 +7108,33 @@ components:
type: string
x-enum-varnames:
- STANDARD
CaseUpdateAttributes:
description: Case update attributes
properties:
attributes:
$ref: '#/components/schemas/CaseUpdateAttributesAttributes'
type:
$ref: '#/components/schemas/CaseResourceType'
required:
- attributes
- type
type: object
CaseUpdateAttributesAttributes:
description: Case update attributes attributes
properties:
attributes:
$ref: '#/components/schemas/CaseAttributes'
required:
- attributes
type: object
CaseUpdateAttributesRequest:
description: Case update attributes request
properties:
data:
$ref: '#/components/schemas/CaseUpdateAttributes'
required:
- data
type: object
CaseUpdatePriority:
description: Case priority status
properties:
Expand Down Expand Up @@ -45529,6 +45565,44 @@ paths:
summary: Assign case
tags:
- Case Management
/api/v2/cases/{case_id}/attributes:
post:
description: Update case attributes
operationId: UpdateAttributes
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CaseUpdateAttributesRequest'
description: Case attributes update payload
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CaseResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Update case attributes
tags:
- Case Management
/api/v2/cases/{case_id}/priority:
post:
description: Update case priority
Expand Down
33 changes: 33 additions & 0 deletions examples/v2_case-management_UpdateAttributes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Update case attributes returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_case_management::CaseManagementAPI;
use datadog_api_client::datadogV2::model::CaseResourceType;
use datadog_api_client::datadogV2::model::CaseUpdateAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateAttributesAttributes;
use datadog_api_client::datadogV2::model::CaseUpdateAttributesRequest;
use std::collections::BTreeMap;

#[tokio::main]
async fn main() {
// there is a valid "case" in the system
let case_id = std::env::var("CASE_ID").unwrap();
let body = CaseUpdateAttributesRequest::new(CaseUpdateAttributes::new(
CaseUpdateAttributesAttributes::new(BTreeMap::from([
("env".to_string(), vec!["test".to_string()]),
(
"service".to_string(),
vec!["web-store".to_string(), "web-api".to_string()],
),
("team".to_string(), vec!["engineer".to_string()]),
])),
CaseResourceType::CASE,
));
let configuration = datadog::Configuration::new();
let api = CaseManagementAPI::with_config(configuration);
let resp = api.update_attributes(case_id.clone(), body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading