Skip to content
Open
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": "2011bb0",
"generated": "2025-08-27 13:49:33.827"
}
12 changes: 12 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -10694,6 +10699,7 @@ components:
- query
- from
- to
- displayed_total
type: object
CreateDataDeletionRequestBodyData:
description: Data needed to create a data deletion request.
Expand Down Expand Up @@ -12900,6 +12906,11 @@ components:
description: User who created the deletion request.
example: [email protected]
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
Expand Down Expand Up @@ -12961,6 +12972,7 @@ components:
required:
- created_at
- created_by
- displayed_total
- from_time
- is_created
- org_id
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 \"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",
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

# 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

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 @@ -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

Expand Down Expand Up @@ -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',
Expand All @@ -88,6 +92,7 @@ def self.openapi_types
{
:'created_at' => :'String',
:'created_by' => :'String',
:'displayed_total' => :'Integer',
:'from_time' => :'Integer',
:'indexes' => :'Array<String>',
:'is_created' => :'Boolean',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 &&
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, 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
Loading