From 05fc11bf1fa9bd7dcfdf5ea876847a40fc10b610 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 1 Oct 2025 16:49:20 +0000 Subject: [PATCH] Regenerate client from commit 2776a1d of spec repo --- .generator/schemas/v2/openapi.yaml | 167 ++++++++++++++++++ .../v2/incidents/CreatePageFromIncident.ts | 37 ++++ features/support/scenarios_model_mapping.ts | 11 ++ features/v2/incidents.feature | 27 +++ features/v2/undo.json | 7 + .../configuration.ts | 1 + .../apis/IncidentsApi.ts | 163 +++++++++++++++++ packages/datadog-api-client-v2/index.ts | 10 ++ .../models/IncidentCreatePageAttributes.ts | 87 +++++++++ .../IncidentCreatePageFromIncidentData.ts | 64 +++++++ .../IncidentCreatePageFromIncidentRequest.ts | 54 ++++++ .../models/IncidentCreatePageResponse.ts | 54 ++++++ .../models/IncidentCreatePageResponseData.ts | 63 +++++++ .../models/IncidentPageIdType.ts | 14 ++ .../models/IncidentPageTarget.ts | 63 +++++++ .../models/IncidentPageTargetType.ts | 20 +++ .../models/IncidentPageType.ts | 14 ++ .../models/ObjectSerializer.ts | 15 ++ 18 files changed, 871 insertions(+) create mode 100644 examples/v2/incidents/CreatePageFromIncident.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentCreatePageAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentRequest.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentCreatePageResponse.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentCreatePageResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentPageIdType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentPageTarget.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentPageTargetType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentPageType.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d3505929ef55..8a6b2eecc25b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21602,6 +21602,82 @@ components: - type - attributes type: object + IncidentCreatePageAttributes: + description: Attributes for creating a page from an incident. + properties: + description: + description: Description of the page. + example: Page created for incident response + nullable: true + type: string + services: + description: List of services associated with the page. + example: + - web-service + - api-service + items: + type: string + nullable: true + type: array + tags: + description: List of tags for the page. + example: + - urgent + - production + items: + type: string + nullable: true + type: array + target: + $ref: '#/components/schemas/IncidentPageTarget' + title: + description: Title of the page. + example: Incident Response Page + type: string + required: + - title + - target + type: object + IncidentCreatePageFromIncidentData: + description: Data for creating a page from an incident. + properties: + attributes: + $ref: '#/components/schemas/IncidentCreatePageAttributes' + type: + $ref: '#/components/schemas/IncidentPageType' + required: + - type + - attributes + type: object + IncidentCreatePageFromIncidentRequest: + description: Request to create a page from an incident. + properties: + data: + $ref: '#/components/schemas/IncidentCreatePageFromIncidentData' + required: + - data + type: object + IncidentCreatePageResponse: + description: Response from creating a page from an incident. + properties: + data: + $ref: '#/components/schemas/IncidentCreatePageResponseData' + required: + - data + type: object + IncidentCreatePageResponseData: + description: Data from creating a page. + properties: + id: + description: The UUID of the created page. + example: 00000000-0000-0000-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentPageIdType' + required: + - id + - type + type: object IncidentCreateRelationships: description: The relationships the incident will have with other resources once created. @@ -22586,6 +22662,48 @@ components: - id - type type: object + IncidentPageIdType: + description: Incident page ID type. + enum: + - page_uuid + example: page_uuid + type: string + x-enum-varnames: + - PAGE_UUID + IncidentPageTarget: + description: Target for creating a page from an incident. + properties: + identifier: + description: The identifier of the target (team handle, team UUID, or user + UUID). + example: team-handle + type: string + type: + $ref: '#/components/schemas/IncidentPageTargetType' + required: + - type + - identifier + type: object + IncidentPageTargetType: + description: Type of page target for incident pages. + enum: + - team_handle + - team_uuid + - user_uuid + example: team_handle + type: string + x-enum-varnames: + - TEAM_HANDLE + - TEAM_UUID + - USER_UUID + IncidentPageType: + description: Incident page type. + enum: + - page + example: page + type: string + x-enum-varnames: + - PAGE IncidentPostmortemType: default: incident_postmortems description: Incident postmortem resource type. @@ -50878,6 +50996,7 @@ components: is not required to set downtimes. monitors_read: View monitors. monitors_write: Edit, delete, and resolve individual monitors. + oncall_page: Create and manage on-call pages. org_connections_read: Read cross organization connections. org_connections_write: Create, edit, and delete cross organization connections. org_management: Edit org configurations, including authentication and @@ -59667,6 +59786,54 @@ paths: x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/page: + post: + description: Create a page from an incident. + operationId: CreatePageFromIncident + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentCreatePageFromIncidentRequest' + description: Page creation request payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentCreatePageResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + - oncall_page + summary: Create a page from an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - incident_read + - oncall_page + x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, + + contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/incidents/{incident_id}/relationships/integrations: get: description: Get all integration metadata for an incident. diff --git a/examples/v2/incidents/CreatePageFromIncident.ts b/examples/v2/incidents/CreatePageFromIncident.ts new file mode 100644 index 000000000000..f588b62471c8 --- /dev/null +++ b/examples/v2/incidents/CreatePageFromIncident.ts @@ -0,0 +1,37 @@ +/** + * Create a page from an incident returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createPageFromIncident"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiCreatePageFromIncidentRequest = { + body: { + data: { + attributes: { + description: "Page created for incident response", + services: ["web-service", "api-service"], + tags: ["urgent", "production"], + target: { + identifier: "team-handle", + type: "team_handle", + }, + title: "Incident Response Page", + }, + type: "page", + }, + }, + incidentId: "incident_id", +}; + +apiInstance + .createPageFromIncident(params) + .then((data: v2.IncidentCreatePageResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 727886196a45..e90d567a4eca 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -5530,6 +5530,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "{}", }, + "v2.CreatePageFromIncident": { + "incidentId": { + "type": "string", + "format": "", + }, + "body": { + "type": "IncidentCreatePageFromIncidentRequest", + "format": "", + }, + "operationResponseType": "IncidentCreatePageResponse", + }, "v2.ListIncidentIntegrations": { "incidentId": { "type": "string", diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 74ae965968fd..1b6eb3821ae1 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -21,6 +21,33 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Create a page from an incident returns "Bad Request" response + Given operation "CreatePageFromIncident" enabled + And new "CreatePageFromIncident" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create a page from an incident returns "Not Found" response + Given operation "CreatePageFromIncident" enabled + And new "CreatePageFromIncident" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Create a page from an incident returns "OK" response + Given operation "CreatePageFromIncident" enabled + And new "CreatePageFromIncident" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Page created for incident response", "services": ["web-service", "api-service"], "tags": ["urgent", "production"], "target": {"identifier": "team-handle", "type": "team_handle"}, "title": "Incident Response Page"}, "type": "page"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Create an incident attachment returns "OK" response Given operation "UpdateIncidentAttachments" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 6fcf52fcedc9..985aaa0d7b35 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1423,6 +1423,13 @@ "type": "idempotent" } }, + "CreatePageFromIncident": { + "tag": "Incidents", + "undo": { + "parameters": [], + "type": "unsafe" + } + }, "ListIncidentIntegrations": { "tag": "Incidents", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index a5f3561eca57..a54c7b8ff1c9 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -260,6 +260,7 @@ export function createConfiguration( "v2.createIncidentNotificationTemplate": false, "v2.createIncidentTodo": false, "v2.createIncidentType": false, + "v2.createPageFromIncident": false, "v2.deleteIncident": false, "v2.deleteIncidentImpact": false, "v2.deleteIncidentIntegration": false, diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index 33d7224fe1ff..8b9a7ab50126 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -24,6 +24,8 @@ import { IncidentAttachmentRelatedObject } from "../models/IncidentAttachmentRel import { IncidentAttachmentsResponse } from "../models/IncidentAttachmentsResponse"; import { IncidentAttachmentUpdateRequest } from "../models/IncidentAttachmentUpdateRequest"; import { IncidentAttachmentUpdateResponse } from "../models/IncidentAttachmentUpdateResponse"; +import { IncidentCreatePageFromIncidentRequest } from "../models/IncidentCreatePageFromIncidentRequest"; +import { IncidentCreatePageResponse } from "../models/IncidentCreatePageResponse"; import { IncidentCreateRequest } from "../models/IncidentCreateRequest"; import { IncidentImpactCreateRequest } from "../models/IncidentImpactCreateRequest"; import { IncidentImpactRelatedObject } from "../models/IncidentImpactRelatedObject"; @@ -449,6 +451,68 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createPageFromIncident( + incidentId: string, + body: IncidentCreatePageFromIncidentRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createPageFromIncident'"); + if (!_config.unstableOperations["v2.createPageFromIncident"]) { + throw new Error( + "Unstable operation 'createPageFromIncident' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError("incidentId", "createPageFromIncident"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createPageFromIncident"); + } + + // Path Params + const localVarPath = "/api/v2/incidents/{incident_id}/page".replace( + "{incident_id}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.IncidentsApi.createPageFromIncident") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "IncidentCreatePageFromIncidentRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async deleteIncident( incidentId: string, _options?: Configuration @@ -2463,6 +2527,70 @@ export class IncidentsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createPageFromIncident + * @throws ApiException if the response code was not in [200, 299] + */ + public async createPageFromIncident( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: IncidentCreatePageResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentCreatePageResponse" + ) as IncidentCreatePageResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentCreatePageResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentCreatePageResponse", + "" + ) as IncidentCreatePageResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -4331,6 +4459,19 @@ export interface IncidentsApiCreateIncidentTypeRequest { body: IncidentTypeCreateRequest; } +export interface IncidentsApiCreatePageFromIncidentRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * Page creation request payload. + * @type IncidentCreatePageFromIncidentRequest + */ + body: IncidentCreatePageFromIncidentRequest; +} + export interface IncidentsApiDeleteIncidentRequest { /** * The UUID of the incident. @@ -4901,6 +5042,28 @@ export class IncidentsApi { }); } + /** + * Create a page from an incident. + * @param param The request object + */ + public createPageFromIncident( + param: IncidentsApiCreatePageFromIncidentRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createPageFromIncident( + param.incidentId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createPageFromIncident(responseContext); + }); + }); + } + /** * Deletes an existing incident from the users organization. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 0bd4f6335a36..feb0fd0d6d1a 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -350,6 +350,7 @@ export { IncidentsApiCreateIncidentNotificationTemplateRequest, IncidentsApiCreateIncidentTodoRequest, IncidentsApiCreateIncidentTypeRequest, + IncidentsApiCreatePageFromIncidentRequest, IncidentsApiDeleteIncidentRequest, IncidentsApiDeleteIncidentImpactRequest, IncidentsApiDeleteIncidentIntegrationRequest, @@ -2122,6 +2123,11 @@ export { IncidentAttachmentUpdateRequest } from "./models/IncidentAttachmentUpda export { IncidentAttachmentUpdateResponse } from "./models/IncidentAttachmentUpdateResponse"; export { IncidentCreateAttributes } from "./models/IncidentCreateAttributes"; export { IncidentCreateData } from "./models/IncidentCreateData"; +export { IncidentCreatePageAttributes } from "./models/IncidentCreatePageAttributes"; +export { IncidentCreatePageFromIncidentData } from "./models/IncidentCreatePageFromIncidentData"; +export { IncidentCreatePageFromIncidentRequest } from "./models/IncidentCreatePageFromIncidentRequest"; +export { IncidentCreatePageResponse } from "./models/IncidentCreatePageResponse"; +export { IncidentCreatePageResponseData } from "./models/IncidentCreatePageResponseData"; export { IncidentCreateRelationships } from "./models/IncidentCreateRelationships"; export { IncidentCreateRequest } from "./models/IncidentCreateRequest"; export { IncidentFieldAttributes } from "./models/IncidentFieldAttributes"; @@ -2185,6 +2191,10 @@ export { IncidentNotificationTemplateResponseData } from "./models/IncidentNotif export { IncidentNotificationTemplateType } from "./models/IncidentNotificationTemplateType"; export { IncidentNotificationTemplateUpdateAttributes } from "./models/IncidentNotificationTemplateUpdateAttributes"; export { IncidentNotificationTemplateUpdateData } from "./models/IncidentNotificationTemplateUpdateData"; +export { IncidentPageIdType } from "./models/IncidentPageIdType"; +export { IncidentPageTarget } from "./models/IncidentPageTarget"; +export { IncidentPageTargetType } from "./models/IncidentPageTargetType"; +export { IncidentPageType } from "./models/IncidentPageType"; export { IncidentPostmortemType } from "./models/IncidentPostmortemType"; export { IncidentRelatedObject } from "./models/IncidentRelatedObject"; export { IncidentRespondersType } from "./models/IncidentRespondersType"; diff --git a/packages/datadog-api-client-v2/models/IncidentCreatePageAttributes.ts b/packages/datadog-api-client-v2/models/IncidentCreatePageAttributes.ts new file mode 100644 index 000000000000..8b49db906b54 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentCreatePageAttributes.ts @@ -0,0 +1,87 @@ +/** + * 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 { IncidentPageTarget } from "./IncidentPageTarget"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating a page from an incident. + */ +export class IncidentCreatePageAttributes { + /** + * Description of the page. + */ + "description"?: string; + /** + * List of services associated with the page. + */ + "services"?: Array; + /** + * List of tags for the page. + */ + "tags"?: Array; + /** + * Target for creating a page from an incident. + */ + "target": IncidentPageTarget; + /** + * Title of the page. + */ + "title": 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 = { + description: { + baseName: "description", + type: "string", + }, + services: { + baseName: "services", + type: "Array", + }, + tags: { + baseName: "tags", + type: "Array", + }, + target: { + baseName: "target", + type: "IncidentPageTarget", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentCreatePageAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentData.ts b/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentData.ts new file mode 100644 index 000000000000..08988982a3d5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentData.ts @@ -0,0 +1,64 @@ +/** + * 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 { IncidentCreatePageAttributes } from "./IncidentCreatePageAttributes"; +import { IncidentPageType } from "./IncidentPageType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data for creating a page from an incident. + */ +export class IncidentCreatePageFromIncidentData { + /** + * Attributes for creating a page from an incident. + */ + "attributes": IncidentCreatePageAttributes; + /** + * Incident page type. + */ + "type": IncidentPageType; + + /** + * 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 = { + attributes: { + baseName: "attributes", + type: "IncidentCreatePageAttributes", + required: true, + }, + type: { + baseName: "type", + type: "IncidentPageType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentCreatePageFromIncidentData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentRequest.ts b/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentRequest.ts new file mode 100644 index 000000000000..4a44b90e3c4e --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentCreatePageFromIncidentRequest.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 { IncidentCreatePageFromIncidentData } from "./IncidentCreatePageFromIncidentData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request to create a page from an incident. + */ +export class IncidentCreatePageFromIncidentRequest { + /** + * Data for creating a page from an incident. + */ + "data": IncidentCreatePageFromIncidentData; + + /** + * 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: "IncidentCreatePageFromIncidentData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentCreatePageFromIncidentRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentCreatePageResponse.ts b/packages/datadog-api-client-v2/models/IncidentCreatePageResponse.ts new file mode 100644 index 000000000000..5fc028d94be3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentCreatePageResponse.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 { IncidentCreatePageResponseData } from "./IncidentCreatePageResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response from creating a page from an incident. + */ +export class IncidentCreatePageResponse { + /** + * Data from creating a page. + */ + "data": IncidentCreatePageResponseData; + + /** + * 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: "IncidentCreatePageResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentCreatePageResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentCreatePageResponseData.ts b/packages/datadog-api-client-v2/models/IncidentCreatePageResponseData.ts new file mode 100644 index 000000000000..c71b56379af8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentCreatePageResponseData.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 { IncidentPageIdType } from "./IncidentPageIdType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data from creating a page. + */ +export class IncidentCreatePageResponseData { + /** + * The UUID of the created page. + */ + "id": string; + /** + * Incident page ID type. + */ + "type": IncidentPageIdType; + + /** + * 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, + }, + type: { + baseName: "type", + type: "IncidentPageIdType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentCreatePageResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentPageIdType.ts b/packages/datadog-api-client-v2/models/IncidentPageIdType.ts new file mode 100644 index 000000000000..8ac3be1f899b --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentPageIdType.ts @@ -0,0 +1,14 @@ +/** + * 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"; + +/** + * Incident page ID type. + */ + +export type IncidentPageIdType = typeof PAGE_UUID | UnparsedObject; +export const PAGE_UUID = "page_uuid"; diff --git a/packages/datadog-api-client-v2/models/IncidentPageTarget.ts b/packages/datadog-api-client-v2/models/IncidentPageTarget.ts new file mode 100644 index 000000000000..40c82884a7d4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentPageTarget.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 { IncidentPageTargetType } from "./IncidentPageTargetType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Target for creating a page from an incident. + */ +export class IncidentPageTarget { + /** + * The identifier of the target (team handle, team UUID, or user UUID). + */ + "identifier": string; + /** + * Type of page target for incident pages. + */ + "type": IncidentPageTargetType; + + /** + * 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 = { + identifier: { + baseName: "identifier", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "IncidentPageTargetType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentPageTarget.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentPageTargetType.ts b/packages/datadog-api-client-v2/models/IncidentPageTargetType.ts new file mode 100644 index 000000000000..50f4466df4ea --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentPageTargetType.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"; + +/** + * Type of page target for incident pages. + */ + +export type IncidentPageTargetType = + | typeof TEAM_HANDLE + | typeof TEAM_UUID + | typeof USER_UUID + | UnparsedObject; +export const TEAM_HANDLE = "team_handle"; +export const TEAM_UUID = "team_uuid"; +export const USER_UUID = "user_uuid"; diff --git a/packages/datadog-api-client-v2/models/IncidentPageType.ts b/packages/datadog-api-client-v2/models/IncidentPageType.ts new file mode 100644 index 000000000000..8940424f69dc --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentPageType.ts @@ -0,0 +1,14 @@ +/** + * 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"; + +/** + * Incident page type. + */ + +export type IncidentPageType = typeof PAGE | UnparsedObject; +export const PAGE = "page"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 4cdedde02d70..aff1af4bffa2 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -960,6 +960,11 @@ import { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./Incid import { IncidentAttachmentsResponse } from "./IncidentAttachmentsResponse"; import { IncidentCreateAttributes } from "./IncidentCreateAttributes"; import { IncidentCreateData } from "./IncidentCreateData"; +import { IncidentCreatePageAttributes } from "./IncidentCreatePageAttributes"; +import { IncidentCreatePageFromIncidentData } from "./IncidentCreatePageFromIncidentData"; +import { IncidentCreatePageFromIncidentRequest } from "./IncidentCreatePageFromIncidentRequest"; +import { IncidentCreatePageResponse } from "./IncidentCreatePageResponse"; +import { IncidentCreatePageResponseData } from "./IncidentCreatePageResponseData"; import { IncidentCreateRelationships } from "./IncidentCreateRelationships"; import { IncidentCreateRequest } from "./IncidentCreateRequest"; import { IncidentFieldAttributesMultipleValue } from "./IncidentFieldAttributesMultipleValue"; @@ -1008,6 +1013,7 @@ import { IncidentNotificationTemplateRelationships } from "./IncidentNotificatio import { IncidentNotificationTemplateResponseData } from "./IncidentNotificationTemplateResponseData"; import { IncidentNotificationTemplateUpdateAttributes } from "./IncidentNotificationTemplateUpdateAttributes"; import { IncidentNotificationTemplateUpdateData } from "./IncidentNotificationTemplateUpdateData"; +import { IncidentPageTarget } from "./IncidentPageTarget"; import { IncidentResponse } from "./IncidentResponse"; import { IncidentResponseAttributes } from "./IncidentResponseAttributes"; import { IncidentResponseData } from "./IncidentResponseData"; @@ -2933,6 +2939,9 @@ const enumsMap: { [key: string]: any[] } = { ], IncidentNotificationRuleType: ["incident_notification_rules"], IncidentNotificationTemplateType: ["notification_templates"], + IncidentPageIdType: ["page_uuid"], + IncidentPageTargetType: ["team_handle", "team_uuid", "user_uuid"], + IncidentPageType: ["page"], IncidentPostmortemType: ["incident_postmortems"], IncidentRelatedObject: ["users", "attachments"], IncidentRespondersType: ["incident_responders"], @@ -5022,6 +5031,11 @@ const typeMap: { [index: string]: any } = { IncidentAttachmentsResponse: IncidentAttachmentsResponse, IncidentCreateAttributes: IncidentCreateAttributes, IncidentCreateData: IncidentCreateData, + IncidentCreatePageAttributes: IncidentCreatePageAttributes, + IncidentCreatePageFromIncidentData: IncidentCreatePageFromIncidentData, + IncidentCreatePageFromIncidentRequest: IncidentCreatePageFromIncidentRequest, + IncidentCreatePageResponse: IncidentCreatePageResponse, + IncidentCreatePageResponseData: IncidentCreatePageResponseData, IncidentCreateRelationships: IncidentCreateRelationships, IncidentCreateRequest: IncidentCreateRequest, IncidentFieldAttributesMultipleValue: IncidentFieldAttributesMultipleValue, @@ -5086,6 +5100,7 @@ const typeMap: { [index: string]: any } = { IncidentNotificationTemplateUpdateAttributes, IncidentNotificationTemplateUpdateData: IncidentNotificationTemplateUpdateData, + IncidentPageTarget: IncidentPageTarget, IncidentResponse: IncidentResponse, IncidentResponseAttributes: IncidentResponseAttributes, IncidentResponseData: IncidentResponseData,