Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "98e3371",
"generated": "2025-08-27 08:45:02.412"
"spec_repo_commit": "fb522ba",
"generated": "2025-08-27 10:19:22.119"
}
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10662,6 +10662,12 @@ components:
CreateDataDeletionRequestBodyAttributes:
description: Attributes for creating a data deletion request.
properties:
displayed_total:
description: The total number of elements to be deleted that the UI shows
to the user.
example: 25000
format: int64
type: integer
from:
description: Start of requested time window, milliseconds since Unix epoch.
example: 1672527600000
Expand Down Expand Up @@ -10694,6 +10700,7 @@ components:
- query
- from
- to
- displayed_total
type: object
CreateDataDeletionRequestBodyData:
description: Data needed to create a data deletion request.
Expand Down Expand Up @@ -12947,6 +12954,11 @@ components:
example: 1704063600000
format: int64
type: integer
total_displayed:
description: Total number of elements to be deleted according to the UI.
example: 100
format: int64
type: integer
total_unrestricted:
description: Total number of elements to be deleted. Only the data accessible
to the current user that matches the query and timeframe provided will
Expand All @@ -12969,6 +12981,7 @@ components:
- starting_at
- status
- to_time
- total_displayed
- total_unrestricted
- updated_at
type: object
Expand Down
1 change: 1 addition & 0 deletions examples/v2/data-deletion/CreateDataDeletionRequest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions features/v2/data_deletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion features/v2/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 \"from\": 1672527600000,\n \"to\": 1704063600000,\n \"indexes\": [\"test-index\", \"test-index-2\"],\n \"query\": {\"host\": \"abc\", \"service\": \"xyz\"},\n \"displayed_total\": 25000\n },\n \"type\": \"create_deletion_req\"\n }\n}"
}
],
"step": "there is a valid \"deletion_request\" in the system",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module DatadogAPIClient::V2
class CreateDataDeletionRequestBodyAttributes
include BaseGenericModel

# The total number of elements to be deleted that the UI shows to the user.
attr_reader :displayed_total

# Start of requested time window, milliseconds since Unix epoch.
attr_reader :from

Expand All @@ -39,6 +42,7 @@ class CreateDataDeletionRequestBodyAttributes
# @!visibility private
def self.attribute_map
{
:'displayed_total' => :'displayed_total',
:'from' => :'from',
:'indexes' => :'indexes',
:'query' => :'query',
Expand All @@ -50,6 +54,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'displayed_total' => :'Integer',
:'from' => :'Integer',
:'indexes' => :'Array<String>',
:'query' => :'Hash<String, String>',
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 &&
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class DataDeletionResponseItemAttributes
# End of requested time window, milliseconds since Unix epoch.
attr_reader :to_time

# Total number of elements to be deleted according to the UI.
attr_reader :total_displayed

# Total number of elements to be deleted. Only the data accessible to the current user that matches the query and timeframe provided will be deleted.
attr_reader :total_unrestricted

Expand All @@ -77,6 +80,7 @@ def self.attribute_map
:'starting_at' => :'starting_at',
:'status' => :'status',
:'to_time' => :'to_time',
:'total_displayed' => :'total_displayed',
:'total_unrestricted' => :'total_unrestricted',
:'updated_at' => :'updated_at'
}
Expand All @@ -97,6 +101,7 @@ def self.openapi_types
:'starting_at' => :'String',
:'status' => :'String',
:'to_time' => :'Integer',
:'total_displayed' => :'Integer',
:'total_unrestricted' => :'Integer',
:'updated_at' => :'String'
}
Expand Down Expand Up @@ -166,6 +171,10 @@ def initialize(attributes = {})
self.to_time = attributes[:'to_time']
end

if attributes.key?(:'total_displayed')
self.total_displayed = attributes[:'total_displayed']
end

if attributes.key?(:'total_unrestricted')
self.total_unrestricted = attributes[:'total_unrestricted']
end
Expand All @@ -189,6 +198,7 @@ def valid?
return false if @starting_at.nil?
return false if @status.nil?
return false if @to_time.nil?
return false if @total_displayed.nil?
return false if @total_unrestricted.nil?
return false if @updated_at.nil?
true
Expand Down Expand Up @@ -294,6 +304,16 @@ def to_time=(to_time)
@to_time = to_time
end

# Custom attribute writer method with validation
# @param total_displayed [Object] Object to be assigned
# @!visibility private
def total_displayed=(total_displayed)
if total_displayed.nil?
fail ArgumentError, 'invalid value for "total_displayed", total_displayed cannot be nil.'
end
@total_displayed = total_displayed
end

# Custom attribute writer method with validation
# @param total_unrestricted [Object] Object to be assigned
# @!visibility private
Expand Down Expand Up @@ -351,6 +371,7 @@ def ==(o)
starting_at == o.starting_at &&
status == o.status &&
to_time == o.to_time &&
total_displayed == o.total_displayed &&
total_unrestricted == o.total_unrestricted &&
updated_at == o.updated_at &&
additional_properties == o.additional_properties
Expand All @@ -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, from_time, indexes, is_created, org_id, product, query, starting_at, status, to_time, total_displayed, total_unrestricted, updated_at, additional_properties].hash
end
end
end
Loading