Skip to content

Commit 51565c7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 872cf6d of spec repo
1 parent b72cf1d commit 51565c7

File tree

7 files changed

+101
-2
lines changed

7 files changed

+101
-2
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "d02c8a3",
3-
"generated": "2025-08-08 12:08:19.964"
2+
"spec_repo_commit": "872cf6d",
3+
"generated": "2025-08-12 14:34:44.080"
44
}

.generator/schemas/v1/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5123,6 +5123,12 @@ components:
51235123
error:
51245124
$ref: '#/components/schemas/LogsAPIError'
51255125
type: object
5126+
LogsAPILimitReachedResponse:
5127+
description: Response returned by the Logs API when the max limit has been reached.
5128+
properties:
5129+
error:
5130+
$ref: '#/components/schemas/LogsAPIError'
5131+
type: object
51265132
LogsArithmeticProcessor:
51275133
description: "Use the Arithmetic Processor to add a new attribute (without spaces
51285134
or special characters\nin the new attribute name) to a log with the result
@@ -29444,6 +29450,12 @@ paths:
2944429450
schema:
2944529451
$ref: '#/components/schemas/APIErrorResponse'
2944629452
description: Forbidden
29453+
'422':
29454+
content:
29455+
application/json:
29456+
schema:
29457+
$ref: '#/components/schemas/LogsAPILimitReachedResponse'
29458+
description: Unprocessable Entity
2944729459
'429':
2944829460
$ref: '#/components/responses/TooManyRequestsResponse'
2944929461
summary: Create an index

features/v1/logs_indexes.feature

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ Feature: Logs Indexes
2222
When the request is sent
2323
Then the response status is 200 OK
2424

25+
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
26+
Scenario: Create an index returns "Unprocessable Entity" response
27+
Given new "CreateLogsIndex" request
28+
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}
29+
When the request is sent
30+
Then the response status is 422 Unprocessable Entity
31+
2532
@generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core
2633
Scenario: Delete an index returns "Not Found" response
2734
Given new "DeleteLogsIndex" request

packages/datadog-api-client-v1/apis/LogsIndexesApi.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ApiException } from "../../datadog-api-client-common/exception";
1818

1919
import { APIErrorResponse } from "../models/APIErrorResponse";
2020
import { LogsAPIErrorResponse } from "../models/LogsAPIErrorResponse";
21+
import { LogsAPILimitReachedResponse } from "../models/LogsAPILimitReachedResponse";
2122
import { LogsIndex } from "../models/LogsIndex";
2223
import { LogsIndexesOrder } from "../models/LogsIndexesOrder";
2324
import { LogsIndexListResponse } from "../models/LogsIndexListResponse";
@@ -333,6 +334,29 @@ export class LogsIndexesApiResponseProcessor {
333334
}
334335
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
335336
}
337+
if (response.httpStatusCode === 422) {
338+
const bodyText = ObjectSerializer.parse(
339+
await response.body.text(),
340+
contentType
341+
);
342+
let body: LogsAPILimitReachedResponse;
343+
try {
344+
body = ObjectSerializer.deserialize(
345+
bodyText,
346+
"LogsAPILimitReachedResponse"
347+
) as LogsAPILimitReachedResponse;
348+
} catch (error) {
349+
logger.debug(`Got error deserializing error: ${error}`);
350+
throw new ApiException<LogsAPILimitReachedResponse>(
351+
response.httpStatusCode,
352+
bodyText
353+
);
354+
}
355+
throw new ApiException<LogsAPILimitReachedResponse>(
356+
response.httpStatusCode,
357+
body
358+
);
359+
}
336360

337361
// Work around for missing responses in specification, e.g. for petstore.yaml
338362
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ export { LogQueryDefinitionGroupBySort } from "./models/LogQueryDefinitionGroupB
548548
export { LogQueryDefinitionSearch } from "./models/LogQueryDefinitionSearch";
549549
export { LogsAPIError } from "./models/LogsAPIError";
550550
export { LogsAPIErrorResponse } from "./models/LogsAPIErrorResponse";
551+
export { LogsAPILimitReachedResponse } from "./models/LogsAPILimitReachedResponse";
551552
export { LogsArithmeticProcessor } from "./models/LogsArithmeticProcessor";
552553
export { LogsArithmeticProcessorType } from "./models/LogsArithmeticProcessorType";
553554
export { LogsArrayProcessor } from "./models/LogsArrayProcessor";
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
import { LogsAPIError } from "./LogsAPIError";
7+
8+
import { AttributeTypeMap } from "../../datadog-api-client-common/util";
9+
10+
/**
11+
* Response returned by the Logs API when the max limit has been reached.
12+
*/
13+
export class LogsAPILimitReachedResponse {
14+
/**
15+
* Error returned by the Logs API
16+
*/
17+
"error"?: LogsAPIError;
18+
19+
/**
20+
* A container for additional, undeclared properties.
21+
* This is a holder for any undeclared properties as specified with
22+
* the 'additionalProperties' keyword in the OAS document.
23+
*/
24+
"additionalProperties"?: { [key: string]: any };
25+
26+
/**
27+
* @ignore
28+
*/
29+
"_unparsed"?: boolean;
30+
31+
/**
32+
* @ignore
33+
*/
34+
static readonly attributeTypeMap: AttributeTypeMap = {
35+
error: {
36+
baseName: "error",
37+
type: "LogsAPIError",
38+
},
39+
additionalProperties: {
40+
baseName: "additionalProperties",
41+
type: "any",
42+
},
43+
};
44+
45+
/**
46+
* @ignore
47+
*/
48+
static getAttributeTypeMap(): AttributeTypeMap {
49+
return LogsAPILimitReachedResponse.attributeTypeMap;
50+
}
51+
52+
public constructor() {}
53+
}

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ import { LogQueryDefinitionSearch } from "./LogQueryDefinitionSearch";
153153
import { LogStreamWidgetDefinition } from "./LogStreamWidgetDefinition";
154154
import { LogsAPIError } from "./LogsAPIError";
155155
import { LogsAPIErrorResponse } from "./LogsAPIErrorResponse";
156+
import { LogsAPILimitReachedResponse } from "./LogsAPILimitReachedResponse";
156157
import { LogsArithmeticProcessor } from "./LogsArithmeticProcessor";
157158
import { LogsArrayProcessor } from "./LogsArrayProcessor";
158159
import { LogsArrayProcessorOperationAppend } from "./LogsArrayProcessorOperationAppend";
@@ -1870,6 +1871,7 @@ const typeMap: { [index: string]: any } = {
18701871
LogStreamWidgetDefinition: LogStreamWidgetDefinition,
18711872
LogsAPIError: LogsAPIError,
18721873
LogsAPIErrorResponse: LogsAPIErrorResponse,
1874+
LogsAPILimitReachedResponse: LogsAPILimitReachedResponse,
18731875
LogsArithmeticProcessor: LogsArithmeticProcessor,
18741876
LogsArrayProcessor: LogsArrayProcessor,
18751877
LogsArrayProcessorOperationAppend: LogsArrayProcessorOperationAppend,

0 commit comments

Comments
 (0)