Skip to content
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
863 changes: 863 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions examples/v2/incidents/CreateIncidentUserDefinedField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* Create an incident user-defined field returns "CREATED" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.createIncidentUserDefinedField"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiCreateIncidentUserDefinedFieldRequest = {
body: {
data: {
attributes: {
category: "what_happened",
collected: "active",
defaultValue: "critical",
displayName: "Root Cause",
name: "root_cause",
ordinal: "1.5",
required: false,
tagKey: "datacenter",
type: 3,
validValues: [
{
description: "A critical severity incident.",
displayName: "Critical",
shortDescription: "Critical",
value: "critical",
},
],
},
relationships: {
incidentType: {
data: {
id: "00000000-0000-0000-0000-000000000000",
type: "incident_types",
},
},
},
type: "user_defined_field",
},
},
};

apiInstance
.createIncidentUserDefinedField(params)
.then((data: v2.IncidentUserDefinedFieldResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/incidents/DeleteIncidentUserDefinedField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Delete an incident user-defined field returns "No Content" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.deleteIncidentUserDefinedField"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiDeleteIncidentUserDefinedFieldRequest = {
fieldId: "00000000-0000-0000-0000-000000000000",
};

apiInstance
.deleteIncidentUserDefinedField(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
22 changes: 22 additions & 0 deletions examples/v2/incidents/GetIncidentUserDefinedField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Get an incident user-defined field returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getIncidentUserDefinedField"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiGetIncidentUserDefinedFieldRequest = {
fieldId: "00000000-0000-0000-0000-000000000000",
};

apiInstance
.getIncidentUserDefinedField(params)
.then((data: v2.IncidentUserDefinedFieldResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
18 changes: 18 additions & 0 deletions examples/v2/incidents/ListIncidentUserDefinedFields.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Get a list of incident user-defined fields returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listIncidentUserDefinedFields"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

apiInstance
.listIncidentUserDefinedFields()
.then((data: v2.IncidentUserDefinedFieldListResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
44 changes: 44 additions & 0 deletions examples/v2/incidents/UpdateIncidentUserDefinedField.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Update an incident user-defined field returns "OK" response
*/

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.updateIncidentUserDefinedField"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiUpdateIncidentUserDefinedFieldRequest = {
body: {
data: {
attributes: {
category: "what_happened",
collected: "active",
defaultValue: "critical",
displayName: "Root Cause",
ordinal: "1.5",
required: false,
validValues: [
{
description: "A critical severity incident.",
displayName: "Critical",
shortDescription: "Critical",
value: "critical",
},
],
},
id: "00000000-0000-0000-0000-000000000000",
type: "user_defined_field",
},
},
fieldId: "00000000-0000-0000-0000-000000000000",
};

apiInstance
.updateIncidentUserDefinedField(params)
.then((data: v2.IncidentUserDefinedFieldResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
67 changes: 67 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6566,6 +6566,73 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
},
"operationResponseType": "IncidentTypeResponse",
},
"v2.ListIncidentUserDefinedFields": {
"pageSize": {
"type": "number",
"format": "int64",
},
"pageNumber": {
"type": "number",
"format": "int64",
},
"includeDeleted": {
"type": "boolean",
"format": "",
},
"filterIncidentType": {
"type": "string",
"format": "",
},
"include": {
"type": "string",
"format": "",
},
"operationResponseType": "IncidentUserDefinedFieldListResponse",
},
"v2.CreateIncidentUserDefinedField": {
"include": {
"type": "string",
"format": "",
},
"body": {
"type": "IncidentUserDefinedFieldCreateRequest",
"format": "",
},
"operationResponseType": "IncidentUserDefinedFieldResponse",
},
"v2.GetIncidentUserDefinedField": {
"fieldId": {
"type": "string",
"format": "",
},
"include": {
"type": "string",
"format": "",
},
"operationResponseType": "IncidentUserDefinedFieldResponse",
},
"v2.DeleteIncidentUserDefinedField": {
"fieldId": {
"type": "string",
"format": "",
},
"operationResponseType": "{}",
},
"v2.UpdateIncidentUserDefinedField": {
"fieldId": {
"type": "string",
"format": "",
},
"include": {
"type": "string",
"format": "",
},
"body": {
"type": "IncidentUserDefinedFieldUpdateRequest",
"format": "",
},
"operationResponseType": "IncidentUserDefinedFieldResponse",
},
"v2.ImportIncident": {
"include": {
"type": "Array<IncidentImportRelatedObject>",
Expand Down
105 changes: 105 additions & 0 deletions features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,30 @@ Feature: Incidents
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/incident-app
Scenario: Create an incident user-defined field returns "Bad Request" response
Given operation "CreateIncidentUserDefinedField" enabled
And new "CreateIncidentUserDefinedField" request
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Create an incident user-defined field returns "CREATED" response
Given operation "CreateIncidentUserDefinedField" enabled
And new "CreateIncidentUserDefinedField" request
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}}
When the request is sent
Then the response status is 201 CREATED

@generated @skip @team:DataDog/incident-app
Scenario: Create an incident user-defined field returns "Not Found" response
Given operation "CreateIncidentUserDefinedField" enabled
And new "CreateIncidentUserDefinedField" request
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "name": "root_cause", "ordinal": "1.5", "required": false, "tag_key": "datacenter", "type": 3, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "incident_types"}}}, "type": "user_defined_field"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/incident-app
Scenario: Create global incident handle returns "Bad Request" response
Given operation "CreateGlobalIncidentHandle" enabled
Expand Down Expand Up @@ -482,6 +506,30 @@ Feature: Incidents
When the request is sent
Then the response status is 204 OK

@generated @skip @team:DataDog/incident-app
Scenario: Delete an incident user-defined field returns "Bad Request" response
Given operation "DeleteIncidentUserDefinedField" enabled
And new "DeleteIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Delete an incident user-defined field returns "No Content" response
Given operation "DeleteIncidentUserDefinedField" enabled
And new "DeleteIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 204 No Content

@generated @skip @team:DataDog/incident-app
Scenario: Delete an incident user-defined field returns "Not Found" response
Given operation "DeleteIncidentUserDefinedField" enabled
And new "DeleteIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/incident-app
Scenario: Delete global incident handle returns "Bad Request" response
Given operation "DeleteGlobalIncidentHandle" enabled
Expand Down Expand Up @@ -647,6 +695,20 @@ Feature: Incidents
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Get a list of incident user-defined fields returns "Bad Request" response
Given operation "ListIncidentUserDefinedFields" enabled
And new "ListIncidentUserDefinedFields" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Get a list of incident user-defined fields returns "OK" response
Given operation "ListIncidentUserDefinedFields" enabled
And new "ListIncidentUserDefinedFields" request
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Get a list of incidents returns "Bad Request" response
Given operation "ListIncidents" enabled
Expand Down Expand Up @@ -703,6 +765,22 @@ Feature: Incidents
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Get an incident user-defined field returns "Not Found" response
Given operation "GetIncidentUserDefinedField" enabled
And new "GetIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/incident-app
Scenario: Get an incident user-defined field returns "OK" response
Given operation "GetIncidentUserDefinedField" enabled
And new "GetIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Get global incident settings returns "Bad Request" response
Given operation "GetGlobalIncidentSettings" enabled
Expand Down Expand Up @@ -1243,6 +1321,33 @@ Feature: Incidents
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Update an incident user-defined field returns "Bad Request" response
Given operation "UpdateIncidentUserDefinedField" enabled
And new "UpdateIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Update an incident user-defined field returns "Not Found" response
Given operation "UpdateIncidentUserDefinedField" enabled
And new "UpdateIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/incident-app
Scenario: Update an incident user-defined field returns "OK" response
Given operation "UpdateIncidentUserDefinedField" enabled
And new "UpdateIncidentUserDefinedField" request
And request contains "field_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"category": "what_happened", "collected": "active", "default_value": "critical", "display_name": "Root Cause", "ordinal": "1.5", "required": false, "valid_values": [{"description": "A critical severity incident.", "display_name": "Critical", "short_description": "Critical", "value": "critical"}]}, "id": "00000000-0000-0000-0000-000000000000", "type": "user_defined_field"}}
When the request is sent
Then the response status is 200 OK

@generated @skip @team:DataDog/incident-app
Scenario: Update global incident handle returns "Bad Request" response
Given operation "UpdateGlobalIncidentHandle" enabled
Expand Down
Loading
Loading