From 47281446cb506a4dc16e8fa0d7c3256e9d6bed6d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 24 Oct 2025 14:07:36 +0000 Subject: [PATCH] Regenerate client from commit 1ec8354 of spec repo --- .generator/schemas/v2/openapi.yaml | 270 ++++++++++ examples/v2/events/CreateEventEmailAddress.ts | 31 ++ .../events/CreateOnCallEventEmailAddress.ts | 30 ++ .../v2/events/GetOnCallEventEmailAddress.ts | 18 + examples/v2/events/ListEventEmailAddresses.ts | 18 + features/support/scenarios_model_mapping.ts | 20 + features/v2/events.feature | 30 ++ features/v2/undo.json | 28 + .../configuration.ts | 4 + .../datadog-api-client-v2/apis/EventsApi.ts | 492 ++++++++++++++++++ packages/datadog-api-client-v2/index.ts | 16 + .../models/CreateEventEmailAddressRequest.ts | 47 ++ .../CreateEventEmailAddressRequestData.ts | 57 ++ ...eEventEmailAddressRequestDataAttributes.ts | 69 +++ .../CreateOnCallEventEmailAddressRequest.ts | 47 ++ ...reateOnCallEventEmailAddressRequestData.ts | 57 ++ ...lEventEmailAddressRequestDataAttributes.ts | 68 +++ .../models/EventEmailAddressResponse.ts | 47 ++ .../models/EventEmailAddressResponseArray.ts | 48 ++ .../models/EventEmailAddressResponseData.ts | 69 +++ ...EventEmailAddressResponseDataAttributes.ts | 94 ++++ ...ntEmailAddressResponseDataRelationships.ts | 53 ++ ...ailAddressResponseDataRelationshipsUser.ts | 48 ++ ...ddressResponseDataRelationshipsUserData.ts | 57 ++ .../models/EventEmailsType.ts | 14 + .../models/ObjectSerializer.ts | 34 ++ 26 files changed, 1766 insertions(+) create mode 100644 examples/v2/events/CreateEventEmailAddress.ts create mode 100644 examples/v2/events/CreateOnCallEventEmailAddress.ts create mode 100644 examples/v2/events/GetOnCallEventEmailAddress.ts create mode 100644 examples/v2/events/ListEventEmailAddresses.ts create mode 100644 packages/datadog-api-client-v2/models/CreateEventEmailAddressRequest.ts create mode 100644 packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequest.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponse.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseArray.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseData.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUser.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUserData.ts create mode 100644 packages/datadog-api-client-v2/models/EventEmailsType.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2c64bbd7a3fb..5d5c5b1803b5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12289,6 +12289,46 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateEventEmailAddressRequest: + properties: + data: + $ref: '#/components/schemas/CreateEventEmailAddressRequestData' + type: object + CreateEventEmailAddressRequestData: + properties: + attributes: + $ref: '#/components/schemas/CreateEventEmailAddressRequestDataAttributes' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + type: object + CreateEventEmailAddressRequestDataAttributes: + properties: + alert_type: + type: string + description: + type: string + format: + example: '' + type: string + notify_handles: + example: + - '' + items: + type: string + type: array + tags: + example: + - '' + items: + type: string + type: array + required: + - format + - notify_handles + - tags + type: object CreateIncidentNotificationRuleRequest: description: Create request for a notification rule. properties: @@ -12341,6 +12381,41 @@ components: - name - targets type: object + CreateOnCallEventEmailAddressRequest: + properties: + data: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequestData' + type: object + CreateOnCallEventEmailAddressRequestData: + properties: + attributes: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequestDataAttributes' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + type: object + CreateOnCallEventEmailAddressRequestDataAttributes: + properties: + alert_type: + type: string + description: + type: string + format: + example: '' + type: string + tags: + example: + - '' + items: + type: string + type: array + team_handle: + type: string + required: + - format + - tags + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -18701,6 +18776,112 @@ components: the default subdomain. type: string type: object + EventEmailAddressResponse: + properties: + data: + $ref: '#/components/schemas/EventEmailAddressResponseData' + type: object + EventEmailAddressResponseArray: + properties: + data: + items: + $ref: '#/components/schemas/EventEmailAddressResponseData' + type: array + required: + - data + type: object + EventEmailAddressResponseData: + properties: + attributes: + $ref: '#/components/schemas/EventEmailAddressResponseDataAttributes' + id: + example: '' + type: string + relationships: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationships' + type: + $ref: '#/components/schemas/EventEmailsType' + required: + - type + - id + type: object + EventEmailAddressResponseDataAttributes: + properties: + alert_type: + type: string + created_at: + example: '' + format: date-time + type: string + description: + type: string + email: + example: '' + type: string + format: + example: '' + type: string + last_used_at: + format: date-time + type: string + notify_handles: + example: + - '' + items: + type: string + type: array + revoked_at: + format: date-time + type: string + tags: + example: + - '' + items: + type: string + type: array + required: + - created_at + - email + - format + - notify_handles + - tags + type: object + EventEmailAddressResponseDataRelationships: + properties: + created_by: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUser' + revoked_by: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUser' + required: + - created_by + type: object + EventEmailAddressResponseDataRelationshipsUser: + properties: + data: + $ref: '#/components/schemas/EventEmailAddressResponseDataRelationshipsUserData' + required: + - data + type: object + EventEmailAddressResponseDataRelationshipsUserData: + properties: + id: + example: '' + type: string + type: + $ref: '#/components/schemas/UsersType' + required: + - type + - id + type: object + EventEmailsType: + default: event_emails + description: Event emails resource type. + enum: + - event_emails + example: event_emails + type: string + x-enum-varnames: + - EVENT_EMAILS EventPayload: additionalProperties: false description: Event attributes. @@ -61743,6 +61924,92 @@ paths: tags: - Events x-codegen-request-body-name: body + /api/v2/events/mail: + get: + operationId: ListEventEmailAddresses + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponseArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List event email addresses + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + post: + operationId: CreateEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEventEmailAddressRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponse' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/events/mail/on-call: + get: + operationId: GetOnCallEventEmailAddress + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponseArray' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' + post: + operationId: CreateOnCallEventEmailAddress + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateOnCallEventEmailAddressRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/EventEmailAddressResponse' + description: Created + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create on-call event email address + tags: + - Events + x-unstable: '**Note**: This endpoint may be subject to changes.' /api/v2/events/search: post: description: 'List endpoint returns events that match an events search query. @@ -61771,6 +62038,9 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] summary: Search events tags: - Events diff --git a/examples/v2/events/CreateEventEmailAddress.ts b/examples/v2/events/CreateEventEmailAddress.ts new file mode 100644 index 000000000000..6702ec1c8ddc --- /dev/null +++ b/examples/v2/events/CreateEventEmailAddress.ts @@ -0,0 +1,31 @@ +/** + * Create event email address returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createEventEmailAddress"] = true; +const apiInstance = new v2.EventsApi(configuration); + +const params: v2.EventsApiCreateEventEmailAddressRequest = { + body: { + data: { + attributes: { + format: "", + notifyHandles: [""], + tags: [""], + }, + type: "event_emails", + }, + }, +}; + +apiInstance + .createEventEmailAddress(params) + .then((data: v2.EventEmailAddressResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/events/CreateOnCallEventEmailAddress.ts b/examples/v2/events/CreateOnCallEventEmailAddress.ts new file mode 100644 index 000000000000..62005cf71288 --- /dev/null +++ b/examples/v2/events/CreateOnCallEventEmailAddress.ts @@ -0,0 +1,30 @@ +/** + * Create on-call event email address returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createOnCallEventEmailAddress"] = true; +const apiInstance = new v2.EventsApi(configuration); + +const params: v2.EventsApiCreateOnCallEventEmailAddressRequest = { + body: { + data: { + attributes: { + format: "", + tags: [""], + }, + type: "event_emails", + }, + }, +}; + +apiInstance + .createOnCallEventEmailAddress(params) + .then((data: v2.EventEmailAddressResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/events/GetOnCallEventEmailAddress.ts b/examples/v2/events/GetOnCallEventEmailAddress.ts new file mode 100644 index 000000000000..e2efa3c5c6c8 --- /dev/null +++ b/examples/v2/events/GetOnCallEventEmailAddress.ts @@ -0,0 +1,18 @@ +/** + * Get on-call event email address returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.getOnCallEventEmailAddress"] = true; +const apiInstance = new v2.EventsApi(configuration); + +apiInstance + .getOnCallEventEmailAddress() + .then((data: v2.EventEmailAddressResponseArray) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/events/ListEventEmailAddresses.ts b/examples/v2/events/ListEventEmailAddresses.ts new file mode 100644 index 000000000000..dcf38f8bce96 --- /dev/null +++ b/examples/v2/events/ListEventEmailAddresses.ts @@ -0,0 +1,18 @@ +/** + * List event email addresses returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listEventEmailAddresses"] = true; +const apiInstance = new v2.EventsApi(configuration); + +apiInstance + .listEventEmailAddresses() + .then((data: v2.EventEmailAddressResponseArray) => { + 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 81fa4d1b3711..e02dd800d20e 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -5468,6 +5468,26 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "EventCreateResponsePayload", }, + "v2.ListEventEmailAddresses": { + "operationResponseType": "EventEmailAddressResponseArray", + }, + "v2.CreateEventEmailAddress": { + "body": { + "type": "CreateEventEmailAddressRequest", + "format": "", + }, + "operationResponseType": "EventEmailAddressResponse", + }, + "v2.GetOnCallEventEmailAddress": { + "operationResponseType": "EventEmailAddressResponseArray", + }, + "v2.CreateOnCallEventEmailAddress": { + "body": { + "type": "CreateOnCallEventEmailAddressRequest", + "format": "", + }, + "operationResponseType": "EventEmailAddressResponse", + }, "v2.SearchEvents": { "body": { "type": "EventsListRequest", diff --git a/features/v2/events.feature b/features/v2/events.feature index 61d824ce1084..5d9436920628 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -17,6 +17,22 @@ Feature: Events And a valid "appKeyAuth" key in the system And an instance of "Events" API + @generated @skip @team:DataDog/event-management + Scenario: Create event email address returns "Created" response + Given operation "CreateEventEmailAddress" enabled + And new "CreateEventEmailAddress" request + And body with value {"data": {"attributes": {"format": "", "notify_handles": [""], "tags": [""]}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/event-management + Scenario: Create on-call event email address returns "Created" response + Given operation "CreateOnCallEventEmailAddress" enabled + And new "CreateOnCallEventEmailAddress" request + And body with value {"data": {"attributes": {"format": "", "tags": [""]}, "type": "event_emails"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response Given new "ListEvents" request @@ -71,6 +87,20 @@ Feature: Events When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/event-management + Scenario: Get on-call event email address returns "OK" response + Given operation "GetOnCallEventEmailAddress" enabled + And new "GetOnCallEventEmailAddress" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/event-management + Scenario: List event email addresses returns "OK" response + Given operation "ListEventEmailAddresses" enabled + And new "ListEventEmailAddresses" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request diff --git a/features/v2/undo.json b/features/v2/undo.json index bb35cea36c2e..e94d595ef210 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1380,6 +1380,34 @@ "type": "safe" } }, + "ListEventEmailAddresses": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, + "CreateOnCallEventEmailAddress": { + "tag": "Events", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, "SearchEvents": { "tag": "Events", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 770c0eedfc63..415137b4d221 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -258,6 +258,10 @@ export function createConfiguration( "v2.cancelDataDeletionRequest": false, "v2.createDataDeletionRequest": false, "v2.getDataDeletionRequests": false, + "v2.createEventEmailAddress": false, + "v2.createOnCallEventEmailAddress": false, + "v2.getOnCallEventEmailAddress": false, + "v2.listEventEmailAddresses": false, "v2.createIncident": false, "v2.createIncidentImpact": false, "v2.createIncidentIntegration": false, diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index 9e5f3f79b336..10e5651a7bf3 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -17,8 +17,12 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { CreateEventEmailAddressRequest } from "../models/CreateEventEmailAddressRequest"; +import { CreateOnCallEventEmailAddressRequest } from "../models/CreateOnCallEventEmailAddressRequest"; import { EventCreateRequestPayload } from "../models/EventCreateRequestPayload"; import { EventCreateResponsePayload } from "../models/EventCreateResponsePayload"; +import { EventEmailAddressResponse } from "../models/EventEmailAddressResponse"; +import { EventEmailAddressResponseArray } from "../models/EventEmailAddressResponseArray"; import { EventResponse } from "../models/EventResponse"; import { EventsListRequest } from "../models/EventsListRequest"; import { EventsListResponse } from "../models/EventsListResponse"; @@ -69,6 +73,106 @@ export class EventsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async createEventEmailAddress( + body: CreateEventEmailAddressRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createEventEmailAddress'"); + if (!_config.unstableOperations["v2.createEventEmailAddress"]) { + throw new Error( + "Unstable operation 'createEventEmailAddress' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createEventEmailAddress"); + } + + // Path Params + const localVarPath = "/api/v2/events/mail"; + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.createEventEmailAddress") + .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, "CreateEventEmailAddressRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createOnCallEventEmailAddress( + body: CreateOnCallEventEmailAddressRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createOnCallEventEmailAddress'"); + if (!_config.unstableOperations["v2.createOnCallEventEmailAddress"]) { + throw new Error( + "Unstable operation 'createOnCallEventEmailAddress' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createOnCallEventEmailAddress"); + } + + // Path Params + const localVarPath = "/api/v2/events/mail/on-call"; + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.createOnCallEventEmailAddress") + .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, + "CreateOnCallEventEmailAddressRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getEvent( eventId: string, _options?: Configuration @@ -103,6 +207,68 @@ export class EventsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getOnCallEventEmailAddress( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getOnCallEventEmailAddress'"); + if (!_config.unstableOperations["v2.getOnCallEventEmailAddress"]) { + throw new Error( + "Unstable operation 'getOnCallEventEmailAddress' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/events/mail/on-call"; + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.getOnCallEventEmailAddress") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listEventEmailAddresses( + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listEventEmailAddresses'"); + if (!_config.unstableOperations["v2.listEventEmailAddresses"]) { + throw new Error( + "Unstable operation 'listEventEmailAddresses' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/events/mail"; + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.listEventEmailAddresses") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listEvents( filterQuery?: string, filterFrom?: string, @@ -297,6 +463,122 @@ export class EventsApiResponseProcessor { ); } + /** + * 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 createEventEmailAddress + * @throws ApiException if the response code was not in [200, 299] + */ + public async createEventEmailAddress( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: EventEmailAddressResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponse" + ) as EventEmailAddressResponse; + return body; + } + if (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: EventEmailAddressResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponse", + "" + ) as EventEmailAddressResponse; + 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 + * + * @params response Response returned by the server for a request to createOnCallEventEmailAddress + * @throws ApiException if the response code was not in [200, 299] + */ + public async createOnCallEventEmailAddress( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: EventEmailAddressResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponse" + ) as EventEmailAddressResponse; + return body; + } + if (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: EventEmailAddressResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponse", + "" + ) as EventEmailAddressResponse; + 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 @@ -359,6 +641,122 @@ export class EventsApiResponseProcessor { ); } + /** + * 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 getOnCallEventEmailAddress + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOnCallEventEmailAddress( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: EventEmailAddressResponseArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponseArray" + ) as EventEmailAddressResponseArray; + return body; + } + if (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: EventEmailAddressResponseArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponseArray", + "" + ) as EventEmailAddressResponseArray; + 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 + * + * @params response Response returned by the server for a request to listEventEmailAddresses + * @throws ApiException if the response code was not in [200, 299] + */ + public async listEventEmailAddresses( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: EventEmailAddressResponseArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponseArray" + ) as EventEmailAddressResponseArray; + return body; + } + if (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: EventEmailAddressResponseArray = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "EventEmailAddressResponseArray", + "" + ) as EventEmailAddressResponseArray; + 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 @@ -492,6 +890,20 @@ export interface EventsApiCreateEventRequest { body: EventCreateRequestPayload; } +export interface EventsApiCreateEventEmailAddressRequest { + /** + * @type CreateEventEmailAddressRequest + */ + body: CreateEventEmailAddressRequest; +} + +export interface EventsApiCreateOnCallEventEmailAddressRequest { + /** + * @type CreateOnCallEventEmailAddressRequest + */ + body: CreateOnCallEventEmailAddressRequest; +} + export interface EventsApiGetEventRequest { /** * The UID of the event. @@ -586,6 +998,48 @@ export class EventsApi { }); } + /** + * @param param The request object + */ + public createEventEmailAddress( + param: EventsApiCreateEventEmailAddressRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createEventEmailAddress( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createEventEmailAddress( + responseContext + ); + }); + }); + } + + /** + * @param param The request object + */ + public createOnCallEventEmailAddress( + param: EventsApiCreateOnCallEventEmailAddressRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createOnCallEventEmailAddress(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createOnCallEventEmailAddress( + responseContext + ); + }); + }); + } + /** * Get the details of an event by `event_id`. * @param param The request object @@ -607,6 +1061,44 @@ export class EventsApi { }); } + /** + * @param param The request object + */ + public getOnCallEventEmailAddress( + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getOnCallEventEmailAddress(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getOnCallEventEmailAddress( + responseContext + ); + }); + }); + } + + /** + * @param param The request object + */ + public listEventEmailAddresses( + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listEventEmailAddresses(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listEventEmailAddresses( + responseContext + ); + }); + }); + } + /** * List endpoint returns events that match an events search query. * [Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination). diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 28929834515c..08e18b249d04 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -318,6 +318,8 @@ export { export { EventsApiCreateEventRequest, + EventsApiCreateEventEmailAddressRequest, + EventsApiCreateOnCallEventEmailAddressRequest, EventsApiGetEventRequest, EventsApiListEventsRequest, EventsApiSearchEventsRequest, @@ -1572,11 +1574,17 @@ export { CreateDataDeletionRequestBodyAttributes } from "./models/CreateDataDele export { CreateDataDeletionRequestBodyData } from "./models/CreateDataDeletionRequestBodyData"; export { CreateDataDeletionRequestBodyDataType } from "./models/CreateDataDeletionRequestBodyDataType"; export { CreateDataDeletionResponseBody } from "./models/CreateDataDeletionResponseBody"; +export { CreateEventEmailAddressRequest } from "./models/CreateEventEmailAddressRequest"; +export { CreateEventEmailAddressRequestData } from "./models/CreateEventEmailAddressRequestData"; +export { CreateEventEmailAddressRequestDataAttributes } from "./models/CreateEventEmailAddressRequestDataAttributes"; export { CreateIncidentNotificationRuleRequest } from "./models/CreateIncidentNotificationRuleRequest"; export { CreateIncidentNotificationTemplateRequest } from "./models/CreateIncidentNotificationTemplateRequest"; export { CreateNotificationRuleParameters } from "./models/CreateNotificationRuleParameters"; export { CreateNotificationRuleParametersData } from "./models/CreateNotificationRuleParametersData"; export { CreateNotificationRuleParametersDataAttributes } from "./models/CreateNotificationRuleParametersDataAttributes"; +export { CreateOnCallEventEmailAddressRequest } from "./models/CreateOnCallEventEmailAddressRequest"; +export { CreateOnCallEventEmailAddressRequestData } from "./models/CreateOnCallEventEmailAddressRequestData"; +export { CreateOnCallEventEmailAddressRequestDataAttributes } from "./models/CreateOnCallEventEmailAddressRequestDataAttributes"; export { CreateOpenAPIResponse } from "./models/CreateOpenAPIResponse"; export { CreateOpenAPIResponseAttributes } from "./models/CreateOpenAPIResponseAttributes"; export { CreateOpenAPIResponseData } from "./models/CreateOpenAPIResponseData"; @@ -1982,6 +1990,14 @@ export { EventCreateResponseAttributesAttributes } from "./models/EventCreateRes export { EventCreateResponseAttributesAttributesEvt } from "./models/EventCreateResponseAttributesAttributesEvt"; export { EventCreateResponsePayload } from "./models/EventCreateResponsePayload"; export { EventCreateResponsePayloadLinks } from "./models/EventCreateResponsePayloadLinks"; +export { EventEmailAddressResponse } from "./models/EventEmailAddressResponse"; +export { EventEmailAddressResponseArray } from "./models/EventEmailAddressResponseArray"; +export { EventEmailAddressResponseData } from "./models/EventEmailAddressResponseData"; +export { EventEmailAddressResponseDataAttributes } from "./models/EventEmailAddressResponseDataAttributes"; +export { EventEmailAddressResponseDataRelationships } from "./models/EventEmailAddressResponseDataRelationships"; +export { EventEmailAddressResponseDataRelationshipsUser } from "./models/EventEmailAddressResponseDataRelationshipsUser"; +export { EventEmailAddressResponseDataRelationshipsUserData } from "./models/EventEmailAddressResponseDataRelationshipsUserData"; +export { EventEmailsType } from "./models/EventEmailsType"; export { EventPayload } from "./models/EventPayload"; export { EventPayloadAttributes } from "./models/EventPayloadAttributes"; export { EventPayloadIntegrationId } from "./models/EventPayloadIntegrationId"; diff --git a/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequest.ts b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequest.ts new file mode 100644 index 000000000000..8b33b06875fb --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequest.ts @@ -0,0 +1,47 @@ +/** + * 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 { CreateEventEmailAddressRequestData } from "./CreateEventEmailAddressRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class CreateEventEmailAddressRequest { + "data"?: CreateEventEmailAddressRequestData; + + /** + * 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: "CreateEventEmailAddressRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateEventEmailAddressRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestData.ts b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestData.ts new file mode 100644 index 000000000000..d08d5919abeb --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestData.ts @@ -0,0 +1,57 @@ +/** + * 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 { CreateEventEmailAddressRequestDataAttributes } from "./CreateEventEmailAddressRequestDataAttributes"; +import { EventEmailsType } from "./EventEmailsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class CreateEventEmailAddressRequestData { + "attributes"?: CreateEventEmailAddressRequestDataAttributes; + /** + * Event emails resource type. + */ + "type": EventEmailsType; + + /** + * 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: "CreateEventEmailAddressRequestDataAttributes", + }, + type: { + baseName: "type", + type: "EventEmailsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateEventEmailAddressRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestDataAttributes.ts new file mode 100644 index 000000000000..3e47e34f2354 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateEventEmailAddressRequestDataAttributes.ts @@ -0,0 +1,69 @@ +/** + * 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"; + +export class CreateEventEmailAddressRequestDataAttributes { + "alertType"?: string; + "description"?: string; + "format": string; + "notifyHandles": Array; + "tags": Array; + + /** + * 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 = { + alertType: { + baseName: "alert_type", + type: "string", + }, + description: { + baseName: "description", + type: "string", + }, + format: { + baseName: "format", + type: "string", + required: true, + }, + notifyHandles: { + baseName: "notify_handles", + type: "Array", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateEventEmailAddressRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequest.ts b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequest.ts new file mode 100644 index 000000000000..995ca479b11b --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequest.ts @@ -0,0 +1,47 @@ +/** + * 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 { CreateOnCallEventEmailAddressRequestData } from "./CreateOnCallEventEmailAddressRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class CreateOnCallEventEmailAddressRequest { + "data"?: CreateOnCallEventEmailAddressRequestData; + + /** + * 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: "CreateOnCallEventEmailAddressRequestData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOnCallEventEmailAddressRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestData.ts b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestData.ts new file mode 100644 index 000000000000..b95f4472d772 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestData.ts @@ -0,0 +1,57 @@ +/** + * 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 { CreateOnCallEventEmailAddressRequestDataAttributes } from "./CreateOnCallEventEmailAddressRequestDataAttributes"; +import { EventEmailsType } from "./EventEmailsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class CreateOnCallEventEmailAddressRequestData { + "attributes"?: CreateOnCallEventEmailAddressRequestDataAttributes; + /** + * Event emails resource type. + */ + "type": EventEmailsType; + + /** + * 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: "CreateOnCallEventEmailAddressRequestDataAttributes", + }, + type: { + baseName: "type", + type: "EventEmailsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOnCallEventEmailAddressRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestDataAttributes.ts new file mode 100644 index 000000000000..fdbeba72c5a8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOnCallEventEmailAddressRequestDataAttributes.ts @@ -0,0 +1,68 @@ +/** + * 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"; + +export class CreateOnCallEventEmailAddressRequestDataAttributes { + "alertType"?: string; + "description"?: string; + "format": string; + "tags": Array; + "teamHandle"?: 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 = { + alertType: { + baseName: "alert_type", + type: "string", + }, + description: { + baseName: "description", + type: "string", + }, + format: { + baseName: "format", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + teamHandle: { + baseName: "team_handle", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOnCallEventEmailAddressRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponse.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponse.ts new file mode 100644 index 000000000000..96cb1f00e5c6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponse.ts @@ -0,0 +1,47 @@ +/** + * 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 { EventEmailAddressResponseData } from "./EventEmailAddressResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponse { + "data"?: EventEmailAddressResponseData; + + /** + * 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: "EventEmailAddressResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseArray.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseArray.ts new file mode 100644 index 000000000000..18ddb47e7e5f --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseArray.ts @@ -0,0 +1,48 @@ +/** + * 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 { EventEmailAddressResponseData } from "./EventEmailAddressResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponseArray { + "data": Array; + + /** + * 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: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseArray.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseData.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseData.ts new file mode 100644 index 000000000000..f4a404ab6997 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseData.ts @@ -0,0 +1,69 @@ +/** + * 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 { EventEmailAddressResponseDataAttributes } from "./EventEmailAddressResponseDataAttributes"; +import { EventEmailAddressResponseDataRelationships } from "./EventEmailAddressResponseDataRelationships"; +import { EventEmailsType } from "./EventEmailsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponseData { + "attributes"?: EventEmailAddressResponseDataAttributes; + "id": string; + "relationships"?: EventEmailAddressResponseDataRelationships; + /** + * Event emails resource type. + */ + "type": EventEmailsType; + + /** + * 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: "EventEmailAddressResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "EventEmailAddressResponseDataRelationships", + }, + type: { + baseName: "type", + type: "EventEmailsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataAttributes.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataAttributes.ts new file mode 100644 index 000000000000..6bc54f909d6f --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataAttributes.ts @@ -0,0 +1,94 @@ +/** + * 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"; + +export class EventEmailAddressResponseDataAttributes { + "alertType"?: string; + "createdAt": Date; + "description"?: string; + "email": string; + "format": string; + "lastUsedAt"?: Date; + "notifyHandles": Array; + "revokedAt"?: Date; + "tags": Array; + + /** + * 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 = { + alertType: { + baseName: "alert_type", + type: "string", + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + description: { + baseName: "description", + type: "string", + }, + email: { + baseName: "email", + type: "string", + required: true, + }, + format: { + baseName: "format", + type: "string", + required: true, + }, + lastUsedAt: { + baseName: "last_used_at", + type: "Date", + format: "date-time", + }, + notifyHandles: { + baseName: "notify_handles", + type: "Array", + required: true, + }, + revokedAt: { + baseName: "revoked_at", + type: "Date", + format: "date-time", + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationships.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationships.ts new file mode 100644 index 000000000000..6a3161830232 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationships.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 { EventEmailAddressResponseDataRelationshipsUser } from "./EventEmailAddressResponseDataRelationshipsUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponseDataRelationships { + "createdBy": EventEmailAddressResponseDataRelationshipsUser; + "revokedBy"?: EventEmailAddressResponseDataRelationshipsUser; + + /** + * 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 = { + createdBy: { + baseName: "created_by", + type: "EventEmailAddressResponseDataRelationshipsUser", + required: true, + }, + revokedBy: { + baseName: "revoked_by", + type: "EventEmailAddressResponseDataRelationshipsUser", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseDataRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUser.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUser.ts new file mode 100644 index 000000000000..ebe9e93c2116 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUser.ts @@ -0,0 +1,48 @@ +/** + * 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 { EventEmailAddressResponseDataRelationshipsUserData } from "./EventEmailAddressResponseDataRelationshipsUserData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponseDataRelationshipsUser { + "data": EventEmailAddressResponseDataRelationshipsUserData; + + /** + * 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: "EventEmailAddressResponseDataRelationshipsUserData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseDataRelationshipsUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUserData.ts b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUserData.ts new file mode 100644 index 000000000000..8c7a93f387cd --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailAddressResponseDataRelationshipsUserData.ts @@ -0,0 +1,57 @@ +/** + * 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 { UsersType } from "./UsersType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +export class EventEmailAddressResponseDataRelationshipsUserData { + "id": string; + /** + * Users resource type. + */ + "type": UsersType; + + /** + * 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: "UsersType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventEmailAddressResponseDataRelationshipsUserData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventEmailsType.ts b/packages/datadog-api-client-v2/models/EventEmailsType.ts new file mode 100644 index 000000000000..c1481e8e87ed --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventEmailsType.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"; + +/** + * Event emails resource type. + */ + +export type EventEmailsType = typeof EVENT_EMAILS | UnparsedObject; +export const EVENT_EMAILS = "event_emails"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 5dc075eabb02..0e0d5f364f7d 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -506,11 +506,17 @@ import { CreateDataDeletionRequestBody } from "./CreateDataDeletionRequestBody"; import { CreateDataDeletionRequestBodyAttributes } from "./CreateDataDeletionRequestBodyAttributes"; import { CreateDataDeletionRequestBodyData } from "./CreateDataDeletionRequestBodyData"; import { CreateDataDeletionResponseBody } from "./CreateDataDeletionResponseBody"; +import { CreateEventEmailAddressRequest } from "./CreateEventEmailAddressRequest"; +import { CreateEventEmailAddressRequestData } from "./CreateEventEmailAddressRequestData"; +import { CreateEventEmailAddressRequestDataAttributes } from "./CreateEventEmailAddressRequestDataAttributes"; import { CreateIncidentNotificationRuleRequest } from "./CreateIncidentNotificationRuleRequest"; import { CreateIncidentNotificationTemplateRequest } from "./CreateIncidentNotificationTemplateRequest"; import { CreateNotificationRuleParameters } from "./CreateNotificationRuleParameters"; import { CreateNotificationRuleParametersData } from "./CreateNotificationRuleParametersData"; import { CreateNotificationRuleParametersDataAttributes } from "./CreateNotificationRuleParametersDataAttributes"; +import { CreateOnCallEventEmailAddressRequest } from "./CreateOnCallEventEmailAddressRequest"; +import { CreateOnCallEventEmailAddressRequestData } from "./CreateOnCallEventEmailAddressRequestData"; +import { CreateOnCallEventEmailAddressRequestDataAttributes } from "./CreateOnCallEventEmailAddressRequestDataAttributes"; import { CreateOpenAPIResponse } from "./CreateOpenAPIResponse"; import { CreateOpenAPIResponseAttributes } from "./CreateOpenAPIResponseAttributes"; import { CreateOpenAPIResponseData } from "./CreateOpenAPIResponseData"; @@ -827,6 +833,13 @@ import { EventCreateResponseAttributesAttributes } from "./EventCreateResponseAt import { EventCreateResponseAttributesAttributesEvt } from "./EventCreateResponseAttributesAttributesEvt"; import { EventCreateResponsePayload } from "./EventCreateResponsePayload"; import { EventCreateResponsePayloadLinks } from "./EventCreateResponsePayloadLinks"; +import { EventEmailAddressResponse } from "./EventEmailAddressResponse"; +import { EventEmailAddressResponseArray } from "./EventEmailAddressResponseArray"; +import { EventEmailAddressResponseData } from "./EventEmailAddressResponseData"; +import { EventEmailAddressResponseDataAttributes } from "./EventEmailAddressResponseDataAttributes"; +import { EventEmailAddressResponseDataRelationships } from "./EventEmailAddressResponseDataRelationships"; +import { EventEmailAddressResponseDataRelationshipsUser } from "./EventEmailAddressResponseDataRelationshipsUser"; +import { EventEmailAddressResponseDataRelationshipsUserData } from "./EventEmailAddressResponseDataRelationshipsUserData"; import { EventPayload } from "./EventPayload"; import { EventResponse } from "./EventResponse"; import { EventResponseAttributes } from "./EventResponseAttributes"; @@ -2904,6 +2917,7 @@ const enumsMap: { [key: string]: any[] } = { EscalationType: ["escalation_policy_steps"], EventCategory: ["change", "alert"], EventCreateRequestType: ["event"], + EventEmailsType: ["event_emails"], EventPayloadIntegrationId: ["custom-events"], EventPriority: ["normal", "low"], EventStatusType: [ @@ -4667,6 +4681,10 @@ const typeMap: { [index: string]: any } = { CreateDataDeletionRequestBodyAttributes, CreateDataDeletionRequestBodyData: CreateDataDeletionRequestBodyData, CreateDataDeletionResponseBody: CreateDataDeletionResponseBody, + CreateEventEmailAddressRequest: CreateEventEmailAddressRequest, + CreateEventEmailAddressRequestData: CreateEventEmailAddressRequestData, + CreateEventEmailAddressRequestDataAttributes: + CreateEventEmailAddressRequestDataAttributes, CreateIncidentNotificationRuleRequest: CreateIncidentNotificationRuleRequest, CreateIncidentNotificationTemplateRequest: CreateIncidentNotificationTemplateRequest, @@ -4674,6 +4692,11 @@ const typeMap: { [index: string]: any } = { CreateNotificationRuleParametersData: CreateNotificationRuleParametersData, CreateNotificationRuleParametersDataAttributes: CreateNotificationRuleParametersDataAttributes, + CreateOnCallEventEmailAddressRequest: CreateOnCallEventEmailAddressRequest, + CreateOnCallEventEmailAddressRequestData: + CreateOnCallEventEmailAddressRequestData, + CreateOnCallEventEmailAddressRequestDataAttributes: + CreateOnCallEventEmailAddressRequestDataAttributes, CreateOpenAPIResponse: CreateOpenAPIResponse, CreateOpenAPIResponseAttributes: CreateOpenAPIResponseAttributes, CreateOpenAPIResponseData: CreateOpenAPIResponseData, @@ -5054,6 +5077,17 @@ const typeMap: { [index: string]: any } = { EventCreateResponseAttributesAttributesEvt, EventCreateResponsePayload: EventCreateResponsePayload, EventCreateResponsePayloadLinks: EventCreateResponsePayloadLinks, + EventEmailAddressResponse: EventEmailAddressResponse, + EventEmailAddressResponseArray: EventEmailAddressResponseArray, + EventEmailAddressResponseData: EventEmailAddressResponseData, + EventEmailAddressResponseDataAttributes: + EventEmailAddressResponseDataAttributes, + EventEmailAddressResponseDataRelationships: + EventEmailAddressResponseDataRelationships, + EventEmailAddressResponseDataRelationshipsUser: + EventEmailAddressResponseDataRelationshipsUser, + EventEmailAddressResponseDataRelationshipsUserData: + EventEmailAddressResponseDataRelationshipsUserData, EventPayload: EventPayload, EventResponse: EventResponse, EventResponseAttributes: EventResponseAttributes,