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
274 changes: 239 additions & 35 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

24 changes: 23 additions & 1 deletion examples/v2/incidents/CreateIncidentPostmortemTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,31 @@ const params: v2.IncidentsApiCreateIncidentPostmortemTemplateRequest = {
body: {
data: {
attributes: {
confluencePostmortemSettings: {
accountId: "123456",
parentId: "345678",
spaceId: "789012",
},
content:
"# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items",
googleDocsPostmortemSettings: {
accountId: "123456",
parentFolderId: "789012",
},
isDefault: new Date(2024, 1, 1, 0, 0, 0, 0),
location: "datadog_notebooks",
name: "Standard Postmortem Template",
},
type: "postmortem_template",
id: "00000000-0000-0000-0000-000000000000",
relationships: {
incidentType: {
data: {
id: "00000000-0000-0000-0000-000000000009",
type: "incident_types",
},
},
},
type: "postmortem_templates",
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configuration.unstableOperations["v2.deleteIncidentPostmortemTemplate"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiDeleteIncidentPostmortemTemplateRequest = {
templateId: "template-456",
templateId: "template_id",
};

apiInstance
Expand Down
2 changes: 1 addition & 1 deletion examples/v2/incidents/GetIncidentPostmortemTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ configuration.unstableOperations["v2.getIncidentPostmortemTemplate"] = true;
const apiInstance = new v2.IncidentsApi(configuration);

const params: v2.IncidentsApiGetIncidentPostmortemTemplateRequest = {
templateId: "template-456",
templateId: "template_id",
};

apiInstance
Expand Down
26 changes: 24 additions & 2 deletions examples/v2/incidents/UpdateIncidentPostmortemTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,34 @@ const params: v2.IncidentsApiUpdateIncidentPostmortemTemplateRequest = {
body: {
data: {
attributes: {
confluencePostmortemSettings: {
accountId: "123456",
parentId: "345678",
spaceId: "789012",
},
content:
"# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items",
googleDocsPostmortemSettings: {
accountId: "123456",
parentFolderId: "789012",
},
isDefault: new Date(2024, 1, 1, 0, 0, 0, 0),
location: "datadog_notebooks",
name: "Standard Postmortem Template",
},
type: "postmortem_template",
id: "00000000-0000-0000-0000-000000000000",
relationships: {
incidentType: {
data: {
id: "00000000-0000-0000-0000-000000000009",
type: "incident_types",
},
},
},
type: "postmortem_templates",
},
},
templateId: "template-456",
templateId: "template_id",
};

apiInstance
Expand Down
8 changes: 8 additions & 0 deletions features/support/scenarios_model_mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10049,6 +10049,14 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
"operationResponseType": "IncidentNotificationTemplate",
},
"v2.ListIncidentPostmortemTemplates": {
"filterIncidentType": {
"type": "string",
"format": "uuid",
},
"sort": {
"type": "string",
"format": "",
},
"operationResponseType": "PostmortemTemplatesResponse",
},
"v2.CreateIncidentPostmortemTemplate": {
Expand Down
10 changes: 5 additions & 5 deletions features/v2/incidents.feature
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,15 @@ Feature: Incidents
Scenario: Create postmortem template returns "Bad Request" response
Given operation "CreateIncidentPostmortemTemplate" enabled
And new "CreateIncidentPostmortemTemplate" request
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/incident-app
Scenario: Create postmortem template returns "Created" response
Given operation "CreateIncidentPostmortemTemplate" enabled
And new "CreateIncidentPostmortemTemplate" request
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 201 Created

Expand Down Expand Up @@ -1590,7 +1590,7 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 400 Bad Request

Expand All @@ -1599,7 +1599,7 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 404 Not Found

Expand All @@ -1608,6 +1608,6 @@ Feature: Incidents
Given operation "UpdateIncidentPostmortemTemplate" enabled
And new "UpdateIncidentPostmortemTemplate" request
And request contains "template_id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}}
And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}}
When the request is sent
Then the response status is 200 OK
2 changes: 1 addition & 1 deletion features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3029,7 +3029,7 @@
"parameters": [
{
"name": "template_id",
"source": "<RESPONSE_PATH>"
"source": "data.id"
}
],
"type": "unsafe"
Expand Down
44 changes: 40 additions & 4 deletions packages/datadog-api-client-v2/apis/IncidentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,8 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory {
}

public async listIncidentPostmortemTemplates(
filterIncidentType?: string,
sort?: string,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;
Expand All @@ -2179,6 +2181,22 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory {
requestContext.setHeaderParam("Accept", "application/json");
requestContext.setHttpConfig(_config.httpConfig);

// Query Params
if (filterIncidentType !== undefined) {
requestContext.setQueryParam(
"filter[incident-type]",
ObjectSerializer.serialize(filterIncidentType, "string", "uuid"),
""
);
}
if (sort !== undefined) {
requestContext.setQueryParam(
"sort",
ObjectSerializer.serialize(sort, "string", ""),
""
);
}

// Apply auth methods
applySecurityAuthentication(_config, requestContext, [
"apiKeyAuth",
Expand Down Expand Up @@ -7737,7 +7755,7 @@ export interface IncidentsApiDeleteIncidentNotificationTemplateRequest {

export interface IncidentsApiDeleteIncidentPostmortemTemplateRequest {
/**
* The ID of the postmortem template
* The ID of the postmortem template.
* @type string
*/
templateId: string;
Expand Down Expand Up @@ -7834,7 +7852,7 @@ export interface IncidentsApiGetIncidentNotificationTemplateRequest {

export interface IncidentsApiGetIncidentPostmortemTemplateRequest {
/**
* The ID of the postmortem template
* The ID of the postmortem template.
* @type string
*/
templateId: string;
Expand Down Expand Up @@ -7968,6 +7986,19 @@ export interface IncidentsApiListIncidentNotificationTemplatesRequest {
include?: string;
}

export interface IncidentsApiListIncidentPostmortemTemplatesRequest {
/**
* Filter postmortem templates by the associated incident type ID.
* @type string
*/
filterIncidentType?: string;
/**
* The attribute to sort results by. Prefix with `-` for descending order.
* @type string
*/
sort?: string;
}

export interface IncidentsApiListIncidentsRequest {
/**
* Specifies which types of related objects should be included in the response.
Expand Down Expand Up @@ -8186,7 +8217,7 @@ export interface IncidentsApiUpdateIncidentNotificationTemplateRequest {

export interface IncidentsApiUpdateIncidentPostmortemTemplateRequest {
/**
* The ID of the postmortem template
* The ID of the postmortem template.
* @type string
*/
templateId: string;
Expand Down Expand Up @@ -9254,10 +9285,15 @@ export class IncidentsApi {
* @param param The request object
*/
public listIncidentPostmortemTemplates(
param: IncidentsApiListIncidentPostmortemTemplatesRequest = {},
options?: Configuration
): Promise<PostmortemTemplatesResponse> {
const requestContextPromise =
this.requestFactory.listIncidentPostmortemTemplates(options);
this.requestFactory.listIncidentPostmortemTemplates(
param.filterIncidentType,
param.sort,
options
);
return requestContextPromise.then((requestContext) => {
return this.configuration.httpApi
.send(requestContext)
Expand Down
10 changes: 10 additions & 0 deletions packages/datadog-api-client-v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@ export {
IncidentsApiListIncidentIntegrationsRequest,
IncidentsApiListIncidentNotificationRulesRequest,
IncidentsApiListIncidentNotificationTemplatesRequest,
IncidentsApiListIncidentPostmortemTemplatesRequest,
IncidentsApiListIncidentTodosRequest,
IncidentsApiListIncidentTypesRequest,
IncidentsApiListIncidentUserDefinedFieldsRequest,
Expand Down Expand Up @@ -2961,6 +2962,7 @@ export { ConfiguredScheduleTargetAttributes } from "./models/ConfiguredScheduleT
export { ConfiguredScheduleTargetRelationships } from "./models/ConfiguredScheduleTargetRelationships";
export { ConfiguredScheduleTargetRelationshipsSchedule } from "./models/ConfiguredScheduleTargetRelationshipsSchedule";
export { ConfiguredScheduleTargetType } from "./models/ConfiguredScheduleTargetType";
export { ConfluencePostmortemSettings } from "./models/ConfluencePostmortemSettings";
export { ConfluentAccountCreateRequest } from "./models/ConfluentAccountCreateRequest";
export { ConfluentAccountCreateRequestAttributes } from "./models/ConfluentAccountCreateRequestAttributes";
export { ConfluentAccountCreateRequestData } from "./models/ConfluentAccountCreateRequestData";
Expand Down Expand Up @@ -4351,6 +4353,7 @@ export { GoogleChatTargetAudienceUpdateRequestData } from "./models/GoogleChatTa
export { GoogleChatUpdateOrganizationHandleRequest } from "./models/GoogleChatUpdateOrganizationHandleRequest";
export { GoogleChatUpdateOrganizationHandleRequestAttributes } from "./models/GoogleChatUpdateOrganizationHandleRequestAttributes";
export { GoogleChatUpdateOrganizationHandleRequestData } from "./models/GoogleChatUpdateOrganizationHandleRequestData";
export { GoogleDocsPostmortemSettings } from "./models/GoogleDocsPostmortemSettings";
export { GoogleMeetConfigurationReference } from "./models/GoogleMeetConfigurationReference";
export { GoogleMeetConfigurationReferenceData } from "./models/GoogleMeetConfigurationReferenceData";
export { GovernanceBestPracticeDefinition } from "./models/GovernanceBestPracticeDefinition";
Expand Down Expand Up @@ -6452,12 +6455,19 @@ export { PostmortemCellDefinition } from "./models/PostmortemCellDefinition";
export { PostmortemCellType } from "./models/PostmortemCellType";
export { PostmortemTemplateAttributesRequest } from "./models/PostmortemTemplateAttributesRequest";
export { PostmortemTemplateAttributesResponse } from "./models/PostmortemTemplateAttributesResponse";
export { PostmortemTemplateCreateRelationships } from "./models/PostmortemTemplateCreateRelationships";
export { PostmortemTemplateDataRequest } from "./models/PostmortemTemplateDataRequest";
export { PostmortemTemplateDataResponse } from "./models/PostmortemTemplateDataResponse";
export { PostmortemTemplateIncidentTypeRelationship } from "./models/PostmortemTemplateIncidentTypeRelationship";
export { PostmortemTemplateIncidentTypeRelationshipData } from "./models/PostmortemTemplateIncidentTypeRelationshipData";
export { PostmortemTemplateLocation } from "./models/PostmortemTemplateLocation";
export { PostmortemTemplateRequest } from "./models/PostmortemTemplateRequest";
export { PostmortemTemplateResponse } from "./models/PostmortemTemplateResponse";
export { PostmortemTemplateResponseRelationships } from "./models/PostmortemTemplateResponseRelationships";
export { PostmortemTemplatesResponse } from "./models/PostmortemTemplatesResponse";
export { PostmortemTemplateType } from "./models/PostmortemTemplateType";
export { PostmortemTemplateUserRelationship } from "./models/PostmortemTemplateUserRelationship";
export { PostmortemTemplateUserRelationshipData } from "./models/PostmortemTemplateUserRelationshipData";
export { Powerpack } from "./models/Powerpack";
export { PowerpackAttributes } from "./models/PowerpackAttributes";
export { PowerpackData } from "./models/PowerpackData";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/

import { AttributeTypeMap } from "../../datadog-api-client-common/util";

/**
* Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`.
*/
export class ConfluencePostmortemSettings {
/**
* The ID of the Confluence integration account.
*/
"accountId": string;
/**
* The ID of the parent Confluence page under which postmortems are created.
*/
"parentId"?: string;
/**
* The ID of the Confluence space where postmortems are created.
*/
"spaceId": string;

/**
* A container for additional, undeclared properties.
* This is a holder for any undeclared properties as specified with
* the 'additionalProperties' keyword in the OAS document.
*/
"additionalProperties"?: { [key: string]: any };

/**
* @ignore
*/
"_unparsed"?: boolean;

/**
* @ignore
*/
static readonly attributeTypeMap: AttributeTypeMap = {
accountId: {
baseName: "account_id",
type: "string",
required: true,
},
parentId: {
baseName: "parent_id",
type: "string",
},
spaceId: {
baseName: "space_id",
type: "string",
required: true,
},
additionalProperties: {
baseName: "additionalProperties",
type: "{ [key: string]: any; }",
},
};

/**
* @ignore
*/
static getAttributeTypeMap(): AttributeTypeMap {
return ConfluencePostmortemSettings.attributeTypeMap;
}

public constructor() {}
}
Loading
Loading