diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 49e923cae4cb..f42585b82722 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4053,6 +4053,86 @@ components: type: string type: array type: object + AccountFilters: + description: The account filters for a cloud account. + properties: + attributes: + $ref: "#/components/schemas/AccountFiltersAttributes" + id: + description: The ID of the cloud account. + example: "123456789123" + type: string + type: + $ref: "#/components/schemas/AccountFiltersType" + required: + - attributes + - type + type: object + AccountFiltersAttributes: + description: Attributes for the account filters of a cloud account. + properties: + account_filters: + $ref: "#/components/schemas/AccountFilteringConfig" + account_id: + description: The cloud account ID. + example: "123456789123" + type: string + cloud: + description: The cloud provider of the account, for example `aws`, `aws_cur2`, or `oci`. + example: "aws_cur2" + type: string + type: object + AccountFiltersPatchData: + description: Account filters patch data. + properties: + attributes: + $ref: "#/components/schemas/AccountFiltersPatchRequestAttributes" + type: + $ref: "#/components/schemas/AccountFiltersPatchRequestType" + required: + - attributes + - type + type: object + AccountFiltersPatchRequest: + description: Account filters patch request. + properties: + data: + $ref: "#/components/schemas/AccountFiltersPatchData" + required: + - data + type: object + AccountFiltersPatchRequestAttributes: + description: Attributes for an account filters patch request. + properties: + account_filters: + $ref: "#/components/schemas/AccountFilteringConfig" + required: + - account_filters + type: object + AccountFiltersPatchRequestType: + default: account_filters_patch_request + description: Type of account filters patch request. + enum: + - account_filters_patch_request + example: account_filters_patch_request + type: string + x-enum-varnames: + - ACCOUNT_FILTERS_PATCH_REQUEST + AccountFiltersResponse: + description: Response containing the account filters for a cloud account. + properties: + data: + $ref: "#/components/schemas/AccountFilters" + type: object + AccountFiltersType: + default: account_filters + description: Type of account filters. + enum: + - account_filters + example: account_filters + type: string + x-enum-varnames: + - ACCOUNT_FILTERS ActionConnectionAttributes: description: The definition of `ActionConnectionAttributes` object. properties: @@ -70492,6 +70572,8 @@ components: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit" maxItems: 100 type: array + tracking_mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode" type: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType" value_limit: @@ -70506,6 +70588,7 @@ components: - type - include - limit_exceeded_action + - tracking_mode - value_limit - enabled type: object @@ -70520,6 +70603,16 @@ components: x-enum-varnames: - DROP_TAG - DROP_EVENT + ObservabilityPipelineTagCardinalityLimitProcessorOverrideType: + description: How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. + enum: + - limit_override + - excluded + example: limit_override + type: string + x-enum-varnames: + - LIMIT_OVERRIDE + - EXCLUDED ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit: description: A cardinality override applied to a specific metric. properties: @@ -70529,16 +70622,16 @@ components: description: The name of the metric this override applies to. example: "system.cpu.user" type: string - mode: - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode" + override_type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType" per_tag_limits: - description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`. items: $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit" maxItems: 50 type: array value_limit: - description: The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + description: The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. example: 10000 format: int64 maximum: 1000000 @@ -70546,29 +70639,19 @@ components: type: integer required: - metric_name - - mode + - override_type type: object - ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode: - description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. - enum: - - tracked - - excluded - example: tracked - type: string - x-enum-varnames: - - TRACKED - - EXCLUDED ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit: description: A cardinality override for a specific tag key within a per-metric limit. properties: - mode: - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode" + override_type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType" tag_key: description: The tag key this override applies to. example: "host" type: string value_limit: - description: The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + description: The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. example: 5000 format: int64 maximum: 1000000 @@ -70576,18 +70659,26 @@ components: type: integer required: - tag_key + - override_type + type: object + ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode: + description: Controls whether the processor uses exact or probabilistic tag tracking. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode" + required: - mode type: object - ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode: - description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode: + description: The cardinality tracking algorithm to use. enum: - - limit_override - - excluded - example: limit_override + - exact_fingerprint + - probabilistic + example: exact_fingerprint type: string x-enum-varnames: - - LIMIT_OVERRIDE - - EXCLUDED + - EXACT_FINGERPRINT + - PROBABILISTIC ObservabilityPipelineTagCardinalityLimitProcessorType: default: tag_cardinality_limit description: The processor type. The value must be `tag_cardinality_limit`. @@ -125706,6 +125797,182 @@ paths: "x-permission": operator: OPEN permissions: [] + /api/v2/cost/account_filters/{cloud_account_id}: + get: + description: Get the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds). + operationId: GetCostAccountFilters + parameters: + - $ref: "#/components/parameters/CloudAccountID" + responses: + "200": + content: + application/json: + examples: + default: + summary: Include new accounts and exclude specific accounts + value: + data: + attributes: + account_filters: + excluded_accounts: + - "123456789123" + - "123456789143" + include_new_accounts: true + account_id: "123456789123" + cloud: aws_cur2 + id: "123" + type: account_filters + include_accounts: + summary: Exclude new accounts and include specific accounts + value: + data: + attributes: + account_filters: + include_new_accounts: false + included_accounts: + - "123456789123" + - "123456789143" + account_id: "123456789123" + cloud: aws_cur2 + id: "123" + type: account_filters + schema: + $ref: "#/components/schemas/AccountFiltersResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get account filters + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + patch: + description: Update the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds). + operationId: UpdateCostAccountFilters + parameters: + - $ref: "#/components/parameters/CloudAccountID" + requestBody: + content: + application/json: + examples: + default: + summary: Exclude new accounts and include specific accounts + value: + data: + attributes: + account_filters: + include_new_accounts: false + included_accounts: + - "123456789123" + - "123456789143" + type: account_filters_patch_request + exclude_accounts: + summary: Include new accounts and exclude specific accounts + value: + data: + attributes: + account_filters: + excluded_accounts: + - "123456789123" + - "123456789143" + include_new_accounts: true + type: account_filters_patch_request + schema: + $ref: "#/components/schemas/AccountFiltersPatchRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + summary: Exclude new accounts and include specific accounts + value: + data: + attributes: + account_filters: + include_new_accounts: false + included_accounts: + - "123456789123" + - "123456789143" + account_id: "123456789123" + cloud: aws_cur2 + id: "123" + type: account_filters + exclude_accounts: + summary: Include new accounts and exclude specific accounts + value: + data: + attributes: + account_filters: + excluded_accounts: + - "123456789123" + - "123456789143" + include_new_accounts: true + account_id: "123456789123" + cloud: aws_cur2 + id: "123" + type: account_filters + schema: + $ref: "#/components/schemas/AccountFiltersResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_write + summary: Update account filters + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_write /api/v2/cost/anomalies: get: description: List detected Cloud Cost Management anomalies for the organization. diff --git a/examples/v2/cloud-cost-management/GetCostAccountFilters.ts b/examples/v2/cloud-cost-management/GetCostAccountFilters.ts new file mode 100644 index 000000000000..9d6b937eaa86 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCostAccountFilters.ts @@ -0,0 +1,21 @@ +/** + * Get account filters returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.CloudCostManagementApi(configuration); + +const params: v2.CloudCostManagementApiGetCostAccountFiltersRequest = { + cloudAccountId: 9223372036854775807, +}; + +apiInstance + .getCostAccountFilters(params) + .then((data: v2.AccountFiltersResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/cloud-cost-management/UpdateCostAccountFilters.ts b/examples/v2/cloud-cost-management/UpdateCostAccountFilters.ts new file mode 100644 index 000000000000..1bf7fd604e80 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpdateCostAccountFilters.ts @@ -0,0 +1,33 @@ +/** + * Update account filters returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.CloudCostManagementApi(configuration); + +const params: v2.CloudCostManagementApiUpdateCostAccountFiltersRequest = { + body: { + data: { + attributes: { + accountFilters: { + excludedAccounts: ["123456789123", "123456789143"], + includeNewAccounts: true, + includedAccounts: ["123456789123", "123456789143"], + }, + }, + type: "account_filters_patch_request", + }, + }, + cloudAccountId: 9223372036854775807, +}; + +apiInstance + .updateCostAccountFilters(params) + .then((data: v2.AccountFiltersResponse) => { + 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 dd7276078051..cc6ad8abe8f7 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -7505,6 +7505,24 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "ContainersResponse", }, + "v2.GetCostAccountFilters": { + "cloudAccountId": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "AccountFiltersResponse", + }, + "v2.UpdateCostAccountFilters": { + "cloudAccountId": { + "type": "number", + "format": "int64", + }, + "body": { + "type": "AccountFiltersPatchRequest", + "format": "", + }, + "operationResponseType": "AccountFiltersResponse", + }, "v2.ListCostAnomalies": { "start": { "type": "number", diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 258f3468a9f7..330fae498a5a 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -384,6 +384,27 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "EVP Cost Tags" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get account filters returns "Bad Request" response + Given new "GetCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get account filters returns "Not Found" response + Given new "GetCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get account filters returns "OK" response + Given new "GetCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management Scenario: Get budget returns "Bad Request" response Given new "GetBudget" request @@ -938,6 +959,30 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data.attributes.account_id" is equal to "123456_A123BC_12AB34" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Update account filters returns "Bad Request" response + Given new "UpdateCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Update account filters returns "Not Found" response + Given new "UpdateCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Update account filters returns "OK" response + Given new "UpdateCostAccountFilters" request + And request contains "cloud_account_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"account_filters": {"excluded_accounts": ["123456789123", "123456789143"], "include_new_accounts": true, "included_accounts": ["123456789123", "123456789143"]}}, "type": "account_filters_patch_request"}} + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Update custom allocation rule returns "OK" response Given new "UpdateCustomAllocationRule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 22089f0ecea4..f59e58b1379d 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1622,6 +1622,18 @@ "type": "safe" } }, + "GetCostAccountFilters": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "UpdateCostAccountFilters": { + "tag": "Cloud Cost Management", + "undo": { + "type": "idempotent" + } + }, "ListCostAnomalies": { "tag": "Cloud Cost Management", "undo": { diff --git a/packages/datadog-api-client-v2/apis/CloudCostManagementApi.ts b/packages/datadog-api-client-v2/apis/CloudCostManagementApi.ts index a687272b34a6..d95eafe0c47d 100644 --- a/packages/datadog-api-client-v2/apis/CloudCostManagementApi.ts +++ b/packages/datadog-api-client-v2/apis/CloudCostManagementApi.ts @@ -16,6 +16,8 @@ import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; +import { AccountFiltersPatchRequest } from "../models/AccountFiltersPatchRequest"; +import { AccountFiltersResponse } from "../models/AccountFiltersResponse"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ArbitraryCostUpsertRequest } from "../models/ArbitraryCostUpsertRequest"; import { ArbitraryRuleResponse } from "../models/ArbitraryRuleResponse"; @@ -1529,6 +1531,41 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async getCostAccountFilters( + cloudAccountId: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'cloudAccountId' is not null or undefined + if (cloudAccountId === null || cloudAccountId === undefined) { + throw new RequiredError("cloudAccountId", "getCostAccountFilters"); + } + + // Path Params + const localVarPath = + "/api/v2/cost/account_filters/{cloud_account_id}".replace( + "{cloud_account_id}", + encodeURIComponent(String(cloudAccountId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.CloudCostManagementApi.getCostAccountFilters") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getCostAnomaly( anomalyId: string, _options?: Configuration @@ -2941,6 +2978,58 @@ export class CloudCostManagementApiRequestFactory extends BaseAPIRequestFactory return requestContext; } + public async updateCostAccountFilters( + cloudAccountId: number, + body: AccountFiltersPatchRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'cloudAccountId' is not null or undefined + if (cloudAccountId === null || cloudAccountId === undefined) { + throw new RequiredError("cloudAccountId", "updateCostAccountFilters"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateCostAccountFilters"); + } + + // Path Params + const localVarPath = + "/api/v2/cost/account_filters/{cloud_account_id}".replace( + "{cloud_account_id}", + encodeURIComponent(String(cloudAccountId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.CloudCostManagementApi.updateCostAccountFilters") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + 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, "AccountFiltersPatchRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async updateCostAWSCURConfig( cloudAccountId: number, body: AwsCURConfigPatchRequest, @@ -5031,6 +5120,69 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * 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 getCostAccountFilters + * @throws ApiException if the response code was not in [200, 299] + */ + public async getCostAccountFilters( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: AccountFiltersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AccountFiltersResponse" + ) as AccountFiltersResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + 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: AccountFiltersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AccountFiltersResponse", + "" + ) as AccountFiltersResponse; + 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 @@ -6928,6 +7080,69 @@ export class CloudCostManagementApiResponseProcessor { ); } + /** + * 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 updateCostAccountFilters + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateCostAccountFilters( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: AccountFiltersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AccountFiltersResponse" + ) as AccountFiltersResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + 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: AccountFiltersResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "AccountFiltersResponse", + "" + ) as AccountFiltersResponse; + 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 @@ -8033,6 +8248,14 @@ export interface CloudCostManagementApiGetCommitmentsUtilizationTimeseriesReques commitmentType?: CommitmentsCommitmentType; } +export interface CloudCostManagementApiGetCostAccountFiltersRequest { + /** + * Cloud Account id. + * @type number + */ + cloudAccountId: number; +} + export interface CloudCostManagementApiGetCostAnomalyRequest { /** * The UUID of the cost anomaly. @@ -8387,6 +8610,18 @@ export interface CloudCostManagementApiSearchCostRecommendationsRequest { pageToken?: string; } +export interface CloudCostManagementApiUpdateCostAccountFiltersRequest { + /** + * Cloud Account id. + * @type number + */ + cloudAccountId: number; + /** + * @type AccountFiltersPatchRequest + */ + body: AccountFiltersPatchRequest; +} + export interface CloudCostManagementApiUpdateCostAWSCURConfigRequest { /** * Cloud Account id. @@ -9108,6 +9343,27 @@ export class CloudCostManagementApi { }); } + /** + * Get the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds). + * @param param The request object + */ + public getCostAccountFilters( + param: CloudCostManagementApiGetCostAccountFiltersRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getCostAccountFilters( + param.cloudAccountId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getCostAccountFilters(responseContext); + }); + }); + } + /** * Get a detected Cloud Cost Management anomaly by UUID. * @param param The request object @@ -9823,6 +10079,30 @@ export class CloudCostManagementApi { }); } + /** + * Update the account filters for a cloud account (AWS CUR 1.0/2.0, OCI, and other clouds). + * @param param The request object + */ + public updateCostAccountFilters( + param: CloudCostManagementApiUpdateCostAccountFiltersRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateCostAccountFilters( + param.cloudAccountId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateCostAccountFilters( + responseContext + ); + }); + }); + } + /** * Update the status (active/archived) and/or account filtering configuration of an AWS CUR config. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index d8c31efb6d03..88a55ac85838 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -342,6 +342,7 @@ export { CloudCostManagementApiGetCommitmentsUtilizationScalarRequest, CloudCostManagementApiGetCommitmentsUtilizationTimeseriesRequest, CloudCostManagementApiGetCostAWSCURConfigRequest, + CloudCostManagementApiGetCostAccountFiltersRequest, CloudCostManagementApiGetCostAnomalyRequest, CloudCostManagementApiGetCostAzureUCConfigRequest, CloudCostManagementApiGetCostGCPUsageCostConfigRequest, @@ -365,6 +366,7 @@ export { CloudCostManagementApiReorderTagPipelinesRulesetsRequest, CloudCostManagementApiSearchCostRecommendationsRequest, CloudCostManagementApiUpdateCostAWSCURConfigRequest, + CloudCostManagementApiUpdateCostAccountFiltersRequest, CloudCostManagementApiUpdateCostAzureUCConfigsRequest, CloudCostManagementApiUpdateCostGCPUsageCostConfigRequest, CloudCostManagementApiUpdateCustomAllocationRuleRequest, @@ -1837,6 +1839,14 @@ export { AccessTokenListItemRelationships } from "./models/AccessTokenListItemRe export { AccessTokenOwnerType } from "./models/AccessTokenOwnerType"; export { AccessTokensType } from "./models/AccessTokensType"; export { AccountFilteringConfig } from "./models/AccountFilteringConfig"; +export { AccountFilters } from "./models/AccountFilters"; +export { AccountFiltersAttributes } from "./models/AccountFiltersAttributes"; +export { AccountFiltersPatchData } from "./models/AccountFiltersPatchData"; +export { AccountFiltersPatchRequest } from "./models/AccountFiltersPatchRequest"; +export { AccountFiltersPatchRequestAttributes } from "./models/AccountFiltersPatchRequestAttributes"; +export { AccountFiltersPatchRequestType } from "./models/AccountFiltersPatchRequestType"; +export { AccountFiltersResponse } from "./models/AccountFiltersResponse"; +export { AccountFiltersType } from "./models/AccountFiltersType"; export { ActionConnectionAttributes } from "./models/ActionConnectionAttributes"; export { ActionConnectionAttributesUpdate } from "./models/ActionConnectionAttributesUpdate"; export { ActionConnectionData } from "./models/ActionConnectionData"; @@ -5974,10 +5984,11 @@ export { ObservabilityPipelineSyslogNgSourceType } from "./models/ObservabilityP export { ObservabilityPipelineSyslogSourceMode } from "./models/ObservabilityPipelineSyslogSourceMode"; export { ObservabilityPipelineTagCardinalityLimitProcessor } from "./models/ObservabilityPipelineTagCardinalityLimitProcessor"; export { ObservabilityPipelineTagCardinalityLimitProcessorAction } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorAction"; +export { ObservabilityPipelineTagCardinalityLimitProcessorOverrideType } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"; export { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit"; -export { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode"; export { ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit"; -export { ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode"; +export { ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode"; +export { ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode"; export { ObservabilityPipelineTagCardinalityLimitProcessorType } from "./models/ObservabilityPipelineTagCardinalityLimitProcessorType"; export { ObservabilityPipelineThrottleProcessor } from "./models/ObservabilityPipelineThrottleProcessor"; export { ObservabilityPipelineThrottleProcessorType } from "./models/ObservabilityPipelineThrottleProcessorType"; diff --git a/packages/datadog-api-client-v2/models/AccountFilters.ts b/packages/datadog-api-client-v2/models/AccountFilters.ts new file mode 100644 index 000000000000..0ecdb2799c21 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFilters.ts @@ -0,0 +1,72 @@ +/** + * 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 { AccountFiltersAttributes } from "./AccountFiltersAttributes"; +import { AccountFiltersType } from "./AccountFiltersType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The account filters for a cloud account. + */ +export class AccountFilters { + /** + * Attributes for the account filters of a cloud account. + */ + "attributes": AccountFiltersAttributes; + /** + * The ID of the cloud account. + */ + "id"?: string; + /** + * Type of account filters. + */ + "type": AccountFiltersType; + + /** + * 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: "AccountFiltersAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "AccountFiltersType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFilters.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AccountFiltersAttributes.ts b/packages/datadog-api-client-v2/models/AccountFiltersAttributes.ts new file mode 100644 index 000000000000..9c879d2cf21c --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersAttributes.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 { AccountFilteringConfig } from "./AccountFilteringConfig"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for the account filters of a cloud account. + */ +export class AccountFiltersAttributes { + /** + * The account filtering configuration. + */ + "accountFilters"?: AccountFilteringConfig; + /** + * The cloud account ID. + */ + "accountId"?: string; + /** + * The cloud provider of the account, for example `aws`, `aws_cur2`, or `oci`. + */ + "cloud"?: 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 = { + accountFilters: { + baseName: "account_filters", + type: "AccountFilteringConfig", + }, + accountId: { + baseName: "account_id", + type: "string", + }, + cloud: { + baseName: "cloud", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFiltersAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AccountFiltersPatchData.ts b/packages/datadog-api-client-v2/models/AccountFiltersPatchData.ts new file mode 100644 index 000000000000..b8dd19a64042 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersPatchData.ts @@ -0,0 +1,64 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { AccountFiltersPatchRequestAttributes } from "./AccountFiltersPatchRequestAttributes"; +import { AccountFiltersPatchRequestType } from "./AccountFiltersPatchRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Account filters patch data. + */ +export class AccountFiltersPatchData { + /** + * Attributes for an account filters patch request. + */ + "attributes": AccountFiltersPatchRequestAttributes; + /** + * Type of account filters patch request. + */ + "type": AccountFiltersPatchRequestType; + + /** + * 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: "AccountFiltersPatchRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "AccountFiltersPatchRequestType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFiltersPatchData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AccountFiltersPatchRequest.ts b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequest.ts new file mode 100644 index 000000000000..2074cdacfe78 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { AccountFiltersPatchData } from "./AccountFiltersPatchData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Account filters patch request. + */ +export class AccountFiltersPatchRequest { + /** + * Account filters patch data. + */ + "data": AccountFiltersPatchData; + + /** + * 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: "AccountFiltersPatchData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFiltersPatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AccountFiltersPatchRequestAttributes.ts b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequestAttributes.ts new file mode 100644 index 000000000000..d30209c37932 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequestAttributes.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { AccountFilteringConfig } from "./AccountFilteringConfig"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for an account filters patch request. + */ +export class AccountFiltersPatchRequestAttributes { + /** + * The account filtering configuration. + */ + "accountFilters": AccountFilteringConfig; + + /** + * 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 = { + accountFilters: { + baseName: "account_filters", + type: "AccountFilteringConfig", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFiltersPatchRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode.ts b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequestType.ts similarity index 53% rename from packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode.ts rename to packages/datadog-api-client-v2/models/AccountFiltersPatchRequestType.ts index 8e038a608c1e..c8de1bf76af0 100644 --- a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode.ts +++ b/packages/datadog-api-client-v2/models/AccountFiltersPatchRequestType.ts @@ -7,12 +7,10 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + * Type of account filters patch request. */ -export type ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode = - | typeof TRACKED - | typeof EXCLUDED +export type AccountFiltersPatchRequestType = + | typeof ACCOUNT_FILTERS_PATCH_REQUEST | UnparsedObject; -export const TRACKED = "tracked"; -export const EXCLUDED = "excluded"; +export const ACCOUNT_FILTERS_PATCH_REQUEST = "account_filters_patch_request"; diff --git a/packages/datadog-api-client-v2/models/AccountFiltersResponse.ts b/packages/datadog-api-client-v2/models/AccountFiltersResponse.ts new file mode 100644 index 000000000000..57f9d85d7d7b --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersResponse.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 { AccountFilters } from "./AccountFilters"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the account filters for a cloud account. + */ +export class AccountFiltersResponse { + /** + * The account filters for a cloud account. + */ + "data"?: AccountFilters; + + /** + * 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: "AccountFilters", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return AccountFiltersResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/AccountFiltersType.ts b/packages/datadog-api-client-v2/models/AccountFiltersType.ts new file mode 100644 index 000000000000..aa5d7d59bc59 --- /dev/null +++ b/packages/datadog-api-client-v2/models/AccountFiltersType.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"; + +/** + * Type of account filters. + */ + +export type AccountFiltersType = typeof ACCOUNT_FILTERS | UnparsedObject; +export const ACCOUNT_FILTERS = "account_filters"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index fcc6cb662499..6ca209fc0514 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -106,6 +106,12 @@ import { AWSTracesConfig } from "./AWSTracesConfig"; import { AccessTokenListItem } from "./AccessTokenListItem"; import { AccessTokenListItemRelationships } from "./AccessTokenListItemRelationships"; import { AccountFilteringConfig } from "./AccountFilteringConfig"; +import { AccountFilters } from "./AccountFilters"; +import { AccountFiltersAttributes } from "./AccountFiltersAttributes"; +import { AccountFiltersPatchData } from "./AccountFiltersPatchData"; +import { AccountFiltersPatchRequest } from "./AccountFiltersPatchRequest"; +import { AccountFiltersPatchRequestAttributes } from "./AccountFiltersPatchRequestAttributes"; +import { AccountFiltersResponse } from "./AccountFiltersResponse"; import { ActionConnectionAttributes } from "./ActionConnectionAttributes"; import { ActionConnectionAttributesUpdate } from "./ActionConnectionAttributesUpdate"; import { ActionConnectionData } from "./ActionConnectionData"; @@ -3177,6 +3183,7 @@ import { ObservabilityPipelineSyslogNgSource } from "./ObservabilityPipelineSysl import { ObservabilityPipelineTagCardinalityLimitProcessor } from "./ObservabilityPipelineTagCardinalityLimitProcessor"; import { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit"; import { ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit"; +import { ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode } from "./ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode"; import { ObservabilityPipelineThrottleProcessor } from "./ObservabilityPipelineThrottleProcessor"; import { ObservabilityPipelineTls } from "./ObservabilityPipelineTls"; import { ObservabilityPipelineWebsocketSource } from "./ObservabilityPipelineWebsocketSource"; @@ -5340,6 +5347,8 @@ const enumsMap: { [key: string]: any[] } = { AWSNewExternalIDResponseDataType: ["external_id"], AccessTokenOwnerType: ["users", "service_account"], AccessTokensType: ["personal_access_tokens", "service_access_tokens"], + AccountFiltersPatchRequestType: ["account_filters_patch_request"], + AccountFiltersType: ["account_filters"], ActionConnectionDataType: ["action_connection"], ActionQueryType: ["action"], ActiveBillingDimensionsType: ["billing_dimensions"], @@ -6997,14 +7006,14 @@ const enumsMap: { [key: string]: any[] } = { "drop_tag", "drop_event", ], - ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode: [ - "tracked", - "excluded", - ], - ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode: [ + ObservabilityPipelineTagCardinalityLimitProcessorOverrideType: [ "limit_override", "excluded", ], + ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode: [ + "exact_fingerprint", + "probabilistic", + ], ObservabilityPipelineTagCardinalityLimitProcessorType: [ "tag_cardinality_limit", ], @@ -8352,6 +8361,12 @@ const typeMap: { [index: string]: any } = { AccessTokenListItem: AccessTokenListItem, AccessTokenListItemRelationships: AccessTokenListItemRelationships, AccountFilteringConfig: AccountFilteringConfig, + AccountFilters: AccountFilters, + AccountFiltersAttributes: AccountFiltersAttributes, + AccountFiltersPatchData: AccountFiltersPatchData, + AccountFiltersPatchRequest: AccountFiltersPatchRequest, + AccountFiltersPatchRequestAttributes: AccountFiltersPatchRequestAttributes, + AccountFiltersResponse: AccountFiltersResponse, ActionConnectionAttributes: ActionConnectionAttributes, ActionConnectionAttributesUpdate: ActionConnectionAttributesUpdate, ActionConnectionData: ActionConnectionData, @@ -12032,6 +12047,8 @@ const typeMap: { [index: string]: any } = { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit, ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit: ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit, + ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode: + ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode, ObservabilityPipelineThrottleProcessor: ObservabilityPipelineThrottleProcessor, ObservabilityPipelineTls: ObservabilityPipelineTls, diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessor.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessor.ts index 9a4922d069c3..d85f143c5fcd 100644 --- a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessor.ts +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessor.ts @@ -5,6 +5,7 @@ */ import { ObservabilityPipelineTagCardinalityLimitProcessorAction } from "./ObservabilityPipelineTagCardinalityLimitProcessorAction"; import { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit"; +import { ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode } from "./ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode"; import { ObservabilityPipelineTagCardinalityLimitProcessorType } from "./ObservabilityPipelineTagCardinalityLimitProcessorType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -39,6 +40,10 @@ export class ObservabilityPipelineTagCardinalityLimitProcessor { * A list of per-metric cardinality overrides that take precedence over the default `value_limit`. */ "perMetricLimits"?: Array; + /** + * Controls whether the processor uses exact or probabilistic tag tracking. + */ + "trackingMode": ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode; /** * The processor type. The value must be `tag_cardinality_limit`. */ @@ -92,6 +97,11 @@ export class ObservabilityPipelineTagCardinalityLimitProcessor { baseName: "per_metric_limits", type: "Array", }, + trackingMode: { + baseName: "tracking_mode", + type: "ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode", + required: true, + }, type: { baseName: "type", type: "ObservabilityPipelineTagCardinalityLimitProcessorType", diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType.ts similarity index 68% rename from packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode.ts rename to packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType.ts index fe0b3b002364..d566766edecd 100644 --- a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode.ts +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorOverrideType.ts @@ -7,10 +7,10 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + * How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. */ -export type ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode = +export type ObservabilityPipelineTagCardinalityLimitProcessorOverrideType = | typeof LIMIT_OVERRIDE | typeof EXCLUDED | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit.ts index 129f0e5620e4..524e72c88789 100644 --- a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit.ts +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit.ts @@ -4,7 +4,7 @@ * Copyright 2020-Present Datadog, Inc. */ import { ObservabilityPipelineTagCardinalityLimitProcessorAction } from "./ObservabilityPipelineTagCardinalityLimitProcessorAction"; -import { ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode"; +import { ObservabilityPipelineTagCardinalityLimitProcessorOverrideType } from "./ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"; import { ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -22,15 +22,15 @@ export class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit { */ "metricName": string; /** - * How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + * How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. */ - "mode": ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode; + "overrideType": ObservabilityPipelineTagCardinalityLimitProcessorOverrideType; /** - * A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + * A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `override_type` is `excluded`. */ "perTagLimits"?: Array; /** - * The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + * The maximum number of distinct tag value combinations allowed for this metric. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. */ "valueLimit"?: number; @@ -59,9 +59,9 @@ export class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit { type: "string", required: true, }, - mode: { - baseName: "mode", - type: "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode", + overrideType: { + baseName: "override_type", + type: "ObservabilityPipelineTagCardinalityLimitProcessorOverrideType", required: true, }, perTagLimits: { diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit.ts index 8e26876997ce..b6ad652287b0 100644 --- a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit.ts +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit.ts @@ -3,7 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode } from "./ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode"; +import { ObservabilityPipelineTagCardinalityLimitProcessorOverrideType } from "./ObservabilityPipelineTagCardinalityLimitProcessorOverrideType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -12,15 +12,15 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; */ export class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit { /** - * How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + * How the override is applied. `limit_override` enforces a custom limit; `excluded` omits the metric or tag from cardinality tracking. */ - "mode": ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode; + "overrideType": ObservabilityPipelineTagCardinalityLimitProcessorOverrideType; /** * The tag key this override applies to. */ "tagKey": string; /** - * The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + * The maximum number of distinct values allowed for this tag. Required when `override_type` is `limit_override`. Must be omitted when `override_type` is `excluded`. */ "valueLimit"?: number; @@ -40,9 +40,9 @@ export class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { - mode: { - baseName: "mode", - type: "ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode", + overrideType: { + baseName: "override_type", + type: "ObservabilityPipelineTagCardinalityLimitProcessorOverrideType", required: true, }, tagKey: { diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode.ts new file mode 100644 index 000000000000..24d7cebdc141 --- /dev/null +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode } from "./ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Controls whether the processor uses exact or probabilistic tag tracking. + */ +export class ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode { + /** + * The cardinality tracking algorithm to use. + */ + "mode": ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode; + + /** + * 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 = { + mode: { + baseName: "mode", + type: "ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return ObservabilityPipelineTagCardinalityLimitProcessorTrackingMode.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode.ts b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode.ts new file mode 100644 index 000000000000..2b970ecfcd6c --- /dev/null +++ b/packages/datadog-api-client-v2/models/ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode.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 cardinality tracking algorithm to use. + */ + +export type ObservabilityPipelineTagCardinalityLimitProcessorTrackingModeMode = + | typeof EXACT_FINGERPRINT + | typeof PROBABILISTIC + | UnparsedObject; +export const EXACT_FINGERPRINT = "exact_fingerprint"; +export const PROBABILISTIC = "probabilistic";