From a00db831a3f3b1cf614c830f2a6949d97f1f47a2 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 1 Oct 2025 16:47:17 +0000 Subject: [PATCH] Regenerate client from commit 2776a1d of spec repo --- .generator/schemas/v2/openapi.yaml | 167 ++++++++++++++++++ features/v2/incidents.feature | 27 +++ features/v2/undo.json | 7 + .../src/support/scenarios_model_mapping.ts | 11 ++ services/incidents/src/v2/IncidentsApi.ts | 165 +++++++++++++++++ services/incidents/src/v2/index.ts | 10 ++ .../v2/models/IncidentCreatePageAttributes.ts | 80 +++++++++ .../IncidentCreatePageFromIncidentData.ts | 57 ++++++ .../IncidentCreatePageFromIncidentRequest.ts | 47 +++++ .../v2/models/IncidentCreatePageResponse.ts | 47 +++++ .../models/IncidentCreatePageResponseData.ts | 56 ++++++ .../src/v2/models/IncidentPageIdType.ts | 7 + .../src/v2/models/IncidentPageTarget.ts | 56 ++++++ .../src/v2/models/IncidentPageTargetType.ts | 13 ++ .../src/v2/models/IncidentPageType.ts | 7 + .../incidents/src/v2/models/TypingInfo.ts | 16 ++ 16 files changed, 773 insertions(+) create mode 100644 services/incidents/src/v2/models/IncidentCreatePageAttributes.ts create mode 100644 services/incidents/src/v2/models/IncidentCreatePageFromIncidentData.ts create mode 100644 services/incidents/src/v2/models/IncidentCreatePageFromIncidentRequest.ts create mode 100644 services/incidents/src/v2/models/IncidentCreatePageResponse.ts create mode 100644 services/incidents/src/v2/models/IncidentCreatePageResponseData.ts create mode 100644 services/incidents/src/v2/models/IncidentPageIdType.ts create mode 100644 services/incidents/src/v2/models/IncidentPageTarget.ts create mode 100644 services/incidents/src/v2/models/IncidentPageTargetType.ts create mode 100644 services/incidents/src/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/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/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 04263f64b149..0be480a051b2 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -5540,6 +5540,17 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "{}", }, + "IncidentsApi.V2.CreatePageFromIncident": { + incidentId: { + type: "string", + format: "", + }, + body: { + type: "IncidentCreatePageFromIncidentRequest", + format: "", + }, + operationResponseType: "IncidentCreatePageResponse", + }, "IncidentsApi.V2.ListIncidentIntegrations": { incidentId: { type: "string", diff --git a/services/incidents/src/v2/IncidentsApi.ts b/services/incidents/src/v2/IncidentsApi.ts index 19b6d7759eb6..1380bec64d90 100644 --- a/services/incidents/src/v2/IncidentsApi.ts +++ b/services/incidents/src/v2/IncidentsApi.ts @@ -30,6 +30,8 @@ import { IncidentAttachmentRelatedObject } from "./models/IncidentAttachmentRela 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"; @@ -535,6 +537,72 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createPageFromIncident( + incidentId: string, + body: IncidentCreatePageFromIncidentRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + if (!_config.unstableOperations["IncidentsApi.v2.createPageFromIncident"]) { + throw new Error( + "Unstable operation 'createPageFromIncident' is disabled. Enable it by setting `configuration.unstableOperations['IncidentsApi.v2.createPageFromIncident'] = true`", + ); + } + + // 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 { server, overrides } = _config.getServerAndOverrides( + "IncidentsApi.v2.createPageFromIncident", + IncidentsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "IncidentCreatePageFromIncidentRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async deleteIncident( incidentId: string, _options?: Configuration, @@ -2877,6 +2945,68 @@ 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 = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: IncidentCreatePageResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "IncidentCreatePageResponse", + ) as IncidentCreatePageResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "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 = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "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 @@ -4663,6 +4793,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. @@ -5235,6 +5378,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/services/incidents/src/v2/index.ts b/services/incidents/src/v2/index.ts index 8270167e8974..62b955fca589 100644 --- a/services/incidents/src/v2/index.ts +++ b/services/incidents/src/v2/index.ts @@ -6,6 +6,7 @@ export { IncidentsApiCreateIncidentNotificationTemplateRequest, IncidentsApiCreateIncidentTodoRequest, IncidentsApiCreateIncidentTypeRequest, + IncidentsApiCreatePageFromIncidentRequest, IncidentsApiDeleteIncidentRequest, IncidentsApiDeleteIncidentImpactRequest, IncidentsApiDeleteIncidentIntegrationRequest, @@ -63,6 +64,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"; @@ -126,6 +132,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/services/incidents/src/v2/models/IncidentCreatePageAttributes.ts b/services/incidents/src/v2/models/IncidentCreatePageAttributes.ts new file mode 100644 index 000000000000..232fe2a12c17 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentCreatePageAttributes.ts @@ -0,0 +1,80 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentPageTarget } from "./IncidentPageTarget"; + +/** + * 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/services/incidents/src/v2/models/IncidentCreatePageFromIncidentData.ts b/services/incidents/src/v2/models/IncidentCreatePageFromIncidentData.ts new file mode 100644 index 000000000000..6a605aa6c703 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentCreatePageFromIncidentData.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentCreatePageAttributes } from "./IncidentCreatePageAttributes"; +import { IncidentPageType } from "./IncidentPageType"; + +/** + * 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/services/incidents/src/v2/models/IncidentCreatePageFromIncidentRequest.ts b/services/incidents/src/v2/models/IncidentCreatePageFromIncidentRequest.ts new file mode 100644 index 000000000000..0e1de6e121ab --- /dev/null +++ b/services/incidents/src/v2/models/IncidentCreatePageFromIncidentRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentCreatePageFromIncidentData } from "./IncidentCreatePageFromIncidentData"; + +/** + * 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/services/incidents/src/v2/models/IncidentCreatePageResponse.ts b/services/incidents/src/v2/models/IncidentCreatePageResponse.ts new file mode 100644 index 000000000000..1b2651611f30 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentCreatePageResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentCreatePageResponseData } from "./IncidentCreatePageResponseData"; + +/** + * 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/services/incidents/src/v2/models/IncidentCreatePageResponseData.ts b/services/incidents/src/v2/models/IncidentCreatePageResponseData.ts new file mode 100644 index 000000000000..b2a1919dfa0b --- /dev/null +++ b/services/incidents/src/v2/models/IncidentCreatePageResponseData.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentPageIdType } from "./IncidentPageIdType"; + +/** + * 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/services/incidents/src/v2/models/IncidentPageIdType.ts b/services/incidents/src/v2/models/IncidentPageIdType.ts new file mode 100644 index 000000000000..a686bd7d0dd6 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentPageIdType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Incident page ID type. + */ +export type IncidentPageIdType = typeof PAGE_UUID | UnparsedObject; +export const PAGE_UUID = "page_uuid"; diff --git a/services/incidents/src/v2/models/IncidentPageTarget.ts b/services/incidents/src/v2/models/IncidentPageTarget.ts new file mode 100644 index 000000000000..db7cdc7af498 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentPageTarget.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { IncidentPageTargetType } from "./IncidentPageTargetType"; + +/** + * 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/services/incidents/src/v2/models/IncidentPageTargetType.ts b/services/incidents/src/v2/models/IncidentPageTargetType.ts new file mode 100644 index 000000000000..5d538a3517e5 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentPageTargetType.ts @@ -0,0 +1,13 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * 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/services/incidents/src/v2/models/IncidentPageType.ts b/services/incidents/src/v2/models/IncidentPageType.ts new file mode 100644 index 000000000000..fb9a116f20a2 --- /dev/null +++ b/services/incidents/src/v2/models/IncidentPageType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Incident page type. + */ +export type IncidentPageType = typeof PAGE | UnparsedObject; +export const PAGE = "page"; diff --git a/services/incidents/src/v2/models/TypingInfo.ts b/services/incidents/src/v2/models/TypingInfo.ts index ca7545d396c4..3601eaf5dcb6 100644 --- a/services/incidents/src/v2/models/TypingInfo.ts +++ b/services/incidents/src/v2/models/TypingInfo.ts @@ -17,6 +17,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"; @@ -65,6 +70,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"; @@ -189,6 +195,9 @@ export const TypingInfo: ModelTypingInfo = { ], 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"], @@ -272,6 +281,12 @@ export const TypingInfo: ModelTypingInfo = { IncidentAttachmentsResponse: IncidentAttachmentsResponse, IncidentCreateAttributes: IncidentCreateAttributes, IncidentCreateData: IncidentCreateData, + IncidentCreatePageAttributes: IncidentCreatePageAttributes, + IncidentCreatePageFromIncidentData: IncidentCreatePageFromIncidentData, + IncidentCreatePageFromIncidentRequest: + IncidentCreatePageFromIncidentRequest, + IncidentCreatePageResponse: IncidentCreatePageResponse, + IncidentCreatePageResponseData: IncidentCreatePageResponseData, IncidentCreateRelationships: IncidentCreateRelationships, IncidentCreateRequest: IncidentCreateRequest, IncidentFieldAttributesMultipleValue: IncidentFieldAttributesMultipleValue, @@ -341,6 +356,7 @@ export const TypingInfo: ModelTypingInfo = { IncidentNotificationTemplateUpdateAttributes, IncidentNotificationTemplateUpdateData: IncidentNotificationTemplateUpdateData, + IncidentPageTarget: IncidentPageTarget, IncidentResponse: IncidentResponse, IncidentResponseAttributes: IncidentResponseAttributes, IncidentResponseData: IncidentResponseData,