Skip to content

Commit a1a2029

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 872cf6d of spec repo
1 parent 57a3a4c commit a1a2029

File tree

7 files changed

+92
-2
lines changed

7 files changed

+92
-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:07:03.564"
2+
"spec_repo_commit": "872cf6d",
3+
"generated": "2025-08-12 14:43:04.188"
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

services/logs_indexes/src/v1/LogsIndexesApi.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
import { TypingInfo } from "./models/TypingInfo";
2525
import { APIErrorResponse } from "./models/APIErrorResponse";
2626
import { LogsAPIErrorResponse } from "./models/LogsAPIErrorResponse";
27+
import { LogsAPILimitReachedResponse } from "./models/LogsAPILimitReachedResponse";
2728
import { LogsIndex } from "./models/LogsIndex";
2829
import { LogsIndexesOrder } from "./models/LogsIndexesOrder";
2930
import { LogsIndexListResponse } from "./models/LogsIndexListResponse";
@@ -414,6 +415,27 @@ export class LogsIndexesApiResponseProcessor {
414415
}
415416
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
416417
}
418+
if (response.httpStatusCode === 422) {
419+
const bodyText = parse(await response.body.text(), contentType);
420+
let body: LogsAPILimitReachedResponse;
421+
try {
422+
body = deserialize(
423+
bodyText,
424+
TypingInfo,
425+
"LogsAPILimitReachedResponse",
426+
) as LogsAPILimitReachedResponse;
427+
} catch (error) {
428+
logger.debug(`Got error deserializing error: ${error}`);
429+
throw new ApiException<LogsAPILimitReachedResponse>(
430+
response.httpStatusCode,
431+
bodyText,
432+
);
433+
}
434+
throw new ApiException<LogsAPILimitReachedResponse>(
435+
response.httpStatusCode,
436+
body,
437+
);
438+
}
417439

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

services/logs_indexes/src/v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export {
1010
export { APIErrorResponse } from "./models/APIErrorResponse";
1111
export { LogsAPIError } from "./models/LogsAPIError";
1212
export { LogsAPIErrorResponse } from "./models/LogsAPIErrorResponse";
13+
export { LogsAPILimitReachedResponse } from "./models/LogsAPILimitReachedResponse";
1314
export { LogsDailyLimitReset } from "./models/LogsDailyLimitReset";
1415
export { LogsExclusion } from "./models/LogsExclusion";
1516
export { LogsExclusionFilter } from "./models/LogsExclusionFilter";
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { LogsAPIError } from "./LogsAPIError";
4+
5+
/**
6+
* Response returned by the Logs API when the max limit has been reached.
7+
*/
8+
export class LogsAPILimitReachedResponse {
9+
/**
10+
* Error returned by the Logs API
11+
*/
12+
"error"?: LogsAPIError;
13+
/**
14+
* A container for additional, undeclared properties.
15+
* This is a holder for any undeclared properties as specified with
16+
* the 'additionalProperties' keyword in the OAS document.
17+
*/
18+
"additionalProperties"?: { [key: string]: any };
19+
/**
20+
* @ignore
21+
*/
22+
"_unparsed"?: boolean;
23+
24+
/**
25+
* @ignore
26+
*/
27+
static readonly attributeTypeMap: AttributeTypeMap = {
28+
error: {
29+
baseName: "error",
30+
type: "LogsAPIError",
31+
},
32+
additionalProperties: {
33+
baseName: "additionalProperties",
34+
type: "{ [key: string]: any; }",
35+
},
36+
};
37+
38+
/**
39+
* @ignore
40+
*/
41+
static getAttributeTypeMap(): AttributeTypeMap {
42+
return LogsAPILimitReachedResponse.attributeTypeMap;
43+
}
44+
45+
public constructor() {}
46+
}

services/logs_indexes/src/v1/models/TypingInfo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client";
33
import { APIErrorResponse } from "./APIErrorResponse";
44
import { LogsAPIError } from "./LogsAPIError";
55
import { LogsAPIErrorResponse } from "./LogsAPIErrorResponse";
6+
import { LogsAPILimitReachedResponse } from "./LogsAPILimitReachedResponse";
67
import { LogsDailyLimitReset } from "./LogsDailyLimitReset";
78
import { LogsExclusion } from "./LogsExclusion";
89
import { LogsExclusionFilter } from "./LogsExclusionFilter";
@@ -19,6 +20,7 @@ export const TypingInfo: ModelTypingInfo = {
1920
APIErrorResponse: APIErrorResponse,
2021
LogsAPIError: LogsAPIError,
2122
LogsAPIErrorResponse: LogsAPIErrorResponse,
23+
LogsAPILimitReachedResponse: LogsAPILimitReachedResponse,
2224
LogsDailyLimitReset: LogsDailyLimitReset,
2325
LogsExclusion: LogsExclusion,
2426
LogsExclusionFilter: LogsExclusionFilter,

0 commit comments

Comments
 (0)