Skip to content

Commit dd1d78d

Browse files
api-clients-generation-pipeline[bot]jirikuncarci.datadog-api-spec
authored
Add nullable user relationships to incidents and use this relationship schema for commander_user (#495)
* Support required nullable fields * Regenerate client from commit 79cdf99 of spec repo Co-authored-by: Jiri Kuncar <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 75b2a6c commit dd1d78d

File tree

35 files changed

+830
-221
lines changed

35 files changed

+830
-221
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.6.2",
7-
"regenerated": "2022-02-17 16:25:53.342075",
8-
"spec_repo_commit": "3d3ffe1"
7+
"regenerated": "2022-02-18 09:34:45.987117",
8+
"spec_repo_commit": "79cdf99"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.2",
12-
"regenerated": "2022-02-17 16:25:53.359066",
13-
"spec_repo_commit": "3d3ffe1"
12+
"regenerated": "2022-02-18 09:34:46.007155",
13+
"spec_repo_commit": "79cdf99"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,10 +1431,10 @@ components:
14311431
description: The relationships the incident will have with other resources once
14321432
created.
14331433
properties:
1434-
commander:
1435-
$ref: '#/components/schemas/RelationshipToUser'
1434+
commander_user:
1435+
$ref: '#/components/schemas/NullableRelationshipToUser'
14361436
required:
1437-
- commander
1437+
- commander_user
14381438
type: object
14391439
IncidentCreateRequest:
14401440
description: Create request for an incident.
@@ -1718,7 +1718,7 @@ components:
17181718
description: The incident's relationships from a response.
17191719
properties:
17201720
commander_user:
1721-
$ref: '#/components/schemas/RelationshipToUser'
1721+
$ref: '#/components/schemas/NullableRelationshipToUser'
17221722
created_by_user:
17231723
$ref: '#/components/schemas/RelationshipToUser'
17241724
integrations:
@@ -2165,13 +2165,9 @@ components:
21652165
description: The incident's relationships for an update request.
21662166
properties:
21672167
commander_user:
2168-
$ref: '#/components/schemas/RelationshipToUser'
2169-
created_by_user:
2170-
$ref: '#/components/schemas/RelationshipToUser'
2168+
$ref: '#/components/schemas/NullableRelationshipToUser'
21712169
integrations:
21722170
$ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas'
2173-
last_modified_by_user:
2174-
$ref: '#/components/schemas/RelationshipToUser'
21752171
postmortem:
21762172
$ref: '#/components/schemas/RelationshipToIncidentPostmortem'
21772173
type: object
@@ -3938,6 +3934,28 @@ components:
39383934
type: array
39393935
readOnly: true
39403936
type: object
3937+
NullableRelationshipToUser:
3938+
description: Relationship to user.
3939+
properties:
3940+
data:
3941+
$ref: '#/components/schemas/NullableRelationshipToUserData'
3942+
required:
3943+
- data
3944+
type: object
3945+
NullableRelationshipToUserData:
3946+
description: Relationship to user object.
3947+
nullable: true
3948+
properties:
3949+
id:
3950+
description: A unique identifier that represents the user.
3951+
example: 00000000-0000-0000-0000-000000000000
3952+
type: string
3953+
type:
3954+
$ref: '#/components/schemas/UsersType'
3955+
required:
3956+
- id
3957+
- type
3958+
type: object
39413959
Organization:
39423960
description: Organization object.
39433961
properties:
@@ -7145,6 +7163,7 @@ paths:
71457163
operationId: UpdateIncident
71467164
parameters:
71477165
- $ref: '#/components/parameters/IncidentIDPathParameter'
7166+
- $ref: '#/components/parameters/IncidentIncludeQueryParameter'
71487167
requestBody:
71497168
content:
71507169
application/json:

.generator/templates/model/model.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
2020
* {{{.}}}
2121
*/
2222
{{/description}}
23-
'{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}};
23+
'{{name}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#required}}{{#isNullable}}|null{{/isNullable}}{{/required}};
2424
{{/vars}}
2525

2626
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"2022-01-25T11:40:13.065Z"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
{
2+
"log": {
3+
"_recordingName": "Incidents/Add commander to an incident returns \"OK\" response",
4+
"creator": {
5+
"comment": "persister:fs",
6+
"name": "Polly.JS",
7+
"version": "5.1.1"
8+
},
9+
"entries": [
10+
{
11+
"_id": "4e46d8a7f0d3c71cb01316a39860fabc",
12+
"_order": 0,
13+
"cache": {},
14+
"request": {
15+
"bodySize": 150,
16+
"cookies": [],
17+
"headers": [
18+
{
19+
"_fromType": "array",
20+
"name": "accept",
21+
"value": "application/json"
22+
},
23+
{
24+
"_fromType": "array",
25+
"name": "content-type",
26+
"value": "application/json"
27+
}
28+
],
29+
"headersSize": 550,
30+
"httpVersion": "HTTP/1.1",
31+
"method": "POST",
32+
"postData": {
33+
"mimeType": "application/json",
34+
"params": [],
35+
"text": "{\"data\":{\"attributes\":{\"email\":\"Test-Add_commander_to_an_incident_returns_OK_response-1643110813@datadoghq.com\",\"title\":\"user title\"},\"type\":\"users\"}}"
36+
},
37+
"queryString": [],
38+
"url": "https://api.datadoghq.com/api/v2/users"
39+
},
40+
"response": {
41+
"bodySize": 700,
42+
"content": {
43+
"mimeType": "application/json",
44+
"size": 700,
45+
"text": "{\"data\":{\"type\":\"users\",\"id\":\"8f3adc92-7dd3-11ec-bbe9-da7ad0900002\",\"attributes\":{\"name\":null,\"handle\":\"test-add_commander_to_an_incident_returns_ok_response-1643110813@datadoghq.com\",\"created_at\":\"2022-01-25T11:40:13.619632+00:00\",\"modified_at\":\"2022-01-25T11:40:13.676356+00:00\",\"email\":\"test-add_commander_to_an_incident_returns_ok_response-1643110813@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/40c635f8302d5755155545960d3b24a9?s=48&d=retro\",\"title\":\"user title\",\"verified\":false,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Pending\"},\"relationships\":{\"roles\":{\"data\":[]},\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}}"
46+
},
47+
"cookies": [],
48+
"headers": [
49+
{
50+
"name": "content-type",
51+
"value": "application/json"
52+
}
53+
],
54+
"headersSize": 383,
55+
"httpVersion": "HTTP/1.1",
56+
"redirectURL": "",
57+
"status": 201,
58+
"statusText": "Created"
59+
},
60+
"startedDateTime": "2022-01-25T11:40:13.078Z",
61+
"time": 546
62+
},
63+
{
64+
"_id": "a43a149f056ccd9f865a7108cd222f60",
65+
"_order": 0,
66+
"cache": {},
67+
"request": {
68+
"bodySize": 145,
69+
"cookies": [],
70+
"headers": [
71+
{
72+
"_fromType": "array",
73+
"name": "accept",
74+
"value": "application/json"
75+
},
76+
{
77+
"_fromType": "array",
78+
"name": "content-type",
79+
"value": "application/json"
80+
}
81+
],
82+
"headersSize": 558,
83+
"httpVersion": "HTTP/1.1",
84+
"method": "POST",
85+
"postData": {
86+
"mimeType": "application/json",
87+
"params": [],
88+
"text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Add_commander_to_an_incident_returns_OK_response-1643110813\"},\"type\":\"incidents\"}}"
89+
},
90+
"queryString": [],
91+
"url": "https://api.datadoghq.com/api/v2/incidents"
92+
},
93+
"response": {
94+
"bodySize": 2619,
95+
"content": {
96+
"mimeType": "application/json",
97+
"size": 2619,
98+
"text": "{\"data\":{\"type\":\"incidents\",\"id\":\"14233fcb-9927-547c-bbdb-dacf71aa2726\",\"attributes\":{\"public_id\":88131,\"title\":\"Test-Add_commander_to_an_incident_returns_OK_response-1643110813\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2022-01-25T11:40:14.171967+00:00\",\"modified\":\"2022-01-25T11:40:14.171967+00:00\",\"commander\":null,\"detected\":\"2022-01-25T11:40:14.161476+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"public\"},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]}}}}"
99+
},
100+
"cookies": [],
101+
"headers": [
102+
{
103+
"name": "content-type",
104+
"value": "application/json"
105+
}
106+
],
107+
"headersSize": 532,
108+
"httpVersion": "HTTP/1.1",
109+
"redirectURL": "",
110+
"status": 201,
111+
"statusText": "Created"
112+
},
113+
"startedDateTime": "2022-01-25T11:40:13.631Z",
114+
"time": 686
115+
},
116+
{
117+
"_id": "c728c011e6246ccaf95d7d94d65c6c2a",
118+
"_order": 0,
119+
"cache": {},
120+
"request": {
121+
"bodySize": 178,
122+
"cookies": [],
123+
"headers": [
124+
{
125+
"_fromType": "array",
126+
"name": "accept",
127+
"value": "application/json"
128+
},
129+
{
130+
"_fromType": "array",
131+
"name": "content-type",
132+
"value": "application/json"
133+
}
134+
],
135+
"headersSize": 596,
136+
"httpVersion": "HTTP/1.1",
137+
"method": "PATCH",
138+
"postData": {
139+
"mimeType": "application/json",
140+
"params": [],
141+
"text": "{\"data\":{\"id\":\"14233fcb-9927-547c-bbdb-dacf71aa2726\",\"relationships\":{\"commander_user\":{\"data\":{\"id\":\"8f3adc92-7dd3-11ec-bbe9-da7ad0900002\",\"type\":\"users\"}}},\"type\":\"incidents\"}}"
142+
},
143+
"queryString": [],
144+
"url": "https://api.datadoghq.com/api/v2/incidents/14233fcb-9927-547c-bbdb-dacf71aa2726"
145+
},
146+
"response": {
147+
"bodySize": 3243,
148+
"content": {
149+
"mimeType": "application/json",
150+
"size": 3243,
151+
"text": "{\"data\":{\"type\":\"incidents\",\"id\":\"14233fcb-9927-547c-bbdb-dacf71aa2726\",\"attributes\":{\"public_id\":88131,\"title\":\"Test-Add_commander_to_an_incident_returns_OK_response-1643110813\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"created\":\"2022-01-25T11:40:14.171967+00:00\",\"modified\":\"2022-01-25T11:40:15.822801+00:00\",\"commander\":{\"data\":{\"type\":\"users\",\"id\":\"8f3adc92-7dd3-11ec-bbe9-da7ad0900002\",\"attributes\":{\"uuid\":\"8f3adc92-7dd3-11ec-bbe9-da7ad0900002\",\"handle\":\"test-add_commander_to_an_incident_returns_ok_response-1643110813@datadoghq.com\",\"email\":\"test-add_commander_to_an_incident_returns_ok_response-1643110813@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/40c635f8302d5755155545960d3b24a9?s=48&d=retro\"}}},\"detected\":\"2022-01-25T11:40:14.161476+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"public\"},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[{\"type\":\"incident_responders\",\"id\":\"3b463d7b-23f6-505b-89ea-e754d385dd3c\"},{\"type\":\"incident_responders\",\"id\":\"b2354174-e8cf-5f7d-8563-462fa73dc347\"}]}}}}"
152+
},
153+
"cookies": [],
154+
"headers": [
155+
{
156+
"name": "content-type",
157+
"value": "application/json"
158+
}
159+
],
160+
"headersSize": 527,
161+
"httpVersion": "HTTP/1.1",
162+
"redirectURL": "",
163+
"status": 200,
164+
"statusText": "OK"
165+
},
166+
"startedDateTime": "2022-01-25T11:40:14.321Z",
167+
"time": 1672
168+
},
169+
{
170+
"_id": "a189e83fa3c94d8b5953fdaebf044e64",
171+
"_order": 0,
172+
"cache": {},
173+
"request": {
174+
"bodySize": 0,
175+
"cookies": [],
176+
"headers": [
177+
{
178+
"_fromType": "array",
179+
"name": "accept",
180+
"value": "application/json"
181+
}
182+
],
183+
"headersSize": 544,
184+
"httpVersion": "HTTP/1.1",
185+
"method": "DELETE",
186+
"queryString": [],
187+
"url": "https://api.datadoghq.com/api/v2/incidents/14233fcb-9927-547c-bbdb-dacf71aa2726"
188+
},
189+
"response": {
190+
"bodySize": 0,
191+
"content": {
192+
"mimeType": "text/plain",
193+
"size": 0
194+
},
195+
"cookies": [],
196+
"headers": [],
197+
"headersSize": 474,
198+
"httpVersion": "HTTP/1.1",
199+
"redirectURL": "",
200+
"status": 204,
201+
"statusText": "No Content"
202+
},
203+
"startedDateTime": "2022-01-25T11:40:16.001Z",
204+
"time": 697
205+
},
206+
{
207+
"_id": "b0c3a3524413a7442058bbb621a368bf",
208+
"_order": 0,
209+
"cache": {},
210+
"request": {
211+
"bodySize": 0,
212+
"cookies": [],
213+
"headers": [
214+
{
215+
"_fromType": "array",
216+
"name": "accept",
217+
"value": "application/json"
218+
}
219+
],
220+
"headersSize": 537,
221+
"httpVersion": "HTTP/1.1",
222+
"method": "DELETE",
223+
"queryString": [],
224+
"url": "https://api.datadoghq.com/api/v2/users/8f3adc92-7dd3-11ec-bbe9-da7ad0900002"
225+
},
226+
"response": {
227+
"bodySize": 0,
228+
"content": {
229+
"mimeType": "text/plain",
230+
"size": 0
231+
},
232+
"cookies": [],
233+
"headers": [],
234+
"headersSize": 330,
235+
"httpVersion": "HTTP/1.1",
236+
"redirectURL": "",
237+
"status": 204,
238+
"statusText": "No Content"
239+
},
240+
"startedDateTime": "2022-01-25T11:40:16.702Z",
241+
"time": 583
242+
}
243+
],
244+
"pages": [],
245+
"version": "1.2"
246+
}
247+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2021-04-14T15:12:38.251Z"
1+
"2022-01-22T09:45:38.207Z"

0 commit comments

Comments
 (0)