diff --git a/.generated-info b/.generated-info index 54f289296114..cb600391ab53 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "98e3371", - "generated": "2025-08-27 08:45:02.412" + "spec_repo_commit": "2011bb0", + "generated": "2025-08-27 13:49:33.827" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 7d9ee66a1278..c1ff03f18c44 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10662,6 +10662,11 @@ components: CreateDataDeletionRequestBodyAttributes: description: Attributes for creating a data deletion request. properties: + displayed_total: + description: Total number of elements to be deleted according to the UI. + example: 25000 + format: int64 + type: integer from: description: Start of requested time window, milliseconds since Unix epoch. example: 1672527600000 @@ -10694,6 +10699,7 @@ components: - query - from - to + - displayed_total type: object CreateDataDeletionRequestBodyData: description: Data needed to create a data deletion request. @@ -12900,6 +12906,11 @@ components: description: User who created the deletion request. example: test.user@datadoghq.com type: string + displayed_total: + description: Total number of elements to be deleted according to the UI. + example: 25000 + format: int64 + type: integer from_time: description: Start of requested time window, milliseconds since Unix epoch. example: 1672527600000 @@ -12961,6 +12972,7 @@ components: required: - created_at - created_by + - displayed_total - from_time - is_created - org_id diff --git a/examples/v2/data-deletion/CreateDataDeletionRequest.rb b/examples/v2/data-deletion/CreateDataDeletionRequest.rb index 406f64ff1655..3d2f44fc34c6 100644 --- a/examples/v2/data-deletion/CreateDataDeletionRequest.rb +++ b/examples/v2/data-deletion/CreateDataDeletionRequest.rb @@ -9,6 +9,7 @@ body = DatadogAPIClient::V2::CreateDataDeletionRequestBody.new({ data: DatadogAPIClient::V2::CreateDataDeletionRequestBodyData.new({ attributes: DatadogAPIClient::V2::CreateDataDeletionRequestBodyAttributes.new({ + displayed_total: 25000, from: 1672527600000, indexes: [ "test-index", diff --git a/features/v2/data_deletion.feature b/features/v2/data_deletion.feature index 6bfc942e2a72..5543872e9f8e 100644 --- a/features/v2/data_deletion.feature +++ b/features/v2/data_deletion.feature @@ -43,7 +43,7 @@ Feature: Data Deletion Given operation "CreateDataDeletionRequest" enabled And new "CreateDataDeletionRequest" request And request contains "product" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}} + And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}} When the request is sent Then the response status is 400 Bad Request @@ -52,7 +52,7 @@ Feature: Data Deletion Given operation "CreateDataDeletionRequest" enabled And new "CreateDataDeletionRequest" request And request contains "product" parameter with value "logs" - And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}} + And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}, "type": "create_deletion_req"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "deletion_request" @@ -64,7 +64,7 @@ Feature: Data Deletion Given operation "CreateDataDeletionRequest" enabled And new "CreateDataDeletionRequest" request And request contains "product" parameter with value "logs" - And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}, "type": "create_deletion_req"}} + And body with value {"data": {"attributes": {"displayed_total": 25000, "from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}, "type": "create_deletion_req"}} When the request is sent Then the response status is 412 Precondition failed error diff --git a/features/v2/given.json b/features/v2/given.json index b6097093658a..feb0664d09bc 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -197,7 +197,7 @@ }, { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"test-index\", \"test-index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"}\n },\n \"type\": \"create_deletion_req\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"displayed_total\": 25000,\n \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"test-index\", \"test-index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"}\n },\n \"type\": \"create_deletion_req\"\n }\n}" } ], "step": "there is a valid \"deletion_request\" in the system", diff --git a/lib/datadog_api_client/v2/models/create_data_deletion_request_body_attributes.rb b/lib/datadog_api_client/v2/models/create_data_deletion_request_body_attributes.rb index d66738559fea..58f9c36dc216 100644 --- a/lib/datadog_api_client/v2/models/create_data_deletion_request_body_attributes.rb +++ b/lib/datadog_api_client/v2/models/create_data_deletion_request_body_attributes.rb @@ -21,6 +21,9 @@ module DatadogAPIClient::V2 class CreateDataDeletionRequestBodyAttributes include BaseGenericModel + # Total number of elements to be deleted according to the UI. + attr_reader :displayed_total + # Start of requested time window, milliseconds since Unix epoch. attr_reader :from @@ -39,6 +42,7 @@ class CreateDataDeletionRequestBodyAttributes # @!visibility private def self.attribute_map { + :'displayed_total' => :'displayed_total', :'from' => :'from', :'indexes' => :'indexes', :'query' => :'query', @@ -50,6 +54,7 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'displayed_total' => :'Integer', :'from' => :'Integer', :'indexes' => :'Array', :'query' => :'Hash', @@ -75,6 +80,10 @@ def initialize(attributes = {}) end } + if attributes.key?(:'displayed_total') + self.displayed_total = attributes[:'displayed_total'] + end + if attributes.key?(:'from') self.from = attributes[:'from'] end @@ -98,12 +107,23 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @displayed_total.nil? return false if @from.nil? return false if @query.nil? return false if @to.nil? true end + # Custom attribute writer method with validation + # @param displayed_total [Object] Object to be assigned + # @!visibility private + def displayed_total=(displayed_total) + if displayed_total.nil? + fail ArgumentError, 'invalid value for "displayed_total", displayed_total cannot be nil.' + end + @displayed_total = displayed_total + end + # Custom attribute writer method with validation # @param from [Object] Object to be assigned # @!visibility private @@ -160,6 +180,7 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + displayed_total == o.displayed_total && from == o.from && indexes == o.indexes && query == o.query && @@ -171,7 +192,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [from, indexes, query, to, additional_properties].hash + [displayed_total, from, indexes, query, to, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/data_deletion_response_item_attributes.rb b/lib/datadog_api_client/v2/models/data_deletion_response_item_attributes.rb index 475b1183400b..a596a9a72920 100644 --- a/lib/datadog_api_client/v2/models/data_deletion_response_item_attributes.rb +++ b/lib/datadog_api_client/v2/models/data_deletion_response_item_attributes.rb @@ -27,6 +27,9 @@ class DataDeletionResponseItemAttributes # User who created the deletion request. attr_reader :created_by + # Total number of elements to be deleted according to the UI. + attr_reader :displayed_total + # Start of requested time window, milliseconds since Unix epoch. attr_reader :from_time @@ -68,6 +71,7 @@ def self.attribute_map { :'created_at' => :'created_at', :'created_by' => :'created_by', + :'displayed_total' => :'displayed_total', :'from_time' => :'from_time', :'indexes' => :'indexes', :'is_created' => :'is_created', @@ -88,6 +92,7 @@ def self.openapi_types { :'created_at' => :'String', :'created_by' => :'String', + :'displayed_total' => :'Integer', :'from_time' => :'Integer', :'indexes' => :'Array', :'is_created' => :'Boolean', @@ -128,6 +133,10 @@ def initialize(attributes = {}) self.created_by = attributes[:'created_by'] end + if attributes.key?(:'displayed_total') + self.displayed_total = attributes[:'displayed_total'] + end + if attributes.key?(:'from_time') self.from_time = attributes[:'from_time'] end @@ -181,6 +190,7 @@ def initialize(attributes = {}) def valid? return false if @created_at.nil? return false if @created_by.nil? + return false if @displayed_total.nil? return false if @from_time.nil? return false if @is_created.nil? return false if @org_id.nil? @@ -214,6 +224,16 @@ def created_by=(created_by) @created_by = created_by end + # Custom attribute writer method with validation + # @param displayed_total [Object] Object to be assigned + # @!visibility private + def displayed_total=(displayed_total) + if displayed_total.nil? + fail ArgumentError, 'invalid value for "displayed_total", displayed_total cannot be nil.' + end + @displayed_total = displayed_total + end + # Custom attribute writer method with validation # @param from_time [Object] Object to be assigned # @!visibility private @@ -342,6 +362,7 @@ def ==(o) self.class == o.class && created_at == o.created_at && created_by == o.created_by && + displayed_total == o.displayed_total && from_time == o.from_time && indexes == o.indexes && is_created == o.is_created && @@ -360,7 +381,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, created_by, from_time, indexes, is_created, org_id, product, query, starting_at, status, to_time, total_unrestricted, updated_at, additional_properties].hash + [created_at, created_by, displayed_total, from_time, indexes, is_created, org_id, product, query, starting_at, status, to_time, total_unrestricted, updated_at, additional_properties].hash end end end