Skip to content

Commit abbdf9f

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 0d784b1 of spec repo
1 parent 686e823 commit abbdf9f

File tree

13 files changed

+365
-8
lines changed

13 files changed

+365
-8
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "04d09cb",
3-
"generated": "2025-07-23 09:22:24.045"
2+
"spec_repo_commit": "0d784b1",
3+
"generated": "2025-07-23 14:33:55.500"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12478,7 +12478,14 @@ components:
1247812478
- type
1247912479
type: object
1248012480
Dataset:
12481-
description: Dataset object.
12481+
description: "Dataset object.\n\n### Datasets Constraints\n- **Tag Limit per
12482+
Dataset**:\n - Each restricted dataset supports a maximum of 10 key:value
12483+
pairs per product.\n\n- **Tag Key Rules per Telemetry Type**:\n - Only one
12484+
tag key or attribute may be used to define access within a single telemetry
12485+
type.\n - The same or different tag key may be used across different telemetry
12486+
types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique within
12487+
a single dataset.\n - A tag value used in one dataset cannot be reused in
12488+
another dataset of the same telemetry type."
1248212489
properties:
1248312490
attributes:
1248412491
$ref: '#/components/schemas/DatasetAttributes'
@@ -12537,6 +12544,14 @@ components:
1253712544
required:
1253812545
- data
1253912546
type: object
12547+
DatasetEditRequest:
12548+
description: Edit request for a dataset.
12549+
properties:
12550+
data:
12551+
$ref: '#/components/schemas/Dataset'
12552+
required:
12553+
- data
12554+
type: object
1254012555
DatasetResponseMulti:
1254112556
description: Response containing a list of datasets.
1254212557
properties:
@@ -16083,10 +16098,9 @@ components:
1608316098
type: array
1608416099
product:
1608516100
description: 'Name of the product the dataset is for. Possible values are
16086-
''apm'', ''rum'', ''synthetics'',
16101+
''apm'', ''rum'',
1608716102

16088-
''metrics'', ''logs'', ''sd_repoinfo'', ''error_tracking'', ''cloud_cost'',
16089-
and ''ml_obs''.'
16103+
''metrics'', ''logs'', ''error_tracking'', and ''cloud_cost''.'
1609016104
example: logs
1609116105
type: string
1609216106
required:
@@ -48271,6 +48285,44 @@ paths:
4827148285
x-permission:
4827248286
operator: OPEN
4827348287
permissions: []
48288+
put:
48289+
description: Edits the dataset associated with the ID.
48290+
operationId: EditDataset
48291+
parameters:
48292+
- $ref: '#/components/parameters/DatasetID'
48293+
requestBody:
48294+
content:
48295+
application/json:
48296+
schema:
48297+
$ref: '#/components/schemas/DatasetEditRequest'
48298+
description: Dataset payload
48299+
required: true
48300+
responses:
48301+
'200':
48302+
content:
48303+
application/json:
48304+
schema:
48305+
$ref: '#/components/schemas/DatasetResponseSingle'
48306+
description: OK
48307+
'400':
48308+
$ref: '#/components/responses/BadRequestResponse'
48309+
'403':
48310+
$ref: '#/components/responses/NotAuthorizedResponse'
48311+
'404':
48312+
$ref: '#/components/responses/NotFoundResponse'
48313+
'429':
48314+
$ref: '#/components/responses/TooManyRequestsResponse'
48315+
security:
48316+
- apiKeyAuth: []
48317+
appKeyAuth: []
48318+
- AuthZ: []
48319+
summary: Edits a dataset
48320+
tags:
48321+
- Datasets
48322+
x-codegen-request-body-name: body
48323+
x-permission:
48324+
operator: OPEN
48325+
permissions: []
4827448326
/api/v2/deletion/data/{product}:
4827548327
post:
4827648328
description: Creates a data deletion request by providing a query and a timeframe
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Edits a dataset returns "OK" response
2+
3+
require "datadog_api_client"
4+
api_instance = DatadogAPIClient::V2::DatasetsAPI.new
5+
6+
body = DatadogAPIClient::V2::DatasetEditRequest.new({
7+
data: DatadogAPIClient::V2::Dataset.new({
8+
attributes: DatadogAPIClient::V2::DatasetAttributes.new({
9+
created_at: nil,
10+
name: "Security Audit Dataset",
11+
principals: [
12+
"role:86245fce-0a4e-11f0-92bd-da7ad0900002",
13+
],
14+
product_filters: [
15+
DatadogAPIClient::V2::FiltersPerProduct.new({
16+
filters: [
17+
"@application.id:ABCD",
18+
],
19+
product: "logs",
20+
}),
21+
],
22+
}),
23+
id: "123e4567-e89b-12d3-a456-426614174000",
24+
type: "dataset",
25+
}),
26+
})
27+
p api_instance.edit_dataset("dataset_id", body)

