From b3f3d26a2121b9c5dd7db276007d6e36481a027e Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 25 Aug 2025 10:19:35 +0000 Subject: [PATCH] Regenerate client from commit c3b2b7d of spec repo --- .generated-info | 4 +- .generator/schemas/v1/openapi.yaml | 12 ++ .../api/client/v1/api/LogsIndexesApi.java | 1 + .../v1/model/LogsAPILimitReachedResponse.java | 137 ++++++++++++++++++ .../api/client/v1/api/logs_indexes.feature | 7 + 5 files changed, 159 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v1/model/LogsAPILimitReachedResponse.java diff --git a/.generated-info b/.generated-info index bcc14741a70..a24a40546a1 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "205813d", - "generated": "2025-08-25 08:43:17.545" + "spec_repo_commit": "c3b2b7d", + "generated": "2025-08-25 10:19:34.863" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f6e0e21ed71..dacd4a02b1d 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/src/main/java/com/datadog/api/client/v1/api/LogsIndexesApi.java b/src/main/java/com/datadog/api/client/v1/api/LogsIndexesApi.java index abe6851a804..5e940698407 100644 --- a/src/main/java/com/datadog/api/client/v1/api/LogsIndexesApi.java +++ b/src/main/java/com/datadog/api/client/v1/api/LogsIndexesApi.java @@ -89,6 +89,7 @@ public CompletableFuture createLogsIndexAsync(LogsIndex body) { * 200 OK - * 400 Invalid Parameter Error - * 403 Forbidden - + * 422 Unprocessable Entity - * 429 Too many requests - * */ diff --git a/src/main/java/com/datadog/api/client/v1/model/LogsAPILimitReachedResponse.java b/src/main/java/com/datadog/api/client/v1/model/LogsAPILimitReachedResponse.java new file mode 100644 index 00000000000..8f7e7686e74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/LogsAPILimitReachedResponse.java @@ -0,0 +1,137 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response returned by the Logs API when the max limit has been reached. */ +@JsonPropertyOrder({LogsAPILimitReachedResponse.JSON_PROPERTY_ERROR}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class LogsAPILimitReachedResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR = "error"; + private LogsAPIError error; + + public LogsAPILimitReachedResponse error(LogsAPIError error) { + this.error = error; + this.unparsed |= error.unparsed; + return this; + } + + /** + * Error returned by the Logs API + * + * @return error + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LogsAPIError getError() { + return error; + } + + public void setError(LogsAPIError error) { + this.error = error; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return LogsAPILimitReachedResponse + */ + @JsonAnySetter + public LogsAPILimitReachedResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this LogsAPILimitReachedResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsAPILimitReachedResponse logsApiLimitReachedResponse = (LogsAPILimitReachedResponse) o; + return Objects.equals(this.error, logsApiLimitReachedResponse.error) + && Objects.equals( + this.additionalProperties, logsApiLimitReachedResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(error, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsAPILimitReachedResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature b/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature index 635c2399c5b..e94fea2c62f 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/logs_indexes.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/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