Skip to content

Commit 0ff8193

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 092b505 of spec repo (#249)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 1e311eb commit 0ff8193

File tree

9 files changed

+129
-30
lines changed

9 files changed

+129
-30
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev11",
7-
"regenerated": "2021-08-17 12:44:47.761651",
8-
"spec_repo_commit": "20a3ffe"
7+
"regenerated": "2021-08-18 07:46:50.698563",
8+
"spec_repo_commit": "092b505"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev11",
12-
"regenerated": "2021-08-17 12:46:13.727948",
13-
"spec_repo_commit": "20a3ffe"
12+
"regenerated": "2021-08-18 07:48:04.336588",
13+
"spec_repo_commit": "092b505"
1414
}
1515
}
1616
}

docs/v2/IncidentsApi.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ let params:v2.IncidentsApiCreateIncidentRequest = {
3838
value: "SEV-1",
3939
},
4040
},
41-
initialTimelineCells: [
41+
initialCells: [
4242
{
4343
cellType: "markdown",
4444
content: {
@@ -48,7 +48,10 @@ let params:v2.IncidentsApiCreateIncidentRequest = {
4848
},
4949
],
5050
notificationHandles: [
51-
51+
{
52+
displayName: "Jane Doe",
53+
handle: "@[email protected]",
54+
},
5255
],
5356
title: "A test incident title",
5457
},
@@ -324,7 +327,10 @@ let params:v2.IncidentsApiUpdateIncidentRequest = {
324327
},
325328
},
326329
notificationHandles: [
327-
330+
{
331+
displayName: "Jane Doe",
332+
handle: "@[email protected]",
333+
},
328334
],
329335
resolved: new Date('1970-01-01T00:00:00.00Z'),
330336
title: "A test incident title",

features/v2/incidents.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature: Incidents
1111
Scenario: Create an incident returns "Bad Request" response
1212
Given operation "CreateIncident" enabled
1313
And new "CreateIncident" request
14-
And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_timeline_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": ["@[email protected]"], "title": "A test incident title"}, "relationships": {"commander": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
14+
And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@[email protected]"}], "title": "A test incident title"}, "relationships": {"commander": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
1515
When the request is sent
1616
Then the response status is 400 Bad Request
1717

@@ -27,7 +27,7 @@ Feature: Incidents
2727
Scenario: Create an incident returns "Not Found" response
2828
Given operation "CreateIncident" enabled
2929
And new "CreateIncident" request
30-
And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_timeline_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": ["@[email protected]"], "title": "A test incident title"}, "relationships": {"commander": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
30+
And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@[email protected]"}], "title": "A test incident title"}, "relationships": {"commander": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}}
3131
When the request is sent
3232
Then the response status is 404 Not Found
3333

@@ -106,7 +106,7 @@ Feature: Incidents
106106
Given operation "UpdateIncident" enabled
107107
And new "UpdateIncident" request
108108
And request contains "incident_id" parameter from "<PATH>"
109-
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": ["@[email protected]"], "resolved": null, "title": "A test incident title"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "created_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}]}, "last_modified_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "postmortem": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
109+
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@[email protected]"}], "resolved": null, "title": "A test incident title"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "created_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}]}, "last_modified_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "postmortem": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
110110
When the request is sent
111111
Then the response status is 400 Bad Request
112112

@@ -115,7 +115,7 @@ Feature: Incidents
115115
Given operation "UpdateIncident" enabled
116116
And new "UpdateIncident" request
117117
And request contains "incident_id" parameter from "<PATH>"
118-
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": ["@[email protected]"], "resolved": null, "title": "A test incident title"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "created_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}]}, "last_modified_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "postmortem": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
118+
And body with value {"data": {"attributes": {"customer_impact_end": null, "customer_impact_scope": "Example customer impact scope", "customer_impact_start": null, "customer_impacted": false, "detected": null, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "notification_handles": [{"display_name": "Jane Doe", "handle": "@[email protected]"}], "resolved": null, "title": "A test incident title"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "created_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "integrations": {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}, {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_integrations"}]}, "last_modified_by_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}, "postmortem": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_postmortems"}}}, "type": "incidents"}}
119119
When the request is sent
120120
Then the response status is 404 Not Found
121121

packages/datadog-api-client-v2/.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ models/IncidentFieldAttributesSingleValue.ts
8585
models/IncidentFieldAttributesSingleValueType.ts
8686
models/IncidentFieldAttributesValueType.ts
8787
models/IncidentIntegrationMetadataType.ts
88+
models/IncidentNotificationHandle.ts
8889
models/IncidentPostmortemType.ts
8990
models/IncidentRelatedObject.ts
9091
models/IncidentResponse.ts

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import { IncidentFieldAttributes } from "./IncidentFieldAttributes";
12+
import { IncidentNotificationHandle } from "./IncidentNotificationHandle";
1213
import { IncidentTimelineCellCreateAttributes } from "./IncidentTimelineCellCreateAttributes";
1314
import { ObjectSerializer } from "./ObjectSerializer";
1415