features/scenarios_model_mapping.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,10 @@
15981598
"v2.GetDataset" => {
15991599
"dataset_id" => "String",
16001600
},
1601+
"v2.EditDataset" => {
1602+
"dataset_id" => "String",
1603+
"body" => "DatasetEditRequest",
1604+
},
16011605
"v2.CreateDataDeletionRequest" => {
16021606
"product" => "String",
16031607
"body" => "CreateDataDeletionRequestBody",

features/v2/datasets.feature

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,30 @@ Feature: Datasets
5353
When the request is sent
5454
Then the response status is 404 Not Found
5555

56+
@generated @skip @team:DataDog/aaa-granular-access
57+
Scenario: Edits a dataset returns "Bad Request" response
58+
Given new "EditDataset" request
59+
And request contains "dataset_id" parameter from "REPLACE.ME"
60+
And body with value {"data": {"attributes": {"created_at": null, "name": "Security Audit Dataset", "principals": ["role:86245fce-0a4e-11f0-92bd-da7ad0900002"], "product_filters": [{"filters": ["@application.id:ABCD"], "product": "logs"}]}, "id": "123e4567-e89b-12d3-a456-426614174000", "type": "dataset"}}
61+
When the request is sent
62+
Then the response status is 400 Bad Request
63+
64+
@generated @skip @team:DataDog/aaa-granular-access
65+
Scenario: Edits a dataset returns "Not Found" response
66+
Given new "EditDataset" request
67+
And request contains "dataset_id" parameter from "REPLACE.ME"
68+
And body with value {"data": {"attributes": {"created_at": null, "name": "Security Audit Dataset", "principals": ["role:86245fce-0a4e-11f0-92bd-da7ad0900002"], "product_filters": [{"filters": ["@application.id:ABCD"], "product": "logs"}]}, "id": "123e4567-e89b-12d3-a456-426614174000", "type": "dataset"}}
69+
When the request is sent
70+
Then the response status is 404 Not Found
71+
72+
@generated @skip @team:DataDog/aaa-granular-access
73+
Scenario: Edits a dataset returns "OK" response
74+
Given new "EditDataset" request
75+
And request contains "dataset_id" parameter from "REPLACE.ME"
76+
And body with value {"data": {"attributes": {"created_at": null, "name": "Security Audit Dataset", "principals": ["role:86245fce-0a4e-11f0-92bd-da7ad0900002"], "product_filters": [{"filters": ["@application.id:ABCD"], "product": "logs"}]}, "id": "123e4567-e89b-12d3-a456-426614174000", "type": "dataset"}}
77+
When the request is sent
78+
Then the response status is 200 OK
79+
5680
@generated @skip @team:DataDog/aaa-granular-access
5781
Scenario: Get a single dataset by ID returns "Bad Request" response
5882
Given new "GetDataset" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,12 @@
888888
"type": "safe"
889889
}
890890
},
891+
"EditDataset": {
892+
"tag": "Datasets",
893+
"undo": {
894+
"type": "idempotent"
895+
}
896+
},
891897
"CreateDataDeletionRequest": {
892898
"tag": "Data Deletion",
893899
"undo": {

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,6 +1617,7 @@ def overrides
16171617
"v2.dataset" => "Dataset",
16181618
"v2.dataset_attributes" => "DatasetAttributes",
16191619
"v2.dataset_create_request" => "DatasetCreateRequest",
1620+
"v2.dataset_edit_request" => "DatasetEditRequest",
16201621
"v2.dataset_response_multi" => "DatasetResponseMulti",
16211622
"v2.dataset_response_single" => "DatasetResponseSingle",
16221623
"v2.data_transform" => "DataTransform",

lib/datadog_api_client/v2/api/datasets_api.rb

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,78 @@ def delete_dataset_with_http_info(dataset_id, opts = {})
155155
return data, status_code, headers
156156
end
157157

158+
# Edits a dataset.
159+
#
160+
# @see #edit_dataset_with_http_info
161+
def edit_dataset(dataset_id, body, opts = {})
162+
data, _status_code, _headers = edit_dataset_with_http_info(dataset_id, body, opts)
163+
data
164+
end
165+
166+
# Edits a dataset.
167+
#
168+
# Edits the dataset associated with the ID.
169+
#
170+
# @param dataset_id [String] The ID of a defined dataset.
171+
# @param body [DatasetEditRequest] Dataset payload
172+
# @param opts [Hash] the optional parameters
173+
# @return [Array<(DatasetResponseSingle, Integer, Hash)>] DatasetResponseSingle data, response status code and response headers
174+
def edit_dataset_with_http_info(dataset_id, body, opts = {})
175+
176+
if @api_client.config.debugging
177+
@api_client.config.logger.debug 'Calling API: DatasetsAPI.edit_dataset ...'
178+
end
179+
# verify the required parameter 'dataset_id' is set
180+
if @api_client.config.client_side_validation && dataset_id.nil?
181+
fail ArgumentError, "Missing the required parameter 'dataset_id' when calling DatasetsAPI.edit_dataset"
182+
end
183+
# verify the required parameter 'body' is set
184+
if @api_client.config.client_side_validation && body.nil?
185+
fail ArgumentError, "Missing the required parameter 'body' when calling DatasetsAPI.edit_dataset"
186+
end
187+
# resource path
188+
local_var_path = '/api/v2/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/'))
189+
190+
# query parameters
191+
query_params = opts[:query_params] || {}
192+
193+
# header parameters
194+
header_params = opts[:header_params] || {}
195+
# HTTP header 'Accept' (if needed)
196+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
197+
# HTTP header 'Content-Type'
198+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
199+
200+
# form parameters
201+
form_params = opts[:form_params] || {}
202+
203+
# http body (model)
204+
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
205+
206+
# return_type
207+
return_type = opts[:debug_return_type] || 'DatasetResponseSingle'
208+
209+
# auth_names
210+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
211+
212+
new_options = opts.merge(
213+
:operation => :edit_dataset,
214+
:header_params => header_params,
215+
:query_params => query_params,
216+
:form_params => form_params,
217+
:body => post_body,
218+
:auth_names => auth_names,
219+
:return_type => return_type,
220+
:api_version => "V2"
221+
)
222+
223+
data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options)
224+
if @api_client.config.debugging
225+
@api_client.config.logger.debug "API called: DatasetsAPI#edit_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
226+
end
227+
return data, status_code, headers
228+
end
229+
158230
# Get all datasets.
159231
#
160232
# @see #get_all_datasets_with_http_info

