diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 90e1196820ee..0417cfefc3f2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1448,6 +1448,31 @@ components: required: false schema: $ref: "#/components/schemas/OrgGroupPolicySortOption" + PostmortemTemplateFilterIncidentTypeParameter: + description: Filter postmortem templates by the associated incident type ID. + in: query + name: filter[incident-type] + required: false + schema: + format: uuid + type: string + PostmortemTemplateIdParameter: + description: The ID of the postmortem template. + example: 00000000-0000-0000-0000-000000000000 + in: path + name: template_id + required: true + schema: + type: string + PostmortemTemplateSortParameter: + description: The attribute to sort results by. Prefix with `-` for descending order. + in: query + name: sort + required: false + schema: + default: created_at + example: "-created_at" + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -20811,6 +20836,26 @@ components: type: string x-enum-varnames: - SCHEDULE_TARGET + ConfluencePostmortemSettings: + description: Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + properties: + account_id: + description: The ID of the Confluence integration account. + example: "123456" + type: string + parent_id: + description: The ID of the parent Confluence page under which postmortems are created. + example: "345678" + nullable: true + type: string + space_id: + description: The ID of the Confluence space where postmortems are created. + example: "789012" + type: string + required: + - account_id + - space_id + type: object ConfluentAccountCreateRequest: description: Payload schema when adding a Confluent account. properties: @@ -43223,6 +43268,21 @@ components: required: - attributes type: object + GoogleDocsPostmortemSettings: + description: Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + properties: + account_id: + description: The ID of the Google Drive integration account. + example: "123456" + type: string + parent_folder_id: + description: The ID of the Google Drive folder where postmortems are created. + example: "789012" + type: string + required: + - account_id + - parent_folder_id + type: object GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -77094,8 +77154,24 @@ components: PostmortemTemplateAttributesRequest: description: Attributes for creating or updating a postmortem template. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. Set to `null` to unset. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: @@ -77104,30 +77180,61 @@ components: PostmortemTemplateAttributesResponse: description: Attributes of a postmortem template returned in a response. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string createdAt: - description: When the template was created + description: When the template was created. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" modifiedAt: - description: When the template was last modified + description: When the template was last modified. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: - name + - content + - is_default + - location - createdAt - modifiedAt type: object + PostmortemTemplateCreateRelationships: + description: Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + type: object PostmortemTemplateDataRequest: description: Data object for creating or updating a postmortem template. properties: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesRequest" + id: + description: The ID of the template. Required when updating. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateCreateRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77140,9 +77247,11 @@ components: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesResponse" id: - description: The ID of the template - example: "template-456" + description: The ID of the template. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateResponseRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77150,6 +77259,43 @@ components: - type - attributes type: object + PostmortemTemplateIncidentTypeRelationship: + description: Relationship to the incident type this template belongs to. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationshipData" + required: + - data + type: object + PostmortemTemplateIncidentTypeRelationshipData: + description: Incident type relationship data. + properties: + id: + description: The incident type identifier. + example: 00000000-0000-0000-0000-000000000009 + format: uuid + type: string + type: + description: The incident type resource type. + example: incident_types + type: string + required: + - id + - type + type: object + PostmortemTemplateLocation: + default: datadog_notebooks + description: The location where the postmortem is created and stored. + enum: + - datadog_notebooks + - confluence + - google_docs + example: datadog_notebooks + type: string + x-enum-varnames: + - DATADOG_NOTEBOOKS + - CONFLUENCE + - GOOGLE_DOCS PostmortemTemplateRequest: description: Request body for creating or updating a postmortem template. properties: @@ -77166,14 +77312,48 @@ components: required: - data type: object + PostmortemTemplateResponseRelationships: + description: Relationships of a postmortem template returned in a response. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + last_modified_by_user: + $ref: "#/components/schemas/PostmortemTemplateUserRelationship" + type: object PostmortemTemplateType: - description: Postmortem template resource type + description: Postmortem template resource type. enum: + - postmortem_templates - postmortem_template - example: postmortem_template + example: postmortem_templates type: string x-enum-varnames: + - POSTMORTEM_TEMPLATES - POSTMORTEM_TEMPLATE + PostmortemTemplateUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateUserRelationshipData" + required: + - data + type: object + PostmortemTemplateUserRelationshipData: + description: User relationship data. + properties: + id: + description: The user identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The user resource type. + example: users + type: string + required: + - id + - type + type: object PostmortemTemplatesResponse: description: Response containing a list of postmortem templates. properties: @@ -141993,6 +142173,9 @@ paths: get: description: Retrieve a list of all postmortem templates for incidents. operationId: ListIncidentPostmortemTemplates + parameters: + - $ref: "#/components/parameters/PostmortemTemplateFilterIncidentTypeParameter" + - $ref: "#/components/parameters/PostmortemTemplateSortParameter" responses: "200": content: @@ -142002,11 +142185,19 @@ paths: value: data: - attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: "2024-01-01T00:00:00+00:00" + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000001 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplatesResponse" description: OK @@ -142035,8 +142226,14 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" name: Standard Postmortem Template - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142049,11 +142246,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000002 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: Created @@ -142082,13 +142287,7 @@ paths: description: Delete a postmortem template. operationId: DeleteIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "204": description: No Content @@ -142116,13 +142315,7 @@ paths: description: Retrieve details of a specific postmortem template. operationId: GetIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "200": content: @@ -142132,11 +142325,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000003 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK @@ -142164,13 +142365,7 @@ paths: description: Update an existing postmortem template. operationId: UpdateIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" requestBody: content: application/json: @@ -142180,7 +142375,8 @@ paths: data: attributes: name: Standard Postmortem Template - type: postmortem_template + id: 00000000-0000-0000-0000-000000000004 + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142193,11 +142389,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000004 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK diff --git a/examples/v2/incidents/CreateIncidentPostmortemTemplate.ts b/examples/v2/incidents/CreateIncidentPostmortemTemplate.ts index 21a3bc667175..34a8f1e63ed2 100644 --- a/examples/v2/incidents/CreateIncidentPostmortemTemplate.ts +++ b/examples/v2/incidents/CreateIncidentPostmortemTemplate.ts @@ -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", }, }, }; diff --git a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.ts b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.ts index 4267fe8b881e..6fe63b46b7d1 100644 --- a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.ts +++ b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.ts @@ -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 diff --git a/examples/v2/incidents/GetIncidentPostmortemTemplate.ts b/examples/v2/incidents/GetIncidentPostmortemTemplate.ts index e3e96e8eda51..be516f17ee1b 100644 --- a/examples/v2/incidents/GetIncidentPostmortemTemplate.ts +++ b/examples/v2/incidents/GetIncidentPostmortemTemplate.ts @@ -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 diff --git a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.ts b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.ts index f049b890f094..d79276d7d33f 100644 --- a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.ts +++ b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.ts @@ -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 diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index cb95788f3b78..4a759a3a27d1 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -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": { diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 1b993a1ff299..feea0deb36c8 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -334,7 +334,7 @@ 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 @@ -342,7 +342,7 @@ Feature: Incidents 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 @@ -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 @@ -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 @@ -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 diff --git a/features/v2/undo.json b/features/v2/undo.json index e72767d8e0d5..4a8555e43ae9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3029,7 +3029,7 @@ "parameters": [ { "name": "template_id", - "source": "" + "source": "data.id" } ], "type": "unsafe" diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index 56445acaeaf8..51359ce3eab6 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -2158,6 +2158,8 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { } public async listIncidentPostmortemTemplates( + filterIncidentType?: string, + sort?: string, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -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", @@ -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; @@ -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; @@ -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. @@ -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; @@ -9254,10 +9285,15 @@ export class IncidentsApi { * @param param The request object */ public listIncidentPostmortemTemplates( + param: IncidentsApiListIncidentPostmortemTemplatesRequest = {}, options?: Configuration ): Promise { const requestContextPromise = - this.requestFactory.listIncidentPostmortemTemplates(options); + this.requestFactory.listIncidentPostmortemTemplates( + param.filterIncidentType, + param.sort, + options + ); return requestContextPromise.then((requestContext) => { return this.configuration.httpApi .send(requestContext) diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 841260110477..e2e7e7f421e9 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -728,6 +728,7 @@ export { IncidentsApiListIncidentIntegrationsRequest, IncidentsApiListIncidentNotificationRulesRequest, IncidentsApiListIncidentNotificationTemplatesRequest, + IncidentsApiListIncidentPostmortemTemplatesRequest, IncidentsApiListIncidentTodosRequest, IncidentsApiListIncidentTypesRequest, IncidentsApiListIncidentUserDefinedFieldsRequest, @@ -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"; @@ -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"; @@ -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"; diff --git a/packages/datadog-api-client-v2/models/ConfluencePostmortemSettings.ts b/packages/datadog-api-client-v2/models/ConfluencePostmortemSettings.ts new file mode 100644 index 000000000000..bba148c8f3f5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ConfluencePostmortemSettings.ts @@ -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() {} +} diff --git a/packages/datadog-api-client-v2/models/GoogleDocsPostmortemSettings.ts b/packages/datadog-api-client-v2/models/GoogleDocsPostmortemSettings.ts new file mode 100644 index 000000000000..268156ae6978 --- /dev/null +++ b/packages/datadog-api-client-v2/models/GoogleDocsPostmortemSettings.ts @@ -0,0 +1,62 @@ +/** + * 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 Google Docs. Required when `location` is `google_docs`. + */ +export class GoogleDocsPostmortemSettings { + /** + * The ID of the Google Drive integration account. + */ + "accountId": string; + /** + * The ID of the Google Drive folder where postmortems are created. + */ + "parentFolderId": 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, + }, + parentFolderId: { + baseName: "parent_folder_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GoogleDocsPostmortemSettings.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index efce8a9bdc87..2395681b19b2 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -838,6 +838,7 @@ import { ConfiguredScheduleTarget } from "./ConfiguredScheduleTarget"; import { ConfiguredScheduleTargetAttributes } from "./ConfiguredScheduleTargetAttributes"; import { ConfiguredScheduleTargetRelationships } from "./ConfiguredScheduleTargetRelationships"; import { ConfiguredScheduleTargetRelationshipsSchedule } from "./ConfiguredScheduleTargetRelationshipsSchedule"; +import { ConfluencePostmortemSettings } from "./ConfluencePostmortemSettings"; import { ConfluentAccountCreateRequest } from "./ConfluentAccountCreateRequest"; import { ConfluentAccountCreateRequestAttributes } from "./ConfluentAccountCreateRequestAttributes"; import { ConfluentAccountCreateRequestData } from "./ConfluentAccountCreateRequestData"; @@ -1946,6 +1947,7 @@ import { GoogleChatTargetAudiencesResponse } from "./GoogleChatTargetAudiencesRe import { GoogleChatUpdateOrganizationHandleRequest } from "./GoogleChatUpdateOrganizationHandleRequest"; import { GoogleChatUpdateOrganizationHandleRequestAttributes } from "./GoogleChatUpdateOrganizationHandleRequestAttributes"; import { GoogleChatUpdateOrganizationHandleRequestData } from "./GoogleChatUpdateOrganizationHandleRequestData"; +import { GoogleDocsPostmortemSettings } from "./GoogleDocsPostmortemSettings"; import { GoogleMeetConfigurationReference } from "./GoogleMeetConfigurationReference"; import { GoogleMeetConfigurationReferenceData } from "./GoogleMeetConfigurationReferenceData"; import { GovernanceBestPracticeDefinition } from "./GovernanceBestPracticeDefinition"; @@ -3525,10 +3527,16 @@ import { PostmortemCellAttributes } from "./PostmortemCellAttributes"; import { PostmortemCellDefinition } from "./PostmortemCellDefinition"; import { PostmortemTemplateAttributesRequest } from "./PostmortemTemplateAttributesRequest"; import { PostmortemTemplateAttributesResponse } from "./PostmortemTemplateAttributesResponse"; +import { PostmortemTemplateCreateRelationships } from "./PostmortemTemplateCreateRelationships"; import { PostmortemTemplateDataRequest } from "./PostmortemTemplateDataRequest"; import { PostmortemTemplateDataResponse } from "./PostmortemTemplateDataResponse"; +import { PostmortemTemplateIncidentTypeRelationship } from "./PostmortemTemplateIncidentTypeRelationship"; +import { PostmortemTemplateIncidentTypeRelationshipData } from "./PostmortemTemplateIncidentTypeRelationshipData"; import { PostmortemTemplateRequest } from "./PostmortemTemplateRequest"; import { PostmortemTemplateResponse } from "./PostmortemTemplateResponse"; +import { PostmortemTemplateResponseRelationships } from "./PostmortemTemplateResponseRelationships"; +import { PostmortemTemplateUserRelationship } from "./PostmortemTemplateUserRelationship"; +import { PostmortemTemplateUserRelationshipData } from "./PostmortemTemplateUserRelationshipData"; import { PostmortemTemplatesResponse } from "./PostmortemTemplatesResponse"; import { Powerpack } from "./Powerpack"; import { PowerpackAttributes } from "./PowerpackAttributes"; @@ -7254,7 +7262,12 @@ const enumsMap: { [key: string]: any[] } = { PersonalAccessTokensType: ["personal_access_tokens"], PlaylistDataType: ["rum_replay_playlist"], PostmortemCellType: ["markdown"], - PostmortemTemplateType: ["postmortem_template"], + PostmortemTemplateLocation: [ + "datadog_notebooks", + "confluence", + "google_docs", + ], + PostmortemTemplateType: ["postmortem_templates", "postmortem_template"], PrintReportType: ["report"], ProcessDataSource: ["process"], ProcessSummaryType: ["process"], @@ -9350,6 +9363,7 @@ const typeMap: { [index: string]: any } = { ConfiguredScheduleTargetRelationships: ConfiguredScheduleTargetRelationships, ConfiguredScheduleTargetRelationshipsSchedule: ConfiguredScheduleTargetRelationshipsSchedule, + ConfluencePostmortemSettings: ConfluencePostmortemSettings, ConfluentAccountCreateRequest: ConfluentAccountCreateRequest, ConfluentAccountCreateRequestAttributes: ConfluentAccountCreateRequestAttributes, @@ -10642,6 +10656,7 @@ const typeMap: { [index: string]: any } = { GoogleChatUpdateOrganizationHandleRequestAttributes, GoogleChatUpdateOrganizationHandleRequestData: GoogleChatUpdateOrganizationHandleRequestData, + GoogleDocsPostmortemSettings: GoogleDocsPostmortemSettings, GoogleMeetConfigurationReference: GoogleMeetConfigurationReference, GoogleMeetConfigurationReferenceData: GoogleMeetConfigurationReferenceData, GovernanceBestPracticeDefinition: GovernanceBestPracticeDefinition, @@ -12565,10 +12580,20 @@ const typeMap: { [index: string]: any } = { PostmortemCellDefinition: PostmortemCellDefinition, PostmortemTemplateAttributesRequest: PostmortemTemplateAttributesRequest, PostmortemTemplateAttributesResponse: PostmortemTemplateAttributesResponse, + PostmortemTemplateCreateRelationships: PostmortemTemplateCreateRelationships, PostmortemTemplateDataRequest: PostmortemTemplateDataRequest, PostmortemTemplateDataResponse: PostmortemTemplateDataResponse, + PostmortemTemplateIncidentTypeRelationship: + PostmortemTemplateIncidentTypeRelationship, + PostmortemTemplateIncidentTypeRelationshipData: + PostmortemTemplateIncidentTypeRelationshipData, PostmortemTemplateRequest: PostmortemTemplateRequest, PostmortemTemplateResponse: PostmortemTemplateResponse, + PostmortemTemplateResponseRelationships: + PostmortemTemplateResponseRelationships, + PostmortemTemplateUserRelationship: PostmortemTemplateUserRelationship, + PostmortemTemplateUserRelationshipData: + PostmortemTemplateUserRelationshipData, PostmortemTemplatesResponse: PostmortemTemplatesResponse, Powerpack: Powerpack, PowerpackAttributes: PowerpackAttributes, diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesRequest.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesRequest.ts index eb4803306ecd..499b1300f240 100644 --- a/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesRequest.ts +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesRequest.ts @@ -3,6 +3,9 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { ConfluencePostmortemSettings } from "./ConfluencePostmortemSettings"; +import { GoogleDocsPostmortemSettings } from "./GoogleDocsPostmortemSettings"; +import { PostmortemTemplateLocation } from "./PostmortemTemplateLocation"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -11,7 +14,27 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class PostmortemTemplateAttributesRequest { /** - * The name of the template + * Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + */ + "confluencePostmortemSettings"?: ConfluencePostmortemSettings; + /** + * The templated content of the postmortem, supporting Markdown and incident template variables. + */ + "content"?: string; + /** + * Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + */ + "googleDocsPostmortemSettings"?: GoogleDocsPostmortemSettings; + /** + * When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. Set to `null` to unset. + */ + "isDefault"?: Date; + /** + * The location where the postmortem is created and stored. + */ + "location"?: PostmortemTemplateLocation; + /** + * The name of the template. */ "name": string; @@ -31,6 +54,27 @@ export class PostmortemTemplateAttributesRequest { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + confluencePostmortemSettings: { + baseName: "confluence_postmortem_settings", + type: "ConfluencePostmortemSettings", + }, + content: { + baseName: "content", + type: "string", + }, + googleDocsPostmortemSettings: { + baseName: "google_docs_postmortem_settings", + type: "GoogleDocsPostmortemSettings", + }, + isDefault: { + baseName: "is_default", + type: "Date", + format: "date-time", + }, + location: { + baseName: "location", + type: "PostmortemTemplateLocation", + }, name: { baseName: "name", type: "string", diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesResponse.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesResponse.ts index 57652a8bb8d8..c6095c740722 100644 --- a/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesResponse.ts +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateAttributesResponse.ts @@ -3,6 +3,9 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { ConfluencePostmortemSettings } from "./ConfluencePostmortemSettings"; +import { GoogleDocsPostmortemSettings } from "./GoogleDocsPostmortemSettings"; +import { PostmortemTemplateLocation } from "./PostmortemTemplateLocation"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -11,15 +14,35 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class PostmortemTemplateAttributesResponse { /** - * When the template was created + * Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + */ + "confluencePostmortemSettings"?: ConfluencePostmortemSettings; + /** + * The templated content of the postmortem, supporting Markdown and incident template variables. + */ + "content": string; + /** + * When the template was created. */ "createdAt": Date; /** - * When the template was last modified + * Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + */ + "googleDocsPostmortemSettings"?: GoogleDocsPostmortemSettings; + /** + * When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. + */ + "isDefault": Date | null; + /** + * The location where the postmortem is created and stored. + */ + "location": PostmortemTemplateLocation; + /** + * When the template was last modified. */ "modifiedAt": Date; /** - * The name of the template + * The name of the template. */ "name": string; @@ -39,12 +62,36 @@ export class PostmortemTemplateAttributesResponse { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + confluencePostmortemSettings: { + baseName: "confluence_postmortem_settings", + type: "ConfluencePostmortemSettings", + }, + content: { + baseName: "content", + type: "string", + required: true, + }, createdAt: { baseName: "createdAt", type: "Date", required: true, format: "date-time", }, + googleDocsPostmortemSettings: { + baseName: "google_docs_postmortem_settings", + type: "GoogleDocsPostmortemSettings", + }, + isDefault: { + baseName: "is_default", + type: "Date", + required: true, + format: "date-time", + }, + location: { + baseName: "location", + type: "PostmortemTemplateLocation", + required: true, + }, modifiedAt: { baseName: "modifiedAt", type: "Date", diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateCreateRelationships.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateCreateRelationships.ts new file mode 100644 index 000000000000..36bcc67f24fd --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateCreateRelationships.ts @@ -0,0 +1,53 @@ +/** + * 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 { PostmortemTemplateIncidentTypeRelationship } from "./PostmortemTemplateIncidentTypeRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + */ +export class PostmortemTemplateCreateRelationships { + /** + * Relationship to the incident type this template belongs to. + */ + "incidentType"?: PostmortemTemplateIncidentTypeRelationship; + + /** + * 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 = { + incidentType: { + baseName: "incident_type", + type: "PostmortemTemplateIncidentTypeRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateCreateRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateDataRequest.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateDataRequest.ts index a714b0198828..fa8f304f522a 100644 --- a/packages/datadog-api-client-v2/models/PostmortemTemplateDataRequest.ts +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateDataRequest.ts @@ -4,6 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { PostmortemTemplateAttributesRequest } from "./PostmortemTemplateAttributesRequest"; +import { PostmortemTemplateCreateRelationships } from "./PostmortemTemplateCreateRelationships"; import { PostmortemTemplateType } from "./PostmortemTemplateType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -17,7 +18,15 @@ export class PostmortemTemplateDataRequest { */ "attributes": PostmortemTemplateAttributesRequest; /** - * Postmortem template resource type + * The ID of the template. Required when updating. + */ + "id"?: string; + /** + * Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + */ + "relationships"?: PostmortemTemplateCreateRelationships; + /** + * Postmortem template resource type. */ "type": PostmortemTemplateType; @@ -42,6 +51,14 @@ export class PostmortemTemplateDataRequest { type: "PostmortemTemplateAttributesRequest", required: true, }, + id: { + baseName: "id", + type: "string", + }, + relationships: { + baseName: "relationships", + type: "PostmortemTemplateCreateRelationships", + }, type: { baseName: "type", type: "PostmortemTemplateType", diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateDataResponse.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateDataResponse.ts index 852add138ee2..ffb064d0a79e 100644 --- a/packages/datadog-api-client-v2/models/PostmortemTemplateDataResponse.ts +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateDataResponse.ts @@ -4,6 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { PostmortemTemplateAttributesResponse } from "./PostmortemTemplateAttributesResponse"; +import { PostmortemTemplateResponseRelationships } from "./PostmortemTemplateResponseRelationships"; import { PostmortemTemplateType } from "./PostmortemTemplateType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -17,11 +18,15 @@ export class PostmortemTemplateDataResponse { */ "attributes": PostmortemTemplateAttributesResponse; /** - * The ID of the template + * The ID of the template. */ "id": string; /** - * Postmortem template resource type + * Relationships of a postmortem template returned in a response. + */ + "relationships"?: PostmortemTemplateResponseRelationships; + /** + * Postmortem template resource type. */ "type": PostmortemTemplateType; @@ -51,6 +56,10 @@ export class PostmortemTemplateDataResponse { type: "string", required: true, }, + relationships: { + baseName: "relationships", + type: "PostmortemTemplateResponseRelationships", + }, type: { baseName: "type", type: "PostmortemTemplateType", diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationship.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationship.ts new file mode 100644 index 000000000000..7101c31081a3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationship.ts @@ -0,0 +1,54 @@ +/** + * 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 { PostmortemTemplateIncidentTypeRelationshipData } from "./PostmortemTemplateIncidentTypeRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to the incident type this template belongs to. + */ +export class PostmortemTemplateIncidentTypeRelationship { + /** + * Incident type relationship data. + */ + "data": PostmortemTemplateIncidentTypeRelationshipData; + + /** + * 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 = { + data: { + baseName: "data", + type: "PostmortemTemplateIncidentTypeRelationshipData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateIncidentTypeRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationshipData.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationshipData.ts new file mode 100644 index 000000000000..8f2c0cfc964c --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateIncidentTypeRelationshipData.ts @@ -0,0 +1,63 @@ +/** + * 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"; + +/** + * Incident type relationship data. + */ +export class PostmortemTemplateIncidentTypeRelationshipData { + /** + * The incident type identifier. + */ + "id": string; + /** + * The incident type resource type. + */ + "type": 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 = { + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateIncidentTypeRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateLocation.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateLocation.ts new file mode 100644 index 000000000000..3b77e5b7d1f2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateLocation.ts @@ -0,0 +1,20 @@ +/** + * 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 { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The location where the postmortem is created and stored. + */ + +export type PostmortemTemplateLocation = + | typeof DATADOG_NOTEBOOKS + | typeof CONFLUENCE + | typeof GOOGLE_DOCS + | UnparsedObject; +export const DATADOG_NOTEBOOKS = "datadog_notebooks"; +export const CONFLUENCE = "confluence"; +export const GOOGLE_DOCS = "google_docs"; diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateResponseRelationships.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateResponseRelationships.ts new file mode 100644 index 000000000000..44ce523f9f42 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateResponseRelationships.ts @@ -0,0 +1,62 @@ +/** + * 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 { PostmortemTemplateIncidentTypeRelationship } from "./PostmortemTemplateIncidentTypeRelationship"; +import { PostmortemTemplateUserRelationship } from "./PostmortemTemplateUserRelationship"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of a postmortem template returned in a response. + */ +export class PostmortemTemplateResponseRelationships { + /** + * Relationship to the incident type this template belongs to. + */ + "incidentType"?: PostmortemTemplateIncidentTypeRelationship; + /** + * Relationship to a user. + */ + "lastModifiedByUser"?: PostmortemTemplateUserRelationship; + + /** + * 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 = { + incidentType: { + baseName: "incident_type", + type: "PostmortemTemplateIncidentTypeRelationship", + }, + lastModifiedByUser: { + baseName: "last_modified_by_user", + type: "PostmortemTemplateUserRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateResponseRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateType.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateType.ts index 4bc4f147e457..e3cbf5e57ff1 100644 --- a/packages/datadog-api-client-v2/models/PostmortemTemplateType.ts +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateType.ts @@ -7,10 +7,12 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * Postmortem template resource type + * Postmortem template resource type. */ export type PostmortemTemplateType = + | typeof POSTMORTEM_TEMPLATES | typeof POSTMORTEM_TEMPLATE | UnparsedObject; +export const POSTMORTEM_TEMPLATES = "postmortem_templates"; export const POSTMORTEM_TEMPLATE = "postmortem_template"; diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationship.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationship.ts new file mode 100644 index 000000000000..2ef1f91d21ff --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationship.ts @@ -0,0 +1,54 @@ +/** + * 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 { PostmortemTemplateUserRelationshipData } from "./PostmortemTemplateUserRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationship to a user. + */ +export class PostmortemTemplateUserRelationship { + /** + * User relationship data. + */ + "data": PostmortemTemplateUserRelationshipData; + + /** + * 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 = { + data: { + baseName: "data", + type: "PostmortemTemplateUserRelationshipData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateUserRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationshipData.ts b/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationshipData.ts new file mode 100644 index 000000000000..92fdb6846754 --- /dev/null +++ b/packages/datadog-api-client-v2/models/PostmortemTemplateUserRelationshipData.ts @@ -0,0 +1,63 @@ +/** + * 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"; + +/** + * User relationship data. + */ +export class PostmortemTemplateUserRelationshipData { + /** + * The user identifier. + */ + "id": string; + /** + * The user resource type. + */ + "type": 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 = { + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return PostmortemTemplateUserRelationshipData.attributeTypeMap; + } + + public constructor() {} +}