Skip to content

Commit 637198a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add flexible status_name support for Case Management API (#3295)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 80e7f5a commit 637198a

9 files changed

Lines changed: 89 additions & 9 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9229,6 +9229,10 @@ components:
92299229
$ref: '#/components/schemas/ServiceNowTicket'
92309230
status:
92319231
$ref: '#/components/schemas/CaseStatus'
9232+
status_group:
9233+
$ref: '#/components/schemas/CaseStatusGroup'
9234+
status_name:
9235+
$ref: '#/components/schemas/CaseStatusName'
92329236
title:
92339237
description: Title
92349238
example: Memory leak investigation on API
@@ -9295,6 +9299,8 @@ components:
92959299
type: string
92969300
priority:
92979301
$ref: '#/components/schemas/CasePriority'
9302+
status_name:
9303+
$ref: '#/components/schemas/CaseStatusName'
92989304
title:
92999305
description: Title
93009306
example: Security breach investigation
@@ -9463,7 +9469,9 @@ components:
94639469
- PRIORITY
94649470
- STATUS
94659471
CaseStatus:
9466-
description: Case status
9472+
deprecated: true
9473+
description: Deprecated way of representing the case status, which only supports
9474+
OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
94679475
enum:
94689476
- OPEN
94699477
- IN_PROGRESS
@@ -9474,6 +9482,23 @@ components:
94749482
- OPEN
94759483
- IN_PROGRESS
94769484
- CLOSED
9485+
CaseStatusGroup:
9486+
description: Status group of the case.
9487+
enum:
9488+
- SG_OPEN
9489+
- SG_IN_PROGRESS
9490+
- SG_CLOSED
9491+
example: SG_OPEN
9492+
type: string
9493+
x-enum-varnames:
9494+
- SG_OPEN
9495+
- SG_IN_PROGRESS
9496+
- SG_CLOSED
9497+
CaseStatusName:
9498+
description: Status of the case. Must be one of the existing statuses for the
9499+
case's type.
9500+
example: Open
9501+
type: string
94779502
CaseTrigger:
94789503
description: Trigger a workflow from a Case. For automatic triggering a handle
94799504
must be configured and the workflow must be published.
@@ -9697,8 +9722,9 @@ components:
96979722
properties:
96989723
status:
96999724
$ref: '#/components/schemas/CaseStatus'
9700-
required:
9701-
- status
9725+
deprecated: true
9726+
status_name:
9727+
$ref: '#/components/schemas/CaseStatusName'
97029728
type: object
97039729
CaseUpdateStatusRequest:
97049730
description: Case update status request

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,7 @@ export { CasesResponse } from "./models/CasesResponse";
14851485
export { CasesResponseMeta } from "./models/CasesResponseMeta";
14861486
export { CasesResponseMetaPagination } from "./models/CasesResponseMetaPagination";
14871487
export { CaseStatus } from "./models/CaseStatus";
1488+
export { CaseStatusGroup } from "./models/CaseStatusGroup";
14881489
export { CaseTrigger } from "./models/CaseTrigger";
14891490
export { CaseTriggerWrapper } from "./models/CaseTriggerWrapper";
14901491
export { CaseType } from "./models/CaseType";

packages/datadog-api-client-v2/models/CaseAttributes.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
import { CasePriority } from "./CasePriority";
77
import { CaseStatus } from "./CaseStatus";
8+
import { CaseStatusGroup } from "./CaseStatusGroup";
89
import { CaseType } from "./CaseType";
910
import { CustomAttributeValue } from "./CustomAttributeValue";
1011
import { JiraIssue } from "./JiraIssue";
@@ -61,9 +62,17 @@ export class CaseAttributes {
6162
*/
6263
"serviceNowTicket"?: ServiceNowTicket;
6364
/**
64-
* Case status
65+
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
6566
*/
6667
"status"?: CaseStatus;
68+
/**
69+
* Status group of the case.
70+
*/
71+
"statusGroup"?: CaseStatusGroup;
72+
/**
73+
* Status of the case. Must be one of the existing statuses for the case's type.
74+
*/
75+
"statusName"?: string;
6776
/**
6877
* Title
6978
*/
@@ -145,6 +154,14 @@ export class CaseAttributes {
145154
baseName: "status",
146155
type: "CaseStatus",
147156
},
157+
statusGroup: {
158+
baseName: "status_group",
159+
type: "CaseStatusGroup",
160+
},
161+
statusName: {
162+
baseName: "status_name",
163+
type: "string",
164+
},
148165
title: {
149166
baseName: "title",
150167
type: "string",

packages/datadog-api-client-v2/models/CaseCreateAttributes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ export class CaseCreateAttributes {
2424
* Case priority
2525
*/
2626
"priority"?: CasePriority;
27+
/**
28+
* Status of the case. Must be one of the existing statuses for the case's type.
29+
*/
30+
"statusName"?: string;
2731
/**
2832
* Title
2933
*/
@@ -61,6 +65,10 @@ export class CaseCreateAttributes {
6165
baseName: "priority",
6266
type: "CasePriority",
6367
},
68+
statusName: {
69+
baseName: "status_name",
70+
type: "string",
71+
},
6472
title: {
6573
baseName: "title",
6674
type: "string",

packages/datadog-api-client-v2/models/CaseStatus.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { UnparsedObject } from "../../datadog-api-client-common/util";
88

99
/**
10-
* Case status
10+
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
1111
*/
1212

1313
export type CaseStatus =
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* Status group of the case.
11+
*/
12+
13+
export type CaseStatusGroup =
14+
| typeof SG_OPEN
15+
| typeof SG_IN_PROGRESS
16+
| typeof SG_CLOSED
17+
| UnparsedObject;
18+
export const SG_OPEN = "SG_OPEN";
19+
export const SG_IN_PROGRESS = "SG_IN_PROGRESS";
20+
export const SG_CLOSED = "SG_CLOSED";

packages/datadog-api-client-v2/models/CaseUpdateStatusAttributes.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1212
*/
1313
export class CaseUpdateStatusAttributes {
1414
/**
15-
* Case status
15+
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
1616
*/
17-
"status": CaseStatus;
17+
"status"?: CaseStatus;
18+
/**
19+
* Status of the case. Must be one of the existing statuses for the case's type.
20+
*/
21+
"statusName"?: string;
1822

1923
/**
2024
* A container for additional, undeclared properties.
@@ -35,7 +39,10 @@ export class CaseUpdateStatusAttributes {
3539
status: {
3640
baseName: "status",
3741
type: "CaseStatus",
38-
required: true,
42+
},
43+
statusName: {
44+
baseName: "status_name",
45+
type: "string",
3946
},
4047
additionalProperties: {
4148
baseName: "additionalProperties",

packages/datadog-api-client-v2/models/IssueCaseAttributes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class IssueCaseAttributes {
5959
*/
6060
"priority"?: CasePriority;
6161
/**
62-
* Case status
62+
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
6363
*/
6464
"status"?: CaseStatus;
6565
/**

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3273,6 +3273,7 @@ const enumsMap: { [key: string]: any[] } = {
32733273
CaseResourceType: ["case"],
32743274
CaseSortableField: ["created_at", "priority", "status"],
32753275
CaseStatus: ["OPEN", "IN_PROGRESS", "CLOSED"],
3276+
CaseStatusGroup: ["SG_OPEN", "SG_IN_PROGRESS", "SG_CLOSED"],
32763277
CaseType: ["STANDARD"],
32773278
CaseTypeResourceType: ["case_type"],
32783279
ChangeEventAttributesAuthorType: ["user", "system", "api", "automation"],

0 commit comments

Comments
 (0)