From 237e764338497b73a825cd6cbca3daf9acab3e87 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 12 Aug 2025 14:44:28 +0000 Subject: [PATCH] Regenerate client from commit 872cf6d of spec repo --- .generated-info | 4 +- .generator/schemas/v1/openapi.yaml | 12 +++++ features/v1/logs_indexes.feature | 7 +++ .../apis/LogsIndexesApi.ts | 24 +++++++++ packages/datadog-api-client-v1/index.ts | 1 + .../models/LogsAPILimitReachedResponse.ts | 53 +++++++++++++++++++ .../models/ObjectSerializer.ts | 2 + 7 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 packages/datadog-api-client-v1/models/LogsAPILimitReachedResponse.ts diff --git a/.generated-info b/.generated-info index 0f8f0b40ff58..553a50c6289b 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "d02c8a3", - "generated": "2025-08-08 12:08:19.964" + "spec_repo_commit": "872cf6d", + "generated": "2025-08-12 14:44:28.112" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f6e0e21ed71a..dacd4a02b1d9 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -5123,6 +5123,12 @@ components: error: $ref: '#/components/schemas/LogsAPIError' type: object + LogsAPILimitReachedResponse: + description: Response returned by the Logs API when the max limit has been reached. + properties: + error: + $ref: '#/components/schemas/LogsAPIError' + type: object LogsArithmeticProcessor: description: "Use the Arithmetic Processor to add a new attribute (without spaces or special characters\nin the new attribute name) to a log with the result @@ -29444,6 +29450,12 @@ paths: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + '422': + content: + application/json: + schema: + $ref: '#/components/schemas/LogsAPILimitReachedResponse' + description: Unprocessable Entity '429': $ref: '#/components/responses/TooManyRequestsResponse' summary: Create an index diff --git a/features/v1/logs_indexes.feature b/features/v1/logs_indexes.feature index 635c2399c5bf..e94fea2c62f4 100644 --- a/features/v1/logs_indexes.feature +++ b/features/v1/logs_indexes.feature @@ -22,6 +22,13 @@ Feature: Logs Indexes When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core + Scenario: Create an index returns "Unprocessable Entity" response + Given new "CreateLogsIndex" request + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Delete an index returns "Not Found" response Given new "DeleteLogsIndex" request diff --git a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts index 0eeae3cc244a..e52f0ddbe0e6 100644 --- a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts @@ -18,6 +18,7 @@ import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { LogsAPIErrorResponse } from "../models/LogsAPIErrorResponse"; +import { LogsAPILimitReachedResponse } from "../models/LogsAPILimitReachedResponse"; import { LogsIndex } from "../models/LogsIndex"; import { LogsIndexesOrder } from "../models/LogsIndexesOrder"; import { LogsIndexListResponse } from "../models/LogsIndexListResponse"; @@ -333,6 +334,29 @@ export class LogsIndexesApiResponseProcessor { } throw new ApiException(response.httpStatusCode, body); } + if (response.httpStatusCode === 422) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: LogsAPILimitReachedResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "LogsAPILimitReachedResponse" + ) as LogsAPILimitReachedResponse; + } 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) { diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index f0010f02ea4d..eb2e492d6d75 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -548,6 +548,7 @@ export { LogQueryDefinitionGroupBySort } from "./models/LogQueryDefinitionGroupB export { LogQueryDefinitionSearch } from "./models/LogQueryDefinitionSearch"; export { LogsAPIError } from "./models/LogsAPIError"; export { LogsAPIErrorResponse } from "./models/LogsAPIErrorResponse"; +export { LogsAPILimitReachedResponse } from "./models/LogsAPILimitReachedResponse"; export { LogsArithmeticProcessor } from "./models/LogsArithmeticProcessor"; export { LogsArithmeticProcessorType } from "./models/LogsArithmeticProcessorType"; export { LogsArrayProcessor } from "./models/LogsArrayProcessor"; diff --git a/packages/datadog-api-client-v1/models/LogsAPILimitReachedResponse.ts b/packages/datadog-api-client-v1/models/LogsAPILimitReachedResponse.ts new file mode 100644 index 000000000000..2ec66c7d0000 --- /dev/null +++ b/packages/datadog-api-client-v1/models/LogsAPILimitReachedResponse.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 { LogsAPIError } from "./LogsAPIError"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response returned by the Logs API when the max limit has been reached. + */ +export class LogsAPILimitReachedResponse { + /** + * Error returned by the Logs API + */ + "error"?: LogsAPIError; + + /** + * 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 = { + error: { + baseName: "error", + type: "LogsAPIError", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "any", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return LogsAPILimitReachedResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index cbdc6a39441f..7176436b6eb2 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -153,6 +153,7 @@ import { LogQueryDefinitionSearch } from "./LogQueryDefinitionSearch"; import { LogStreamWidgetDefinition } from "./LogStreamWidgetDefinition"; import { LogsAPIError } from "./LogsAPIError"; import { LogsAPIErrorResponse } from "./LogsAPIErrorResponse"; +import { LogsAPILimitReachedResponse } from "./LogsAPILimitReachedResponse"; import { LogsArithmeticProcessor } from "./LogsArithmeticProcessor"; import { LogsArrayProcessor } from "./LogsArrayProcessor"; import { LogsArrayProcessorOperationAppend } from "./LogsArrayProcessorOperationAppend"; @@ -1870,6 +1871,7 @@ const typeMap: { [index: string]: any } = { LogStreamWidgetDefinition: LogStreamWidgetDefinition, LogsAPIError: LogsAPIError, LogsAPIErrorResponse: LogsAPIErrorResponse, + LogsAPILimitReachedResponse: LogsAPILimitReachedResponse, LogsArithmeticProcessor: LogsArithmeticProcessor, LogsArrayProcessor: LogsArrayProcessor, LogsArrayProcessorOperationAppend: LogsArrayProcessorOperationAppend,