diff --git a/.apigentools-info b/.apigentools-info index f6196ebeb0f..79c626c126a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-21 20:59:46.944958", - "spec_repo_commit": "9ac9609b" + "regenerated": "2024-10-22 14:46:12.678307", + "spec_repo_commit": "2340c8b7" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-21 20:59:46.962979", - "spec_repo_commit": "9ac9609b" + "regenerated": "2024-10-22 14:46:12.696619", + "spec_repo_commit": "2340c8b7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index db36354cca9..250107bc741 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -3951,6 +3951,243 @@ components: format: int64 type: integer type: object + ChangeEvent: + description: Event attributes. + properties: + aggregation_key: + description: 'An arbitrary string to use for aggregation. Limited to 100 + characters. + + If you specify a key, all events using that key are grouped together in + the Event Stream.' + maxLength: 100 + type: string + attributes: + $ref: '#/components/schemas/ChangeEventCustomAttributes' + category: + $ref: '#/components/schemas/ChangeEventCategory' + message: + description: The body of the event. Limited to 4000 characters. + example: payment_processed feature flag has been enabled + maxLength: 4000 + type: string + tags: + description: 'A list of tags to apply to the event. + + Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).' + example: + - environment:test + items: + description: A tag. + type: string + type: array + timestamp: + description: 'Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) + format. + + For example `"2017-01-15T01:30:15.010000Z"`. + + Defaults to now. Limited to values no older than 18 hours.' + type: string + title: + description: The event title. Limited to 500 characters. + example: payment_processed feature flag updated + maxLength: 500 + type: string + required: + - title + - category + - attributes + type: object + ChangeEventCategory: + description: Event category to identify the type of event. Only the value `change` + is supported. + enum: + - change + example: change + type: string + x-enum-varnames: + - CHANGE + ChangeEventCreateRequest: + description: Object representing an event. + properties: + attributes: + $ref: '#/components/schemas/ChangeEvent' + type: + $ref: '#/components/schemas/ChangeEventCreateRequestType' + type: object + ChangeEventCreateRequestPayload: + description: Create an event. + properties: + data: + $ref: '#/components/schemas/ChangeEventCreateRequest' + type: object + ChangeEventCreateRequestType: + description: Entity type. + enum: + - event + example: event + type: string + x-enum-varnames: + - EVENT + ChangeEventCreateResponse: + description: Object containing an event response. + properties: + attributes: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributes' + type: + description: Event type + example: event + type: string + type: object + ChangeEventCreateResponseAttributes: + description: Event response attributes. + properties: + attributes: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributes' + type: object + ChangeEventCreateResponseAttributesAttributes: + description: The definition of `ChangeEventCreateResponseAttributesAttributes` + object. + properties: + evt: + $ref: '#/components/schemas/ChangeEventCreateResponseAttributesAttributesEvt' + type: object + ChangeEventCreateResponseAttributesAttributesEvt: + description: The definition of `ChangeEventCreateResponseAttributesAttributesEvt` + object. + properties: + id: + description: Event id + type: string + type: object + ChangeEventCreateResponsePayload: + description: Response containing information about created event. + properties: + data: + $ref: '#/components/schemas/ChangeEventCreateResponse' + type: object + ChangeEventCustomAttributes: + description: Object representing custom event attributes. + properties: + author: + $ref: '#/components/schemas/ChangeEventCustomAttributesAuthor' + change_metadata: + additionalProperties: {} + description: Free form object with any related information of the `change` + event. + example: + dd: + team: datadog_team + user_email: datadog@datadog.com + user_id: datadog_user_id + user_name: datadog_username + resource_link: datadog.com/feature/fallback_payments_test + type: object + changed_resource: + $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResource' + impacted_resources: + description: 'A list of resources impacted by this change. It is recommended + to provide an impacted resource to display + + the change event at the right location. Only resources of type `service` + are supported.' + example: + - name: payments_api + type: service + items: + $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems' + type: array + new_value: + additionalProperties: {} + description: Free form object to track new value of the changed resource. + example: + enabled: true + percentage: 50% + rule: + datacenter: devcycle.us1.prod + type: object + prev_value: + additionalProperties: {} + description: Free form object to track previous value of the changed resource. + example: + enabled: true + percentage: 10% + rule: + datacenter: devcycle.us1.prod + type: object + required: + - changed_resource + type: object + ChangeEventCustomAttributesAuthor: + description: Object representing the entity which made the change. Optional + field but if provided should include `type` and `name`. + properties: + name: + description: Author's name. Limited to 128 characters. + example: datadog@datadog.com + maxLength: 128 + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' + required: + - name + - type + type: object + ChangeEventCustomAttributesAuthorType: + description: Author's type. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM + ChangeEventCustomAttributesChangedResource: + description: Object representing a uniquely identified resource. Only the resource + type `feature_flag` is supported. + properties: + name: + description: Resource's name. + example: fallback_payments_test + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' + required: + - type + - name + type: object + ChangeEventCustomAttributesChangedResourceType: + description: Resource's type. + enum: + - feature_flag + example: feature_flag + type: string + x-enum-varnames: + - FEATURE_FLAG + ChangeEventCustomAttributesImpactedResourcesItems: + description: Object representing a uniquely identified resource. Only the resource + type `service` is supported. + properties: + name: + description: Resource's name. + example: payments_api + type: string + type: + $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' + required: + - type + - name + type: object + ChangeEventCustomAttributesImpactedResourcesItemsType: + description: Resource's type. + enum: + - service + example: service + type: string + x-enum-varnames: + - SERVICE ChargebackBreakdown: description: Charges breakdown. properties: @@ -29663,6 +29900,47 @@ paths: operator: OR permissions: - events_read + post: + description: This endpoint allows you to post events. Only events with `change` + category are supported. + operationId: CreateEvent + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeEventCreateRequestPayload' + description: Event request object + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ChangeEventCreateResponsePayload' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Forbidden + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + summary: Post a change event + tags: + - Events + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in **Preview**. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/events/search: post: description: 'List endpoint returns events that match an events search query. diff --git a/examples/v2/events/CreateEvent.ts b/examples/v2/events/CreateEvent.ts new file mode 100644 index 00000000000..4609846ca8a --- /dev/null +++ b/examples/v2/events/CreateEvent.ts @@ -0,0 +1,62 @@ +/** + * Post a change event returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createEvent"] = true; +const apiInstance = new v2.EventsApi(configuration); + +const params: v2.EventsApiCreateEventRequest = { + body: { + data: { + attributes: { + attributes: { + author: { + name: "datadog@datadog.com", + type: "user", + }, + changeMetadata: { + dd: "{'team': 'datadog_team', 'user_email': 'datadog@datadog.com', 'user_id': 'datadog_user_id', 'user_name': 'datadog_username'}", + resource_link: "datadog.com/feature/fallback_payments_test", + }, + changedResource: { + name: "fallback_payments_test", + type: "feature_flag", + }, + impactedResources: [ + { + name: "payments_api", + type: "service", + }, + ], + newValue: { + enabled: "True", + percentage: "50%", + rule: "{'datacenter': 'devcycle.us1.prod'}", + }, + prevValue: { + enabled: "True", + percentage: "10%", + rule: "{'datacenter': 'devcycle.us1.prod'}", + }, + }, + category: "change", + message: "payment_processed feature flag has been enabled", + tags: ["environment:test"], + title: "payment_processed feature flag updated", + }, + type: "event", + }, + }, +}; + +apiInstance + .createEvent(params) + .then((data: v2.ChangeEventCreateResponsePayload) => { + 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 76cefef088b..09761594229 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -3463,6 +3463,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "EventsListResponse", }, + "v2.CreateEvent": { + "body": { + "type": "ChangeEventCreateRequestPayload", + "format": "", + }, + "operationResponseType": "ChangeEventCreateResponsePayload", + }, "v2.SearchEvents": { "body": { "type": "EventsListRequest", diff --git a/features/v2/events.feature b/features/v2/events.feature index 9a1c79072d1..9ffa95f2af3 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -7,24 +7,26 @@ Feature: Events Background: Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system And an instance of "Events" API @generated @skip @team:DataDog/event-management Scenario: Get a list of events returns "Bad Request" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request When the request is sent Then the response status is 400 Bad Request @skip-validation @team:DataDog/event-management Scenario: Get a list of events returns "OK" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request When the request is sent Then the response status is 200 OK @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Get a list of events returns "OK" response with pagination - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request And request contains "filter[from]" parameter with value "now-15m" And request contains "filter[to]" parameter with value "now" And request contains "page[limit]" parameter with value 2 @@ -34,7 +36,8 @@ Feature: Events @team:DataDog/event-management Scenario: Get a quick list of events returns "OK" response - Given new "ListEvents" request + Given a valid "appKeyAuth" key in the system + And new "ListEvents" request And request contains "filter[query]" parameter with value "datadog-agent" And request contains "filter[from]" parameter with value "2020-09-17T11:48:36+01:00" And request contains "filter[to]" parameter with value "2020-09-17T12:48:36+01:00" @@ -43,16 +46,34 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/event-management + Scenario: Post a change event returns "Bad request" response + Given operation "CreateEvent" enabled + And new "CreateEvent" request + And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/event-management + Scenario: Post a change event returns "OK" response + Given operation "CreateEvent" enabled + And new "CreateEvent" request + And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["environment:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Search events returns "Bad Request" response - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "query": "service:web* AND @http.status_code:[200 TO 299]", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}, "sort": "timestamp"} When the request is sent Then the response status is 400 Bad Request @team:DataDog/event-management Scenario: Search events returns "OK" response - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"query": "datadog-agent", "from": "2020-09-17T11:48:36+01:00", "to": "2020-09-17T12:48:36+01:00"}, "sort": "timestamp", "page": {"limit": 5}} When the request is sent Then the response status is 200 OK @@ -60,7 +81,8 @@ Feature: Events @replay-only @skip-validation @team:DataDog/event-management @with-pagination Scenario: Search events returns "OK" response with pagination - Given new "SearchEvents" request + Given a valid "appKeyAuth" key in the system + And new "SearchEvents" request And body with value {"filter": {"from": "now-15m", "to": "now"}, "options": {"timezone": "GMT"}, "page": {"limit": 2}, "sort": "timestamp"} When the request with pagination is sent Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 62da7c99ef9..a1592e79b71 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -602,6 +602,12 @@ "type": "safe" } }, + "CreateEvent": { + "tag": "Events", + "undo": { + "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 86426381a3b..5826a04bc31 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -231,6 +231,7 @@ export function createConfiguration( "v2.getMonthlyCostAttribution": false, "v2.createDORADeployment": false, "v2.createDORAIncident": false, + "v2.createEvent": false, "v2.createIncident": false, "v2.createIncidentIntegration": false, "v2.createIncidentTodo": false, diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index dca1ac1c97b..ff841a7f39d 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -1,4 +1,7 @@ -import { BaseAPIRequestFactory } from "../../datadog-api-client-common/baseapi"; +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; import { Configuration, applySecurityAuthentication, @@ -14,13 +17,59 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { ChangeEventCreateRequestPayload } from "../models/ChangeEventCreateRequestPayload"; +import { ChangeEventCreateResponsePayload } from "../models/ChangeEventCreateResponsePayload"; import { EventResponse } from "../models/EventResponse"; import { EventsListRequest } from "../models/EventsListRequest"; import { EventsListResponse } from "../models/EventsListResponse"; import { EventsRequestPage } from "../models/EventsRequestPage"; import { EventsSort } from "../models/EventsSort"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; export class EventsApiRequestFactory extends BaseAPIRequestFactory { + public async createEvent( + body: ChangeEventCreateRequestPayload, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createEvent'"); + if (!_config.unstableOperations["v2.createEvent"]) { + throw new Error("Unstable operation 'createEvent' is disabled"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createEvent"); + } + + // Path Params + const localVarPath = "/api/v2/events"; + + // Make Request Context + const requestContext = _config + .getServer("v2.EventsApi.createEvent") + .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, "ChangeEventCreateRequestPayload", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, ["apiKeyAuth"]); + + return requestContext; + } + public async listEvents( filterQuery?: string, filterFrom?: string, @@ -128,6 +177,89 @@ export class EventsApiRequestFactory extends BaseAPIRequestFactory { } 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 createEvent + * @throws ApiException if the response code was not in [200, 299] + */ + public async createEvent( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: ChangeEventCreateResponsePayload = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeEventCreateResponsePayload" + ) as ChangeEventCreateResponsePayload; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 403) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + 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: ChangeEventCreateResponsePayload = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "ChangeEventCreateResponsePayload", + "" + ) as ChangeEventCreateResponsePayload; + 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 @@ -253,6 +385,14 @@ export class EventsApiResponseProcessor { } } +export interface EventsApiCreateEventRequest { + /** + * Event request object + * @type ChangeEventCreateRequestPayload + */ + body: ChangeEventCreateRequestPayload; +} + export interface EventsApiListEventsRequest { /** * Search query following events syntax. @@ -310,6 +450,27 @@ export class EventsApi { responseProcessor || new EventsApiResponseProcessor(); } + /** + * This endpoint allows you to post events. Only events with `change` category are supported. + * @param param The request object + */ + public createEvent( + param: EventsApiCreateEventRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createEvent( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createEvent(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 73ecace25af..038d4d2a842 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -144,6 +144,7 @@ export { } from "./apis/DowntimesApi"; export { + EventsApiCreateEventRequest, EventsApiListEventsRequest, EventsApiSearchEventsRequest, EventsApi, @@ -681,6 +682,23 @@ export { CaseUpdatePriorityRequest } from "./models/CaseUpdatePriorityRequest"; export { CaseUpdateStatus } from "./models/CaseUpdateStatus"; export { CaseUpdateStatusAttributes } from "./models/CaseUpdateStatusAttributes"; export { CaseUpdateStatusRequest } from "./models/CaseUpdateStatusRequest"; +export { ChangeEvent } from "./models/ChangeEvent"; +export { ChangeEventCategory } from "./models/ChangeEventCategory"; +export { ChangeEventCreateRequest } from "./models/ChangeEventCreateRequest"; +export { ChangeEventCreateRequestPayload } from "./models/ChangeEventCreateRequestPayload"; +export { ChangeEventCreateRequestType } from "./models/ChangeEventCreateRequestType"; +export { ChangeEventCreateResponse } from "./models/ChangeEventCreateResponse"; +export { ChangeEventCreateResponseAttributes } from "./models/ChangeEventCreateResponseAttributes"; +export { ChangeEventCreateResponseAttributesAttributes } from "./models/ChangeEventCreateResponseAttributesAttributes"; +export { ChangeEventCreateResponseAttributesAttributesEvt } from "./models/ChangeEventCreateResponseAttributesAttributesEvt"; +export { ChangeEventCreateResponsePayload } from "./models/ChangeEventCreateResponsePayload"; +export { ChangeEventCustomAttributes } from "./models/ChangeEventCustomAttributes"; +export { ChangeEventCustomAttributesAuthor } from "./models/ChangeEventCustomAttributesAuthor"; +export { ChangeEventCustomAttributesAuthorType } from "./models/ChangeEventCustomAttributesAuthorType"; +export { ChangeEventCustomAttributesChangedResource } from "./models/ChangeEventCustomAttributesChangedResource"; +export { ChangeEventCustomAttributesChangedResourceType } from "./models/ChangeEventCustomAttributesChangedResourceType"; +export { ChangeEventCustomAttributesImpactedResourcesItems } from "./models/ChangeEventCustomAttributesImpactedResourcesItems"; +export { ChangeEventCustomAttributesImpactedResourcesItemsType } from "./models/ChangeEventCustomAttributesImpactedResourcesItemsType"; export { ChargebackBreakdown } from "./models/ChargebackBreakdown"; export { CIAppAggregateBucketValue } from "./models/CIAppAggregateBucketValue"; export { CIAppAggregateBucketValueTimeseriesPoint } from "./models/CIAppAggregateBucketValueTimeseriesPoint"; diff --git a/packages/datadog-api-client-v2/models/ChangeEvent.ts b/packages/datadog-api-client-v2/models/ChangeEvent.ts new file mode 100644 index 00000000000..81b3e3e4479 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEvent.ts @@ -0,0 +1,109 @@ +/** + * 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 { ChangeEventCategory } from "./ChangeEventCategory"; +import { ChangeEventCustomAttributes } from "./ChangeEventCustomAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Event attributes. + */ +export class ChangeEvent { + /** + * An arbitrary string to use for aggregation. Limited to 100 characters. + * If you specify a key, all events using that key are grouped together in the Event Stream. + */ + "aggregationKey"?: string; + /** + * Object representing custom event attributes. + */ + "attributes": ChangeEventCustomAttributes; + /** + * Event category to identify the type of event. Only the value `change` is supported. + */ + "category": ChangeEventCategory; + /** + * The body of the event. Limited to 4000 characters. + */ + "message"?: string; + /** + * A list of tags to apply to the event. + * Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/). + */ + "tags"?: Array; + /** + * Timestamp in which the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + * For example `"2017-01-15T01:30:15.010000Z"`. + * Defaults to now. Limited to values no older than 18 hours. + */ + "timestamp"?: string; + /** + * The event title. Limited to 500 characters. + */ + "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", + }, + attributes: { + baseName: "attributes", + type: "ChangeEventCustomAttributes", + required: true, + }, + category: { + baseName: "category", + type: "ChangeEventCategory", + required: true, + }, + message: { + baseName: "message", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + timestamp: { + baseName: "timestamp", + type: "string", + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEvent.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCategory.ts b/packages/datadog-api-client-v2/models/ChangeEventCategory.ts new file mode 100644 index 00000000000..f1c285f002a --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCategory.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 category to identify the type of event. Only the value `change` is supported. + */ + +export type ChangeEventCategory = typeof CHANGE | UnparsedObject; +export const CHANGE = "change"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateRequest.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateRequest.ts new file mode 100644 index 00000000000..f5be8959cc1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateRequest.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeEvent } from "./ChangeEvent"; +import { ChangeEventCreateRequestType } from "./ChangeEventCreateRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing an event. + */ +export class ChangeEventCreateRequest { + /** + * Event attributes. + */ + "attributes"?: ChangeEvent; + /** + * Entity type. + */ + "type"?: ChangeEventCreateRequestType; + + /** + * 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: "ChangeEvent", + }, + type: { + baseName: "type", + type: "ChangeEventCreateRequestType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateRequestPayload.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateRequestPayload.ts new file mode 100644 index 00000000000..ae7add40f1f --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateRequestPayload.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 { ChangeEventCreateRequest } from "./ChangeEventCreateRequest"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Create an event. + */ +export class ChangeEventCreateRequestPayload { + /** + * Object representing an event. + */ + "data"?: ChangeEventCreateRequest; + + /** + * 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: "ChangeEventCreateRequest", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateRequestPayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateRequestType.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateRequestType.ts new file mode 100644 index 00000000000..77b17fca766 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateRequestType.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"; + +/** + * Entity type. + */ + +export type ChangeEventCreateRequestType = typeof EVENT | UnparsedObject; +export const EVENT = "event"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateResponse.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateResponse.ts new file mode 100644 index 00000000000..41587cf0fb9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateResponse.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 { ChangeEventCreateResponseAttributes } from "./ChangeEventCreateResponseAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object containing an event response. + */ +export class ChangeEventCreateResponse { + /** + * Event response attributes. + */ + "attributes"?: ChangeEventCreateResponseAttributes; + /** + * Event 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: "ChangeEventCreateResponseAttributes", + }, + type: { + baseName: "type", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributes.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributes.ts new file mode 100644 index 00000000000..2d4fd067846 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributes.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 { ChangeEventCreateResponseAttributesAttributes } from "./ChangeEventCreateResponseAttributesAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Event response attributes. + */ +export class ChangeEventCreateResponseAttributes { + /** + * The definition of `ChangeEventCreateResponseAttributesAttributes` object. + */ + "attributes"?: ChangeEventCreateResponseAttributesAttributes; + + /** + * 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: "ChangeEventCreateResponseAttributesAttributes", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributes.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributes.ts new file mode 100644 index 00000000000..67f990c56ae --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributes.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 { ChangeEventCreateResponseAttributesAttributesEvt } from "./ChangeEventCreateResponseAttributesAttributesEvt"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of `ChangeEventCreateResponseAttributesAttributes` object. + */ +export class ChangeEventCreateResponseAttributesAttributes { + /** + * The definition of `ChangeEventCreateResponseAttributesAttributesEvt` object. + */ + "evt"?: ChangeEventCreateResponseAttributesAttributesEvt; + + /** + * 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 = { + evt: { + baseName: "evt", + type: "ChangeEventCreateResponseAttributesAttributesEvt", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateResponseAttributesAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributesEvt.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributesEvt.ts new file mode 100644 index 00000000000..7c4caa262f9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateResponseAttributesAttributesEvt.ts @@ -0,0 +1,52 @@ +/** + * 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"; + +/** + * The definition of `ChangeEventCreateResponseAttributesAttributesEvt` object. + */ +export class ChangeEventCreateResponseAttributesAttributesEvt { + /** + * Event id + */ + "id"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateResponseAttributesAttributesEvt.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCreateResponsePayload.ts b/packages/datadog-api-client-v2/models/ChangeEventCreateResponsePayload.ts new file mode 100644 index 00000000000..1583027897d --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCreateResponsePayload.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 { ChangeEventCreateResponse } from "./ChangeEventCreateResponse"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing information about created event. + */ +export class ChangeEventCreateResponsePayload { + /** + * Object containing an event response. + */ + "data"?: ChangeEventCreateResponse; + + /** + * 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: "ChangeEventCreateResponse", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCreateResponsePayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts new file mode 100644 index 00000000000..a8cf01b42cc --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributes.ts @@ -0,0 +1,97 @@ +/** + * 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 { ChangeEventCustomAttributesAuthor } from "./ChangeEventCustomAttributesAuthor"; +import { ChangeEventCustomAttributesChangedResource } from "./ChangeEventCustomAttributesChangedResource"; +import { ChangeEventCustomAttributesImpactedResourcesItems } from "./ChangeEventCustomAttributesImpactedResourcesItems"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing custom event attributes. + */ +export class ChangeEventCustomAttributes { + /** + * Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + */ + "author"?: ChangeEventCustomAttributesAuthor; + /** + * Free form object with any related information of the `change` event. + */ + "changeMetadata"?: { [key: string]: any }; + /** + * Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported. + */ + "changedResource": ChangeEventCustomAttributesChangedResource; + /** + * A list of resources impacted by this change. It is recommended to provide an impacted resource to display + * the change event at the right location. Only resources of type `service` are supported. + */ + "impactedResources"?: Array; + /** + * Free form object to track new value of the changed resource. + */ + "newValue"?: { [key: string]: any }; + /** + * Free form object to track previous value of the changed resource. + */ + "prevValue"?: { [key: string]: any }; + + /** + * 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 = { + author: { + baseName: "author", + type: "ChangeEventCustomAttributesAuthor", + }, + changeMetadata: { + baseName: "change_metadata", + type: "{ [key: string]: any; }", + }, + changedResource: { + baseName: "changed_resource", + type: "ChangeEventCustomAttributesChangedResource", + required: true, + }, + impactedResources: { + baseName: "impacted_resources", + type: "Array", + }, + newValue: { + baseName: "new_value", + type: "{ [key: string]: any; }", + }, + prevValue: { + baseName: "prev_value", + type: "{ [key: string]: any; }", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCustomAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts new file mode 100644 index 00000000000..41b38ab3853 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthor.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeEventCustomAttributesAuthorType } from "./ChangeEventCustomAttributesAuthorType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing the entity which made the change. Optional field but if provided should include `type` and `name`. + */ +export class ChangeEventCustomAttributesAuthor { + /** + * Author's name. Limited to 128 characters. + */ + "name": string; + /** + * Author's type. + */ + "type": ChangeEventCustomAttributesAuthorType; + + /** + * 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", + required: true, + }, + type: { + baseName: "type", + type: "ChangeEventCustomAttributesAuthorType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCustomAttributesAuthor.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthorType.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthorType.ts new file mode 100644 index 00000000000..8dbaa164423 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesAuthorType.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"; + +/** + * Author's type. + */ + +export type ChangeEventCustomAttributesAuthorType = + | typeof USER + | typeof SYSTEM + | UnparsedObject; +export const USER = "user"; +export const SYSTEM = "system"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts new file mode 100644 index 00000000000..b3a7ddbc5d9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResource.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeEventCustomAttributesChangedResourceType } from "./ChangeEventCustomAttributesChangedResourceType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing a uniquely identified resource. Only the resource type `feature_flag` is supported. + */ +export class ChangeEventCustomAttributesChangedResource { + /** + * Resource's name. + */ + "name": string; + /** + * Resource's type. + */ + "type": ChangeEventCustomAttributesChangedResourceType; + + /** + * 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", + required: true, + }, + type: { + baseName: "type", + type: "ChangeEventCustomAttributesChangedResourceType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCustomAttributesChangedResource.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResourceType.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResourceType.ts new file mode 100644 index 00000000000..c9689a29f59 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesChangedResourceType.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"; + +/** + * Resource's type. + */ + +export type ChangeEventCustomAttributesChangedResourceType = + | typeof FEATURE_FLAG + | UnparsedObject; +export const FEATURE_FLAG = "feature_flag"; diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts new file mode 100644 index 00000000000..1677006e8d9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItems.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ChangeEventCustomAttributesImpactedResourcesItemsType } from "./ChangeEventCustomAttributesImpactedResourcesItemsType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object representing a uniquely identified resource. Only the resource type `service` is supported. + */ +export class ChangeEventCustomAttributesImpactedResourcesItems { + /** + * Resource's name. + */ + "name": string; + /** + * Resource's type. + */ + "type": ChangeEventCustomAttributesImpactedResourcesItemsType; + + /** + * 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", + required: true, + }, + type: { + baseName: "type", + type: "ChangeEventCustomAttributesImpactedResourcesItemsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ChangeEventCustomAttributesImpactedResourcesItems.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItemsType.ts b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItemsType.ts new file mode 100644 index 00000000000..8c944085516 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ChangeEventCustomAttributesImpactedResourcesItemsType.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"; + +/** + * Resource's type. + */ + +export type ChangeEventCustomAttributesImpactedResourcesItemsType = + | typeof SERVICE + | UnparsedObject; +export const SERVICE = "service"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 097b22314e2..2327be0d473 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -147,6 +147,18 @@ import { CaseUpdateStatusRequest } from "./CaseUpdateStatusRequest"; import { CasesResponse } from "./CasesResponse"; import { CasesResponseMeta } from "./CasesResponseMeta"; import { CasesResponseMetaPagination } from "./CasesResponseMetaPagination"; +import { ChangeEvent } from "./ChangeEvent"; +import { ChangeEventCreateRequest } from "./ChangeEventCreateRequest"; +import { ChangeEventCreateRequestPayload } from "./ChangeEventCreateRequestPayload"; +import { ChangeEventCreateResponse } from "./ChangeEventCreateResponse"; +import { ChangeEventCreateResponseAttributes } from "./ChangeEventCreateResponseAttributes"; +import { ChangeEventCreateResponseAttributesAttributes } from "./ChangeEventCreateResponseAttributesAttributes"; +import { ChangeEventCreateResponseAttributesAttributesEvt } from "./ChangeEventCreateResponseAttributesAttributesEvt"; +import { ChangeEventCreateResponsePayload } from "./ChangeEventCreateResponsePayload"; +import { ChangeEventCustomAttributes } from "./ChangeEventCustomAttributes"; +import { ChangeEventCustomAttributesAuthor } from "./ChangeEventCustomAttributesAuthor"; +import { ChangeEventCustomAttributesChangedResource } from "./ChangeEventCustomAttributesChangedResource"; +import { ChangeEventCustomAttributesImpactedResourcesItems } from "./ChangeEventCustomAttributesImpactedResourcesItems"; import { ChargebackBreakdown } from "./ChargebackBreakdown"; import { CloudConfigurationComplianceRuleOptions } from "./CloudConfigurationComplianceRuleOptions"; import { CloudConfigurationRegoRule } from "./CloudConfigurationRegoRule"; @@ -1378,6 +1390,11 @@ const enumsMap: { [key: string]: any[] } = { CaseSortableField: ["created_at", "priority", "status"], CaseStatus: ["OPEN", "IN_PROGRESS", "CLOSED"], CaseType: ["STANDARD"], + ChangeEventCategory: ["change"], + ChangeEventCreateRequestType: ["event"], + ChangeEventCustomAttributesAuthorType: ["user", "system"], + ChangeEventCustomAttributesChangedResourceType: ["feature_flag"], + ChangeEventCustomAttributesImpactedResourcesItemsType: ["service"], CloudConfigurationRuleType: ["cloud_configuration"], CloudCostActivityType: ["cloud_cost_activity"], CloudWorkloadSecurityAgentRuleType: ["agent_rule"], @@ -2053,6 +2070,22 @@ const typeMap: { [index: string]: any } = { CasesResponse: CasesResponse, CasesResponseMeta: CasesResponseMeta, CasesResponseMetaPagination: CasesResponseMetaPagination, + ChangeEvent: ChangeEvent, + ChangeEventCreateRequest: ChangeEventCreateRequest, + ChangeEventCreateRequestPayload: ChangeEventCreateRequestPayload, + ChangeEventCreateResponse: ChangeEventCreateResponse, + ChangeEventCreateResponseAttributes: ChangeEventCreateResponseAttributes, + ChangeEventCreateResponseAttributesAttributes: + ChangeEventCreateResponseAttributesAttributes, + ChangeEventCreateResponseAttributesAttributesEvt: + ChangeEventCreateResponseAttributesAttributesEvt, + ChangeEventCreateResponsePayload: ChangeEventCreateResponsePayload, + ChangeEventCustomAttributes: ChangeEventCustomAttributes, + ChangeEventCustomAttributesAuthor: ChangeEventCustomAttributesAuthor, + ChangeEventCustomAttributesChangedResource: + ChangeEventCustomAttributesChangedResource, + ChangeEventCustomAttributesImpactedResourcesItems: + ChangeEventCustomAttributesImpactedResourcesItems, ChargebackBreakdown: ChargebackBreakdown, CloudConfigurationComplianceRuleOptions: CloudConfigurationComplianceRuleOptions,