lib/datadog_api_client/v2/models/dataset.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@
1818

1919
module DatadogAPIClient::V2
2020
# Dataset object.
21+
#
22+
# ### Datasets Constraints
23+
# - **Tag Limit per Dataset**:
24+
# - Each restricted dataset supports a maximum of 10 key:value pairs per product.
25+
#
26+
# - **Tag Key Rules per Telemetry Type**:
27+
# - Only one tag key or attribute may be used to define access within a single telemetry type.
28+
# - The same or different tag key may be used across different telemetry types.
29+
#
30+
# - **Tag Value Uniqueness**:
31+
# - Tag values must be unique within a single dataset.
32+
# - A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
2133
class Dataset
2234
include BaseGenericModel
2335

lib/datadog_api_client/v2/models/dataset_create_request.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ class DatasetCreateRequest
2222
include BaseGenericModel
2323

2424
# Dataset object.
25+
#
26+
# ### Datasets Constraints
27+
# - **Tag Limit per Dataset**:
28+
# - Each restricted dataset supports a maximum of 10 key:value pairs per product.
29+
#
30+
# - **Tag Key Rules per Telemetry Type**:
31+
# - Only one tag key or attribute may be used to define access within a single telemetry type.
32+
# - The same or different tag key may be used across different telemetry types.
33+
#
34+
# - **Tag Value Uniqueness**:
35+
# - Tag values must be unique within a single dataset.
36+
# - A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
2537
attr_reader :data
2638

2739
attr_accessor :additional_properties

0 commit comments

Comments
 (0)