diff --git a/.apigentools-info b/.apigentools-info index bab82af45db4..935dacd70cc2 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-19 12:11:25.321241", - "spec_repo_commit": "a171e0a8" + "regenerated": "2025-06-20 13:49:04.166454", + "spec_repo_commit": "78730ba3" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-19 12:11:25.337389", - "spec_repo_commit": "a171e0a8" + "regenerated": "2025-06-20 13:49:04.182475", + "spec_repo_commit": "78730ba3" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6e5229840fb6..749f21e95b59 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2227,6 +2227,74 @@ components: - id - base_severity type: object + AlertEventAttributes: + description: Alert event attributes. + properties: + aggregation_key: + $ref: '#/components/schemas/V2EventAggregationKey' + custom: + description: JSON object of custom attributes. + example: {} + type: object + evt: + $ref: '#/components/schemas/EventSystemAttributes' + links: + description: The links related to the event. + example: + - category: runbook + title: Runbook Link + url: https://app.datadoghq.com/runbook + items: + $ref: '#/components/schemas/AlertEventAttributesLinksItem' + type: array + priority: + $ref: '#/components/schemas/AlertEventAttributesPriority' + service: + $ref: '#/components/schemas/V2EventService' + timestamp: + $ref: '#/components/schemas/V2EventTimestamp' + title: + $ref: '#/components/schemas/V2EventTitle' + type: object + AlertEventAttributesLinksItem: + description: A link. + properties: + category: + $ref: '#/components/schemas/AlertEventAttributesLinksItemCategory' + title: + description: The display text of the link. + type: string + url: + description: The URL of the link. + type: string + type: object + AlertEventAttributesLinksItemCategory: + description: The category of the link. + enum: + - runbook + - documentation + - dashboard + type: string + x-enum-varnames: + - RUNBOOK + - DOCUMENTATION + - DASHBOARD + AlertEventAttributesPriority: + description: The priority of the alert. + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + example: '5' + type: string + x-enum-varnames: + - PRIORITY_ONE + - PRIORITY_TWO + - PRIORITY_THREE + - PRIORITY_FOUR + - PRIORITY_FIVE AlertEventCustomAttributes: additionalProperties: false description: Alert event attributes. @@ -7009,6 +7077,112 @@ components: format: int64 type: integer type: object + ChangeEventAttributes: + description: Change event attributes. + properties: + aggregation_key: + $ref: '#/components/schemas/V2EventAggregationKey' + author: + $ref: '#/components/schemas/ChangeEventAttributesAuthor' + change_metadata: + description: JSON object of change metadata. + example: + dd: + team: datadog_team + user_email: datadog@datadog.com + user_id: datadog_user_id + user_name: datadog_username + type: object + changed_resource: + $ref: '#/components/schemas/ChangeEventAttributesChangedResource' + evt: + $ref: '#/components/schemas/EventSystemAttributes' + impacted_resources: + description: A list of resources impacted by this change. + example: + - name: service-name + type: service + items: + $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItem' + type: array + new_value: + description: The new state of the changed resource. + example: + enabled: true + percentage: 50% + rule: + datacenter: devcycle.us1.prod + type: object + prev_value: + description: The previous state of the changed resource. + example: + enabled: true + percentage: 10% + rule: + datacenter: devcycle.us1.prod + type: object + service: + $ref: '#/components/schemas/V2EventService' + timestamp: + $ref: '#/components/schemas/V2EventTimestamp' + title: + $ref: '#/components/schemas/V2EventTitle' + type: object + ChangeEventAttributesAuthor: + description: The entity that made the change. + properties: + name: + description: The name of the user or system that made the change. + example: example@datadog.com + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesAuthorType' + type: object + ChangeEventAttributesAuthorType: + description: The type of the author. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM + ChangeEventAttributesChangedResource: + description: A uniquely identified resource. + properties: + name: + description: The name of the changed resource. + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesChangedResourceType' + type: object + ChangeEventAttributesChangedResourceType: + description: The type of the changed resource. + enum: + - feature_flag + - configuration + example: feature_flag + type: string + x-enum-varnames: + - FEATURE_FLAG + - CONFIGURATION + ChangeEventAttributesImpactedResourcesItem: + description: A uniquely identified resource. + properties: + name: + description: The name of the impacted resource. + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItemType' + type: object + ChangeEventAttributesImpactedResourcesItemType: + description: The type of the impacted resource. + enum: + - service + type: string + x-enum-varnames: + - SERVICE ChangeEventCustomAttributes: additionalProperties: false description: Change event attributes. @@ -14925,6 +15099,44 @@ components: - USER_UPDATE - RECOMMENDATION - SNAPSHOT + EventSystemAttributes: + description: JSON object of event system attributes. + properties: + category: + $ref: '#/components/schemas/EventSystemAttributesCategory' + id: + description: Event identifier. This field is deprecated and will be removed + in a future version. Use the `uid` field instead. + type: string + integration_id: + $ref: '#/components/schemas/EventSystemAttributesIntegrationId' + source_id: + description: The source type ID of the event. + format: int64 + type: integer + uid: + description: A unique identifier for the event. You can use this identifier + to query or reference the event. + type: string + type: object + EventSystemAttributesCategory: + description: Event category identifying the type of event. + enum: + - change + - alert + example: change + type: string + x-enum-varnames: + - CHANGE + - ALERT + EventSystemAttributesIntegrationId: + description: Integration ID sourced from integration manifests. + enum: + - custom-events + example: custom-events + type: string + x-enum-varnames: + - CUSTOM_EVENTS EventType: default: event description: Type of the event. @@ -40580,6 +40792,70 @@ components: type: string x-enum-varnames: - USERS + V2Event: + description: An event object. + properties: + attributes: + $ref: '#/components/schemas/V2EventAttributes' + id: + description: The event's ID. + example: '' + type: string + type: + description: Entity type. + example: event + type: string + type: object + V2EventAggregationKey: + description: Aggregation key of the event. + example: aggregation-key + type: string + V2EventAttributes: + description: Event attributes. + properties: + attributes: + $ref: '#/components/schemas/V2EventAttributesAttributes' + message: + description: Free-formed text associated with the event. + example: The event message + type: string + tags: + description: A list of tags associated with the event. + example: + - env:api_client_test + items: + description: A tag. + type: string + type: array + timestamp: + description: Timestamp when the event occurred. + example: '2017-01-15T01:30:15.010000Z' + type: string + type: object + V2EventAttributesAttributes: + description: JSON object for category-specific attributes. + oneOf: + - $ref: '#/components/schemas/ChangeEventAttributes' + - $ref: '#/components/schemas/AlertEventAttributes' + V2EventResponse: + description: Get an event response. + properties: + data: + $ref: '#/components/schemas/V2Event' + type: object + V2EventService: + description: Service that triggered the event. + example: service-name + type: string + V2EventTimestamp: + description: POSIX timestamp of the event. + example: 175019386627 + format: int64 + type: integer + V2EventTitle: + description: The title of the event. + example: The event title + type: string ValidationError: description: Represents a single validation error, including a human-readable title and metadata. @@ -47374,6 +47650,46 @@ paths: operator: OR permissions: - events_read + /api/v2/events/{event_id}: + get: + description: Get the details of an event by `event_id`. + operationId: GetEvent + parameters: + - description: The UID of the event. + in: path + name: event_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/V2EventResponse' + 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: + - events_read + summary: Get an event + tags: + - Events + x-permission: + operator: OR + permissions: + - events_read /api/v2/incidents: get: description: Get all incidents for the user's organization. diff --git a/examples/v2/events/GetEvent.ts b/examples/v2/events/GetEvent.ts new file mode 100644 index 000000000000..6dc024fa975a --- /dev/null +++ b/examples/v2/events/GetEvent.ts @@ -0,0 +1,21 @@ +/** + * Get an event returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.EventsApi(configuration); + +const params: v2.EventsApiGetEventRequest = { + eventId: "AZeF-nTCAABzkAgGXzYPtgAA", +}; + +apiInstance + .getEvent(params) + .then((data: v2.V2EventResponse) => { + 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 d71dd25f912c..3d0dbe38fac0 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -4636,6 +4636,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "EventsListResponse", }, + "v2.GetEvent": { + "eventId": { + "type": "string", + "format": "", + }, + "operationResponseType": "V2EventResponse", + }, "v2.ListIncidents": { "include": { "type": "Array", diff --git a/features/v2/events.feature b/features/v2/events.feature index 0a69d195201a..61d824ce1084 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -50,6 +50,27 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/event-management + Scenario: Get an event returns "Bad Request" response + Given new "GetEvent" request + And request contains "event_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/event-management + Scenario: Get an event returns "Not Found" response + Given new "GetEvent" request + And request contains "event_id" parameter with value "AAAAAAAAAAAAAAAAAAAAAAAA" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/event-management + Scenario: Get an event returns "OK" response + Given new "GetEvent" request + And request contains "event_id" parameter with value "AZeF-nTCAABzkAgGXzYPtgAA" + 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 3cc857a7365b..a08bd9af31b5 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -943,6 +943,12 @@ "type": "safe" } }, + "GetEvent": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, "ListIncidents": { "tag": "Incidents", "undo": { diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index 5b1361470bb9..94a9956ed238 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -25,6 +25,7 @@ import { EventsListResponse } from "../models/EventsListResponse"; import { EventsRequestPage } from "../models/EventsRequestPage"; import { EventsSort } from "../models/EventsSort"; import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; +import { V2EventResponse } from "../models/V2EventResponse"; export class EventsApiRequestFactory extends BaseAPIRequestFactory { public async createEvent( @@ -68,6 +69,40 @@ export class EventsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getEvent( + eventId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'eventId' is not null or undefined + if (eventId === null || eventId === undefined) { + throw new RequiredError("eventId", "getEvent"); + } + + // Path Params + const localVarPath = "/api/v2/events/{event_id}".replace( + "{event_id}", + encodeURIComponent(String(eventId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.getEvent") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listEvents( filterQuery?: string, filterFrom?: string, @@ -262,6 +297,68 @@ 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 getEvent + * @throws ApiException if the response code was not in [200, 299] + */ + public async getEvent(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: V2EventResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "V2EventResponse" + ) as V2EventResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: V2EventResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "V2EventResponse", + "" + ) as V2EventResponse; + 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 @@ -395,6 +492,14 @@ export interface EventsApiCreateEventRequest { body: EventCreateRequestPayload; } +export interface EventsApiGetEventRequest { + /** + * The UID of the event. + * @type string + */ + eventId: string; +} + export interface EventsApiListEventsRequest { /** * Search query following events syntax. @@ -481,6 +586,27 @@ export class EventsApi { }); } + /** + * Get the details of an event by `event_id`. + * @param param The request object + */ + public getEvent( + param: EventsApiGetEventRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getEvent( + param.eventId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getEvent(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 ffe4554d3d9d..f23e3174da3d 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -234,6 +234,7 @@ export { export { EventsApiCreateEventRequest, + EventsApiGetEventRequest, EventsApiListEventsRequest, EventsApiSearchEventsRequest, EventsApi, @@ -768,6 +769,10 @@ export { ActiveBillingDimensionsResponse } from "./models/ActiveBillingDimension export { ActiveBillingDimensionsType } from "./models/ActiveBillingDimensionsType"; export { AddMemberTeamRequest } from "./models/AddMemberTeamRequest"; export { Advisory } from "./models/Advisory"; +export { AlertEventAttributes } from "./models/AlertEventAttributes"; +export { AlertEventAttributesLinksItem } from "./models/AlertEventAttributesLinksItem"; +export { AlertEventAttributesLinksItemCategory } from "./models/AlertEventAttributesLinksItemCategory"; +export { AlertEventAttributesPriority } from "./models/AlertEventAttributesPriority"; export { AlertEventCustomAttributes } from "./models/AlertEventCustomAttributes"; export { AlertEventCustomAttributesLinksItems } from "./models/AlertEventCustomAttributesLinksItems"; export { AlertEventCustomAttributesLinksItemsCategory } from "./models/AlertEventCustomAttributesLinksItemsCategory"; @@ -1046,6 +1051,13 @@ export { CaseUpdatePriorityRequest } from "./models/CaseUpdatePriorityRequest"; export { CaseUpdateStatus } from "./models/CaseUpdateStatus"; export { CaseUpdateStatusAttributes } from "./models/CaseUpdateStatusAttributes"; export { CaseUpdateStatusRequest } from "./models/CaseUpdateStatusRequest"; +export { ChangeEventAttributes } from "./models/ChangeEventAttributes"; +export { ChangeEventAttributesAuthor } from "./models/ChangeEventAttributesAuthor"; +export { ChangeEventAttributesAuthorType } from "./models/ChangeEventAttributesAuthorType"; +export { ChangeEventAttributesChangedResource } from "./models/ChangeEventAttributesChangedResource"; +export { ChangeEventAttributesChangedResourceType } from "./models/ChangeEventAttributesChangedResourceType"; +export { ChangeEventAttributesImpactedResourcesItem } from "./models/ChangeEventAttributesImpactedResourcesItem"; +export { ChangeEventAttributesImpactedResourcesItemType } from "./models/ChangeEventAttributesImpactedResourcesItemType"; export { ChangeEventCustomAttributes } from "./models/ChangeEventCustomAttributes"; export { ChangeEventCustomAttributesAuthor } from "./models/ChangeEventCustomAttributesAuthor"; export { ChangeEventCustomAttributesAuthorType } from "./models/ChangeEventCustomAttributesAuthorType"; @@ -1619,6 +1631,9 @@ export { EventsSortType } from "./models/EventsSortType"; export { EventStatusType } from "./models/EventStatusType"; export { EventsTimeseriesQuery } from "./models/EventsTimeseriesQuery"; export { EventsWarning } from "./models/EventsWarning"; +export { EventSystemAttributes } from "./models/EventSystemAttributes"; +export { EventSystemAttributesCategory } from "./models/EventSystemAttributesCategory"; +export { EventSystemAttributesIntegrationId } from "./models/EventSystemAttributesIntegrationId"; export { EventType } from "./models/EventType"; export { FastlyAccounResponseAttributes } from "./models/FastlyAccounResponseAttributes"; export { FastlyAccountCreateRequest } from "./models/FastlyAccountCreateRequest"; @@ -3255,6 +3270,10 @@ export { UserTeamUserType } from "./models/UserTeamUserType"; export { UserUpdateAttributes } from "./models/UserUpdateAttributes"; export { UserUpdateData } from "./models/UserUpdateData"; export { UserUpdateRequest } from "./models/UserUpdateRequest"; +export { V2Event } from "./models/V2Event"; +export { V2EventAttributes } from "./models/V2EventAttributes"; +export { V2EventAttributesAttributes } from "./models/V2EventAttributesAttributes"; +export { V2EventResponse } from "./models/V2EventResponse"; export { ValidationError } from "./models/ValidationError"; export { ValidationErrorMeta } from "./models/ValidationErrorMeta"; export { ValidationResponse } from "./models/ValidationResponse"; diff --git a/packages/datadog-api-client-v2/models/AlertEventAttributes.ts b/packages/datadog-api-client-v2/models/AlertEventAttributes.ts new file mode 100644 index 000000000000..37d89d455726 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventAttributes.ts @@ -0,0 +1,112 @@ +/** + * 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 { AlertEventAttributesLinksItem } from "./AlertEventAttributesLinksItem"; +import { AlertEventAttributesPriority } from "./AlertEventAttributesPriority"; +import { EventSystemAttributes } from "./EventSystemAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Alert event attributes. + */ +export class AlertEventAttributes { + /** + * Aggregation key of the event. + */ + "aggregationKey"?: string; + /** + * JSON object of custom attributes. + */ + "custom"?: any; + /** + * JSON object of event system attributes. + */ + "evt"?: EventSystemAttributes; + /** + * The links related to the event. + */ + "links"?: Array; + /** + * The priority of the alert. + */ + "priority"?: AlertEventAttributesPriority; + /** + * Service that triggered the event. + */ + "service"?: string; + /** + * POSIX timestamp of the event. + */ + "timestamp"?: number; + /** + * The title of the event. + */ + "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 = { + aggregationKey: { + baseName: "aggregation_key", + type: "string", + }, + custom: { + baseName: "custom", + type: "any", + }, + evt: { + baseName: "evt", + type: "EventSystemAttributes", + }, + links: { + baseName: "links", + type: "Array", + }, + priority: { + baseName: "priority", + type: "AlertEventAttributesPriority", + }, + service: { + baseName: "service", + type: "string", + }, + timestamp: { + baseName: "timestamp", + type: "number", + format: "int64", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AlertEventAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItem.ts b/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItem.ts new file mode 100644 index 000000000000..7977de7a5cb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItem.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 { AlertEventAttributesLinksItemCategory } from "./AlertEventAttributesLinksItemCategory"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A link. + */ +export class AlertEventAttributesLinksItem { + /** + * The category of the link. + */ + "category"?: AlertEventAttributesLinksItemCategory; + /** + * The display text of the link. + */ + "title"?: string; + /** + * The URL of the link. + */ + "url"?: 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 = { + category: { + baseName: "category", + type: "AlertEventAttributesLinksItemCategory", + }, + title: { + baseName: "title", + type: "string", + }, + url: { + baseName: "url", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AlertEventAttributesLinksItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItemCategory.ts b/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItemCategory.ts new file mode 100644 index 000000000000..f54a2236d44b --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventAttributesLinksItemCategory.ts @@ -0,0 +1,20 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The category of the link. + */ + +export type AlertEventAttributesLinksItemCategory = + | typeof RUNBOOK + | typeof DOCUMENTATION + | typeof DASHBOARD + | UnparsedObject; +export const RUNBOOK = "runbook"; +export const DOCUMENTATION = "documentation"; +export const DASHBOARD = "dashboard"; diff --git a/packages/datadog-api-client-v2/models/AlertEventAttributesPriority.ts b/packages/datadog-api-client-v2/models/AlertEventAttributesPriority.ts new file mode 100644 index 000000000000..77e0eb50f208 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AlertEventAttributesPriority.ts @@ -0,0 +1,24 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The priority of the alert. + */ + +export type AlertEventAttributesPriority = + | typeof PRIORITY_ONE + | typeof PRIORITY_TWO + | typeof PRIORITY_THREE + | typeof PRIORITY_FOUR + | typeof PRIORITY_FIVE + | UnparsedObject; +export const PRIORITY_ONE = "1"; +export const PRIORITY_TWO = "2"; +export const PRIORITY_THREE = "3"; +export const PRIORITY_FOUR = "4"; +export const PRIORITY_FIVE = "5"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributes.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributes.ts new file mode 100644 index 000000000000..6ad129488c9b --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributes.ts @@ -0,0 +1,137 @@ +/** + * 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 { ChangeEventAttributesAuthor } from "./ChangeEventAttributesAuthor"; +import { ChangeEventAttributesChangedResource } from "./ChangeEventAttributesChangedResource"; +import { ChangeEventAttributesImpactedResourcesItem } from "./ChangeEventAttributesImpactedResourcesItem"; +import { EventSystemAttributes } from "./EventSystemAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Change event attributes. + */ +export class ChangeEventAttributes { + /** + * Aggregation key of the event. + */ + "aggregationKey"?: string; + /** + * The entity that made the change. + */ + "author"?: ChangeEventAttributesAuthor; + /** + * JSON object of change metadata. + */ + "changeMetadata"?: any; + /** + * A uniquely identified resource. + */ + "changedResource"?: ChangeEventAttributesChangedResource; + /** + * JSON object of event system attributes. + */ + "evt"?: EventSystemAttributes; + /** + * A list of resources impacted by this change. + */ + "impactedResources"?: Array; + /** + * The new state of the changed resource. + */ + "newValue"?: any; + /** + * The previous state of the changed resource. + */ + "prevValue"?: any; + /** + * Service that triggered the event. + */ + "service"?: string; + /** + * POSIX timestamp of the event. + */ + "timestamp"?: number; + /** + * The title of the event. + */ + "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 = { + aggregationKey: { + baseName: "aggregation_key", + type: "string", + }, + author: { + baseName: "author", + type: "ChangeEventAttributesAuthor", + }, + changeMetadata: { + baseName: "change_metadata", + type: "any", + }, + changedResource: { + baseName: "changed_resource", + type: "ChangeEventAttributesChangedResource", + }, + evt: { + baseName: "evt", + type: "EventSystemAttributes", + }, + impactedResources: { + baseName: "impacted_resources", + type: "Array", + }, + newValue: { + baseName: "new_value", + type: "any", + }, + prevValue: { + baseName: "prev_value", + type: "any", + }, + service: { + baseName: "service", + type: "string", + }, + timestamp: { + baseName: "timestamp", + type: "number", + format: "int64", + }, + title: { + baseName: "title", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthor.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthor.ts new file mode 100644 index 000000000000..3cac9c1f0b08 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthor.ts @@ -0,0 +1,61 @@ +/** + * 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 { ChangeEventAttributesAuthorType } from "./ChangeEventAttributesAuthorType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The entity that made the change. + */ +export class ChangeEventAttributesAuthor { + /** + * The name of the user or system that made the change. + */ + "name"?: string; + /** + * The type of the author. + */ + "type"?: ChangeEventAttributesAuthorType; + + /** + * 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 = { + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "ChangeEventAttributesAuthorType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventAttributesAuthor.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthorType.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthorType.ts new file mode 100644 index 000000000000..a169c0e4bba2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesAuthorType.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the author. + */ + +export type ChangeEventAttributesAuthorType = + | typeof USER + | typeof SYSTEM + | UnparsedObject; +export const USER = "user"; +export const SYSTEM = "system"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResource.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResource.ts new file mode 100644 index 000000000000..f53af2150c25 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResource.ts @@ -0,0 +1,61 @@ +/** + * 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 { ChangeEventAttributesChangedResourceType } from "./ChangeEventAttributesChangedResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A uniquely identified resource. + */ +export class ChangeEventAttributesChangedResource { + /** + * The name of the changed resource. + */ + "name"?: string; + /** + * The type of the changed resource. + */ + "type"?: ChangeEventAttributesChangedResourceType; + + /** + * 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 = { + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "ChangeEventAttributesChangedResourceType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventAttributesChangedResource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResourceType.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResourceType.ts new file mode 100644 index 000000000000..e1dcadd5b616 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesChangedResourceType.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the changed resource. + */ + +export type ChangeEventAttributesChangedResourceType = + | typeof FEATURE_FLAG + | typeof CONFIGURATION + | UnparsedObject; +export const FEATURE_FLAG = "feature_flag"; +export const CONFIGURATION = "configuration"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItem.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItem.ts new file mode 100644 index 000000000000..628f09c2a678 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItem.ts @@ -0,0 +1,61 @@ +/** + * 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 { ChangeEventAttributesImpactedResourcesItemType } from "./ChangeEventAttributesImpactedResourcesItemType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A uniquely identified resource. + */ +export class ChangeEventAttributesImpactedResourcesItem { + /** + * The name of the impacted resource. + */ + "name"?: string; + /** + * The type of the impacted resource. + */ + "type"?: ChangeEventAttributesImpactedResourcesItemType; + + /** + * 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 = { + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "ChangeEventAttributesImpactedResourcesItemType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventAttributesImpactedResourcesItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItemType.ts b/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItemType.ts new file mode 100644 index 000000000000..98c9b259365c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventAttributesImpactedResourcesItemType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the impacted resource. + */ + +export type ChangeEventAttributesImpactedResourcesItemType = + | typeof SERVICE + | UnparsedObject; +export const SERVICE = "service"; diff --git a/packages/datadog-api-client-v2/models/EventSystemAttributes.ts b/packages/datadog-api-client-v2/models/EventSystemAttributes.ts new file mode 100644 index 000000000000..1c7a1f6327eb --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventSystemAttributes.ts @@ -0,0 +1,87 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { EventSystemAttributesCategory } from "./EventSystemAttributesCategory"; +import { EventSystemAttributesIntegrationId } from "./EventSystemAttributesIntegrationId"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * JSON object of event system attributes. + */ +export class EventSystemAttributes { + /** + * Event category identifying the type of event. + */ + "category"?: EventSystemAttributesCategory; + /** + * Event identifier. This field is deprecated and will be removed in a future version. Use the `uid` field instead. + */ + "id"?: string; + /** + * Integration ID sourced from integration manifests. + */ + "integrationId"?: EventSystemAttributesIntegrationId; + /** + * The source type ID of the event. + */ + "sourceId"?: number; + /** + * A unique identifier for the event. You can use this identifier to query or reference the event. + */ + "uid"?: 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 = { + category: { + baseName: "category", + type: "EventSystemAttributesCategory", + }, + id: { + baseName: "id", + type: "string", + }, + integrationId: { + baseName: "integration_id", + type: "EventSystemAttributesIntegrationId", + }, + sourceId: { + baseName: "source_id", + type: "number", + format: "int64", + }, + uid: { + baseName: "uid", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return EventSystemAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/EventSystemAttributesCategory.ts b/packages/datadog-api-client-v2/models/EventSystemAttributesCategory.ts new file mode 100644 index 000000000000..16bc47994189 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventSystemAttributesCategory.ts @@ -0,0 +1,18 @@ +/** + * 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 category identifying the type of event. + */ + +export type EventSystemAttributesCategory = + | typeof CHANGE + | typeof ALERT + | UnparsedObject; +export const CHANGE = "change"; +export const ALERT = "alert"; diff --git a/packages/datadog-api-client-v2/models/EventSystemAttributesIntegrationId.ts b/packages/datadog-api-client-v2/models/EventSystemAttributesIntegrationId.ts new file mode 100644 index 000000000000..aa1eca271604 --- /dev/null +++ b/packages/datadog-api-client-v2/models/EventSystemAttributesIntegrationId.ts @@ -0,0 +1,16 @@ +/** + * 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"; + +/** + * Integration ID sourced from integration manifests. + */ + +export type EventSystemAttributesIntegrationId = + | typeof CUSTOM_EVENTS + | UnparsedObject; +export const CUSTOM_EVENTS = "custom-events"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 45351f8c5c12..04f736f0c025 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -62,6 +62,8 @@ import { ActiveBillingDimensionsBody } from "./ActiveBillingDimensionsBody"; import { ActiveBillingDimensionsResponse } from "./ActiveBillingDimensionsResponse"; import { AddMemberTeamRequest } from "./AddMemberTeamRequest"; import { Advisory } from "./Advisory"; +import { AlertEventAttributes } from "./AlertEventAttributes"; +import { AlertEventAttributesLinksItem } from "./AlertEventAttributesLinksItem"; import { AlertEventCustomAttributes } from "./AlertEventCustomAttributes"; import { AlertEventCustomAttributesLinksItems } from "./AlertEventCustomAttributesLinksItems"; import { Annotation } from "./Annotation"; @@ -276,6 +278,10 @@ import { CaseUpdateStatusRequest } from "./CaseUpdateStatusRequest"; import { CasesResponse } from "./CasesResponse"; import { CasesResponseMeta } from "./CasesResponseMeta"; import { CasesResponseMetaPagination } from "./CasesResponseMetaPagination"; +import { ChangeEventAttributes } from "./ChangeEventAttributes"; +import { ChangeEventAttributesAuthor } from "./ChangeEventAttributesAuthor"; +import { ChangeEventAttributesChangedResource } from "./ChangeEventAttributesChangedResource"; +import { ChangeEventAttributesImpactedResourcesItem } from "./ChangeEventAttributesImpactedResourcesItem"; import { ChangeEventCustomAttributes } from "./ChangeEventCustomAttributes"; import { ChangeEventCustomAttributesAuthor } from "./ChangeEventCustomAttributesAuthor"; import { ChangeEventCustomAttributesChangedResource } from "./ChangeEventCustomAttributesChangedResource"; @@ -659,6 +665,7 @@ import { EventCreateResponsePayloadLinks } from "./EventCreateResponsePayloadLin import { EventPayload } from "./EventPayload"; import { EventResponse } from "./EventResponse"; import { EventResponseAttributes } from "./EventResponseAttributes"; +import { EventSystemAttributes } from "./EventSystemAttributes"; import { EventsCompute } from "./EventsCompute"; import { EventsGroupBy } from "./EventsGroupBy"; import { EventsGroupBySort } from "./EventsGroupBySort"; @@ -1894,6 +1901,9 @@ import { UserUpdateData } from "./UserUpdateData"; import { UserUpdateRequest } from "./UserUpdateRequest"; import { UsersRelationship } from "./UsersRelationship"; import { UsersResponse } from "./UsersResponse"; +import { V2Event } from "./V2Event"; +import { V2EventAttributes } from "./V2EventAttributes"; +import { V2EventResponse } from "./V2EventResponse"; import { ValidationError } from "./ValidationError"; import { ValidationErrorMeta } from "./ValidationErrorMeta"; import { ValidationResponse } from "./ValidationResponse"; @@ -1977,6 +1987,12 @@ const enumsMap: { [key: string]: any[] } = { ActionConnectionDataType: ["action_connection"], ActionQueryType: ["action"], ActiveBillingDimensionsType: ["billing_dimensions"], + AlertEventAttributesLinksItemCategory: [ + "runbook", + "documentation", + "dashboard", + ], + AlertEventAttributesPriority: ["1", "2", "3", "4", "5"], AlertEventCustomAttributesLinksItemsCategory: [ "runbook", "documentation", @@ -2161,6 +2177,9 @@ const enumsMap: { [key: string]: any[] } = { CaseSortableField: ["created_at", "priority", "status"], CaseStatus: ["OPEN", "IN_PROGRESS", "CLOSED"], CaseType: ["STANDARD"], + ChangeEventAttributesAuthorType: ["user", "system"], + ChangeEventAttributesChangedResourceType: ["feature_flag", "configuration"], + ChangeEventAttributesImpactedResourcesItemType: ["service"], ChangeEventCustomAttributesAuthorType: ["user", "system"], ChangeEventCustomAttributesChangedResourceType: [ "feature_flag", @@ -2302,6 +2321,8 @@ const enumsMap: { [key: string]: any[] } = { "recommendation", "snapshot", ], + EventSystemAttributesCategory: ["change", "alert"], + EventSystemAttributesIntegrationId: ["custom-events"], EventType: ["event"], EventsAggregation: [ "count", @@ -3247,6 +3268,8 @@ const typeMap: { [index: string]: any } = { ActiveBillingDimensionsResponse: ActiveBillingDimensionsResponse, AddMemberTeamRequest: AddMemberTeamRequest, Advisory: Advisory, + AlertEventAttributes: AlertEventAttributes, + AlertEventAttributesLinksItem: AlertEventAttributesLinksItem, AlertEventCustomAttributes: AlertEventCustomAttributes, AlertEventCustomAttributesLinksItems: AlertEventCustomAttributesLinksItems, Annotation: Annotation, @@ -3497,6 +3520,11 @@ const typeMap: { [index: string]: any } = { CasesResponse: CasesResponse, CasesResponseMeta: CasesResponseMeta, CasesResponseMetaPagination: CasesResponseMetaPagination, + ChangeEventAttributes: ChangeEventAttributes, + ChangeEventAttributesAuthor: ChangeEventAttributesAuthor, + ChangeEventAttributesChangedResource: ChangeEventAttributesChangedResource, + ChangeEventAttributesImpactedResourcesItem: + ChangeEventAttributesImpactedResourcesItem, ChangeEventCustomAttributes: ChangeEventCustomAttributes, ChangeEventCustomAttributesAuthor: ChangeEventCustomAttributesAuthor, ChangeEventCustomAttributesChangedResource: @@ -3960,6 +3988,7 @@ const typeMap: { [index: string]: any } = { EventPayload: EventPayload, EventResponse: EventResponse, EventResponseAttributes: EventResponseAttributes, + EventSystemAttributes: EventSystemAttributes, EventsCompute: EventsCompute, EventsGroupBy: EventsGroupBy, EventsGroupBySort: EventsGroupBySort, @@ -5390,6 +5419,9 @@ const typeMap: { [index: string]: any } = { UserUpdateRequest: UserUpdateRequest, UsersRelationship: UsersRelationship, UsersResponse: UsersResponse, + V2Event: V2Event, + V2EventAttributes: V2EventAttributes, + V2EventResponse: V2EventResponse, ValidationError: ValidationError, ValidationErrorMeta: ValidationErrorMeta, ValidationResponse: ValidationResponse, @@ -5783,6 +5815,10 @@ const oneOfMap: { [index: string]: string[] } = { UpsertCatalogKindRequest: ["KindObj", "string"], UserResponseIncludedItem: ["Organization", "Permission", "Role"], UserTeamIncluded: ["User", "Team"], + V2EventAttributesAttributes: [ + "ChangeEventAttributes", + "AlertEventAttributes", + ], XRayServicesList: ["XRayServicesIncludeAll", "XRayServicesIncludeOnly"], }; diff --git a/packages/datadog-api-client-v2/models/V2Event.ts b/packages/datadog-api-client-v2/models/V2Event.ts new file mode 100644 index 000000000000..c4a1cb83a648 --- /dev/null +++ b/packages/datadog-api-client-v2/models/V2Event.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 { V2EventAttributes } from "./V2EventAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An event object. + */ +export class V2Event { + /** + * Event attributes. + */ + "attributes"?: V2EventAttributes; + /** + * The event's ID. + */ + "id"?: string; + /** + * Entity type. + */ + "type"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "V2EventAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return V2Event.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/V2EventAttributes.ts b/packages/datadog-api-client-v2/models/V2EventAttributes.ts new file mode 100644 index 000000000000..2bccde100398 --- /dev/null +++ b/packages/datadog-api-client-v2/models/V2EventAttributes.ts @@ -0,0 +1,77 @@ +/** + * 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 { V2EventAttributesAttributes } from "./V2EventAttributesAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Event attributes. + */ +export class V2EventAttributes { + /** + * JSON object for category-specific attributes. + */ + "attributes"?: V2EventAttributesAttributes; + /** + * Free-formed text associated with the event. + */ + "message"?: string; + /** + * A list of tags associated with the event. + */ + "tags"?: Array; + /** + * Timestamp when the event occurred. + */ + "timestamp"?: 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 = { + attributes: { + baseName: "attributes", + type: "V2EventAttributesAttributes", + }, + message: { + baseName: "message", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + timestamp: { + baseName: "timestamp", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return V2EventAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/V2EventAttributesAttributes.ts b/packages/datadog-api-client-v2/models/V2EventAttributesAttributes.ts new file mode 100644 index 000000000000..0ca98686a35f --- /dev/null +++ b/packages/datadog-api-client-v2/models/V2EventAttributesAttributes.ts @@ -0,0 +1,18 @@ +/** + * 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 { AlertEventAttributes } from "./AlertEventAttributes"; +import { ChangeEventAttributes } from "./ChangeEventAttributes"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * JSON object for category-specific attributes. + */ + +export type V2EventAttributesAttributes = + | ChangeEventAttributes + | AlertEventAttributes + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/V2EventResponse.ts b/packages/datadog-api-client-v2/models/V2EventResponse.ts new file mode 100644 index 000000000000..dd97968d9e89 --- /dev/null +++ b/packages/datadog-api-client-v2/models/V2EventResponse.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 { V2Event } from "./V2Event"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Get an event response. + */ +export class V2EventResponse { + /** + * An event object. + */ + "data"?: V2Event; + + /** + * 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: "V2Event", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return V2EventResponse.attributeTypeMap; + } + + public constructor() {} +}