diff --git a/.generated-info b/.generated-info index ea5e89e8c103..de1a0f4e8c20 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "205813d", - "generated": "2025-08-25 08:41:30.486" + "spec_repo_commit": "c3b2b7d", + "generated": "2025-08-25 10:18:04.330" } 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/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 9ec3071709b5..7d7d1985f89c 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -225,6 +225,7 @@ def overrides "v1.log_query_definition_search" => "LogQueryDefinitionSearch", "v1.logs_api_error" => "LogsAPIError", "v1.logs_api_error_response" => "LogsAPIErrorResponse", + "v1.logs_api_limit_reached_response" => "LogsAPILimitReachedResponse", "v1.logs_arithmetic_processor" => "LogsArithmeticProcessor", "v1.logs_arithmetic_processor_type" => "LogsArithmeticProcessorType", "v1.logs_array_processor" => "LogsArrayProcessor", diff --git a/lib/datadog_api_client/v1/models/logs_api_limit_reached_response.rb b/lib/datadog_api_client/v1/models/logs_api_limit_reached_response.rb new file mode 100644 index 000000000000..c8e3e29a88f0 --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_api_limit_reached_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Response returned by the Logs API when the max limit has been reached. + class LogsAPILimitReachedResponse + include BaseGenericModel + + # Error returned by the Logs API + attr_accessor :error + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error' => :'error' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error' => :'LogsAPIError' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::LogsAPILimitReachedResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error') + self.error = attributes[:'error'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error == o.error && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error, additional_properties].hash + end + end +end