@@ -28,11 +29,11 @@ export class IncidentCreateAttributes {
2829
/**
2930
* An array of initial timeline cells to be placed at the beginning of the incident timeline.
3031
*/
31-
"initialTimelineCells"?: Array<IncidentTimelineCellCreateAttributes>;
32+
"initialCells"?: Array<IncidentTimelineCellCreateAttributes>;
3233
/**
3334
* Notification handles that will be notified of the incident at creation.
3435
*/
35-
"notificationHandles"?: Array<string>;
36+
"notificationHandles"?: Array<IncidentNotificationHandle>;
3637
/**
3738
* The title of the incident, which summarizes what happened.
3839
*/
@@ -55,14 +56,14 @@ export class IncidentCreateAttributes {
5556
type: "{ [key: string]: IncidentFieldAttributes; }",
5657
format: "",
5758
},
58-
initialTimelineCells: {
59-
baseName: "initial_timeline_cells",
59+
initialCells: {
60+
baseName: "initial_cells",
6061
type: "Array<IncidentTimelineCellCreateAttributes>",
6162
format: "",
6263
},
6364
notificationHandles: {
6465
baseName: "notification_handles",
65-
type: "Array<string>",
66+
type: "Array<IncidentNotificationHandle>",
6667
format: "",
6768
},
6869
title: {
@@ -96,15 +97,15 @@ export class IncidentCreateAttributes {
9697
""
9798
);
9899

99-
res.initialTimelineCells = ObjectSerializer.deserialize(
100-
data.initial_timeline_cells,
100+
res.initialCells = ObjectSerializer.deserialize(
101+
data.initial_cells,
101102
"Array<IncidentTimelineCellCreateAttributes>",
102103
""
103104
);
104105

105106
res.notificationHandles = ObjectSerializer.deserialize(
106107
data.notification_handles,
107-
"Array<string>",
108+
"Array<IncidentNotificationHandle>",
108109
""
109110
);
110111

@@ -146,15 +147,15 @@ export class IncidentCreateAttributes {
146147
""
147148
);
148149

149-
res.initial_timeline_cells = ObjectSerializer.serialize(
150-
data.initialTimelineCells,
150+
res.initial_cells = ObjectSerializer.serialize(
151+
data.initialCells,
151152
"Array<IncidentTimelineCellCreateAttributes>",
152153
""
153154
);
154155

155156
res.notification_handles = ObjectSerializer.serialize(
156157
data.notificationHandles,
157-
"Array<string>",
158+
"Array<IncidentNotificationHandle>",
158159
""
159160
);
160161

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
7+
* https://openapi-generator.tech
8+
* Do not edit the class manually.
9+
*/
10+
11+
import { ObjectSerializer } from "./ObjectSerializer";
12+
13+
/**
14+
* A notification handle that will be notified at incident creation.
15+
*/
16+
17+
export class IncidentNotificationHandle {
18+
/**
19+
* The name of the notified handle.
20+
*/
21+
"displayName"?: string;
22+
/**
23+
* The email address used for the notification.
24+
*/
25+
"handle"?: string;
26+
27+
"unparsedObject"?: any;
28+
29+
static readonly discriminator: string | undefined = undefined;
30+
31+
static readonly attributeTypeMap: {
32+
[key: string]: { baseName: string; type: string; format: string };
33+
} = {
34+
displayName: {
35+
baseName: "display_name",
36+
type: "string",
37+
format: "",
38+
},
39+
handle: {
40+
baseName: "handle",
41+
type: "string",
42+
format: "",
43+
},
44+
};
45+
46+
static getAttributeTypeMap() {
47+
return IncidentNotificationHandle.attributeTypeMap;
48+
}
49+
50+
static deserialize(data: { [key: string]: any }): IncidentNotificationHandle {
51+
const res = new IncidentNotificationHandle();
52+
53+
res.displayName = ObjectSerializer.deserialize(
54+
data.display_name,
55+
"string",
56+
""
57+
);
58+
59+
res.handle = ObjectSerializer.deserialize(data.handle, "string", "");
60+
61+
return res;
62+
}
63+
64+
static serialize(data: IncidentNotificationHandle): { [key: string]: any } {
65+
const attributeTypes = IncidentNotificationHandle.getAttributeTypeMap();
66+
const res: { [index: string]: any } = {};
67+
for (const [key, value] of Object.entries(data)) {
68+
if (!(key in attributeTypes)) {
69+
throw new TypeError(`${key} attribute not in schema`);
70+
}
71+
}
72+
if (data?.unparsedObject !== undefined) {
73+
return data.unparsedObject;
74+
}
75+
res.display_name = ObjectSerializer.serialize(
76+
data.displayName,
77+
"string",
78+
""
79+
);
80+
81+
res.handle = ObjectSerializer.serialize(data.handle, "string", "");
82+
83+
return res;
84+
}
85+
86+
public constructor() {}
87+
}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import { IncidentFieldAttributes } from "./IncidentFieldAttributes";
12+
import { IncidentNotificationHandle } from "./IncidentNotificationHandle";
1213
import { ObjectSerializer } from "./ObjectSerializer";
1314

1415
/**
@@ -55,7 +56,7 @@ export class IncidentResponseAttributes {
5556
/**
5657
* Notification handles that will be notified of the incident during update.
5758
*/
58-
"notificationHandles"?: Array<string>;
59+
"notificationHandles"?: Array<IncidentNotificationHandle>;
5960
/**
6061
* The UUID of the postmortem object attached to the incident.
6162
*/
@@ -143,7 +144,7 @@ export class IncidentResponseAttributes {
143144
},
144145
notificationHandles: {
145146
baseName: "notification_handles",
146-
type: "Array<string>",
147+
type: "Array<IncidentNotificationHandle>",
147148
format: "",
148149
},
149150
postmortemId: {
@@ -251,7 +252,7 @@ export class IncidentResponseAttributes {
251252

252253
res.notificationHandles = ObjectSerializer.deserialize(
253254
data.notification_handles,
254-
"Array<string>",
255+
"Array<IncidentNotificationHandle>",
255256
""
256257
);
257258

@@ -370,7 +371,7 @@ export class IncidentResponseAttributes {
370371

371372
res.notification_handles = ObjectSerializer.serialize(
372373
data.notificationHandles,
373-
"Array<string>",
374+
"Array<IncidentNotificationHandle>",
374375
""
375376
);
376377

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
import { IncidentFieldAttributes } from "./IncidentFieldAttributes";
12+
import { IncidentNotificationHandle } from "./IncidentNotificationHandle";
1213
import { ObjectSerializer } from "./ObjectSerializer";
1314

1415
/**
@@ -43,7 +44,7 @@ export class IncidentUpdateAttributes {
4344
/**
4445
* Notification handles that will be notified of the incident during update.
4546
*/
46-
"notificationHandles"?: Array<string>;
47+
"notificationHandles"?: Array<IncidentNotificationHandle>;
4748
/**
4849
* Timestamp when the incident's state was set to resolved.
4950
*/
@@ -92,7 +93,7 @@ export class IncidentUpdateAttributes {
9293
},
9394
notificationHandles: {
9495
baseName: "notification_handles",
95-
type: "Array<string>",
96+
type: "Array<IncidentNotificationHandle>",
9697
format: "",
9798
},
9899
resolved: {
@@ -152,7 +153,7 @@ export class IncidentUpdateAttributes {
152153

153154
res.notificationHandles = ObjectSerializer.deserialize(
154155
data.notification_handles,
155-
"Array<string>",
156+
"Array<IncidentNotificationHandle>",
156157
""
157158
);
158159

@@ -216,7 +217,7 @@ export class IncidentUpdateAttributes {
216217

217218
res.notification_handles = ObjectSerializer.serialize(
218219
data.notificationHandles,
219-
"Array<string>",
220+
"Array<IncidentNotificationHandle>",
220221
""
221222
);
222223

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { IncidentCreateRelationships } from "./IncidentCreateRelationships";
3737
import { IncidentCreateRequest } from "./IncidentCreateRequest";
3838
import { IncidentFieldAttributesMultipleValue } from "./IncidentFieldAttributesMultipleValue";
3939
import { IncidentFieldAttributesSingleValue } from "./IncidentFieldAttributesSingleValue";
40+
import { IncidentNotificationHandle } from "./IncidentNotificationHandle";
4041
import { IncidentResponse } from "./IncidentResponse";
4142
import { IncidentResponseAttributes } from "./IncidentResponseAttributes";
4243
import { IncidentResponseData } from "./IncidentResponseData";
@@ -365,6 +366,7 @@ const typeMap: { [index: string]: any } = {
365366
IncidentCreateRequest: IncidentCreateRequest,
366367
IncidentFieldAttributesMultipleValue: IncidentFieldAttributesMultipleValue,
367368
IncidentFieldAttributesSingleValue: IncidentFieldAttributesSingleValue,
369+
IncidentNotificationHandle: IncidentNotificationHandle,
368370
IncidentResponse: IncidentResponse,
369371
IncidentResponseAttributes: IncidentResponseAttributes,
370372
IncidentResponseData: IncidentResponseData,

0 commit comments

Comments
 (0)