Skip to content

Commit c812a92

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 640fe5f of spec repo
1 parent 937f69b commit c812a92

File tree

10 files changed

+513
-4
lines changed

10 files changed

+513
-4
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:23:45.770"
2+
"spec_repo_commit": "640fe5f",
3+
"generated": "2025-07-23 14:19:20.043"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 54 additions & 1 deletion
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 within each dataset.\n\n- **Tag Key Rules per Telemetry Type**:\n -
12484+
Only one tag key or attribute may be used to define access within a single
12485+
telemetry type.\n - The same or different tag key may be used across different
12486+
telemetry types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique
12487+
within a single dataset.\n - A tag value used in one dataset cannot be reused
12488+
in 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:
@@ -48271,6 +48286,44 @@ paths:
4827148286
x-permission:
4827248287
operator: OPEN
4827348288
permissions: []
48289+
put:
48290+
description: Edits the dataset associated with the ID.
48291+
operationId: EditDataset
48292+
parameters:
48293+
- $ref: '#/components/parameters/DatasetID'
48294+
requestBody:
48295+
content:
48296+
application/json:
48297+
schema:
48298+
$ref: '#/components/schemas/DatasetEditRequest'
48299+
description: Dataset payload
48300+
required: true
48301+
responses:
48302+
'200':
48303+
content:
48304+
application/json:
48305+
schema:
48306+
$ref: '#/components/schemas/DatasetResponseSingle'
48307+
description: OK
48308+
'400':
48309+
$ref: '#/components/responses/BadRequestResponse'
48310+
'403':
48311+
$ref: '#/components/responses/NotAuthorizedResponse'
48312+
'404':
48313+
$ref: '#/components/responses/NotFoundResponse'
48314+
'429':
48315+
$ref: '#/components/responses/TooManyRequestsResponse'
48316+
security:
48317+
- apiKeyAuth: []
48318+
appKeyAuth: []
48319+
- AuthZ: []
48320+
summary: Edits a dataset
48321+
tags:
48322+
- Datasets
48323+
x-codegen-request-body-name: body
48324+
x-permission:
48325+
operator: OPEN
48326+
permissions: []
4827448327
/api/v2/deletion/data/{product}:
4827548328
post:
4827648329
description: Creates a data deletion request by providing a query and a timeframe
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Edits a dataset returns "OK" response
2+
3+
import com.datadog.api.client.ApiClient;
4+
import com.datadog.api.client.ApiException;
5+
import com.datadog.api.client.v2.api.DatasetsApi;
6+
import com.datadog.api.client.v2.model.Dataset;
7+
import com.datadog.api.client.v2.model.DatasetAttributes;
8+
import com.datadog.api.client.v2.model.DatasetEditRequest;
9+
import com.datadog.api.client.v2.model.DatasetResponseSingle;
10+
import com.datadog.api.client.v2.model.FiltersPerProduct;
11+
import java.util.Collections;
12+
13+
public class Example {
14+
public static void main(String[] args) {
15+
ApiClient defaultClient = ApiClient.getDefaultApiClient();
16+
DatasetsApi apiInstance = new DatasetsApi(defaultClient);
17+
18+
DatasetEditRequest body =
19+
new DatasetEditRequest()
20+
.data(
21+
new Dataset()
22+
.attributes(
23+
new DatasetAttributes()
24+
.createdAt(null)
25+
.name("Security Audit Dataset")
26+
.principals(
27+
Collections.singletonList(
28+
"role:86245fce-0a4e-11f0-92bd-da7ad0900002"))
29+
.productFilters(
30+
Collections.singletonList(
31+
new FiltersPerProduct()
32+
.filters(Collections.singletonList("@application.id:ABCD"))
33+
.product("logs"))))
34+
.id("123e4567-e89b-12d3-a456-426614174000")
35+
.type("dataset"));
36+
37+
try {
38+
DatasetResponseSingle result = apiInstance.editDataset("dataset_id", body);
39+
System.out.println(result);
40+
} catch (ApiException e) {
41+
System.err.println("Exception when calling DatasetsApi#editDataset");
42+
System.err.println("Status code: " + e.getCode());
43+
System.err.println("Reason: " + e.getResponseBody());
44+
System.err.println("Response headers: " + e.getResponseHeaders());
45+
e.printStackTrace();
46+
}
47+
}
48+
}

src/main/java/com/datadog/api/client/v2/api/DatasetsApi.java

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.datadog.api.client.ApiResponse;
66
import com.datadog.api.client.Pair;
77
import com.datadog.api.client.v2.model.DatasetCreateRequest;
8+
import com.datadog.api.client.v2.model.DatasetEditRequest;
89
import com.datadog.api.client.v2.model.DatasetResponseMulti;
910
import com.datadog.api.client.v2.model.DatasetResponseSingle;
1011
import jakarta.ws.rs.client.Invocation;
@@ -310,6 +311,161 @@ public CompletableFuture<ApiResponse<Void>> deleteDatasetWithHttpInfoAsync(Strin
310311
null);
311312
}
312313

314+
/**
315+
* Edits a dataset.
316+
*
317+
* <p>See {@link #editDatasetWithHttpInfo}.
318+
*
319+
* @param datasetId The ID of a defined dataset. (required)
320+
* @param body Dataset payload (required)
321+
* @return DatasetResponseSingle
322+
* @throws ApiException if fails to make API call
323+
*/
324+
public DatasetResponseSingle editDataset(String datasetId, DatasetEditRequest body)
325+
throws ApiException {
326+
return editDatasetWithHttpInfo(datasetId, body).getData();
327+
}
328+
329+
/**
330+
* Edits a dataset.
331+
*
332+
* <p>See {@link #editDatasetWithHttpInfoAsync}.
333+
*
334+
* @param datasetId The ID of a defined dataset. (required)
335+
* @param body Dataset payload (required)
336+
* @return CompletableFuture&lt;DatasetResponseSingle&gt;
337+
*/
338+
public CompletableFuture<DatasetResponseSingle> editDatasetAsync(
339+
String datasetId, DatasetEditRequest body) {
340+
return editDatasetWithHttpInfoAsync(datasetId, body)
341+
.thenApply(
342+
response -> {
343+
return response.getData();
344+
});
345+
}
346+
347+
/**
348+
* Edits the dataset associated with the ID.
349+
*
350+
* @param datasetId The ID of a defined dataset. (required)
351+
* @param body Dataset payload (required)
352+
* @return ApiResponse&lt;DatasetResponseSingle&gt;
353+
* @throws ApiException if fails to make API call
354+
* @http.response.details
355+
* <table border="1">
356+
* <caption>Response details</caption>
357+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
358+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
359+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
360+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
361+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
362+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
363+
* </table>
364+
*/
365+
public ApiResponse<DatasetResponseSingle> editDatasetWithHttpInfo(
366+
String datasetId, DatasetEditRequest body) throws ApiException {
367+
Object localVarPostBody = body;
368+
369+
// verify the required parameter 'datasetId' is set
370+
if (datasetId == null) {
371+
throw new ApiException(
372+
400, "Missing the required parameter 'datasetId' when calling editDataset");
373+
}
374+
375+
// verify the required parameter 'body' is set
376+
if (body == null) {
377+
throw new ApiException(400, "Missing the required parameter 'body' when calling editDataset");
378+
}
379+
// create path and map variables
380+
String localVarPath =
381+
"/api/v2/datasets/{dataset_id}"
382+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
383+
384+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
385+
386+
Invocation.Builder builder =
387+
apiClient.createBuilder(
388+
"v2.DatasetsApi.editDataset",
389+
localVarPath,
390+
new ArrayList<Pair>(),
391+
localVarHeaderParams,
392+
new HashMap<String, String>(),
393+
new String[] {"application/json"},
394+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
395+
return apiClient.invokeAPI(
396+
"PUT",
397+
builder,
398+
localVarHeaderParams,
399+
new String[] {"application/json"},
400+
localVarPostBody,
401+
new HashMap<String, Object>(),
402+
false,
403+
new GenericType<DatasetResponseSingle>() {});
404+
}
405+
406+
/**
407+
* Edits a dataset.
408+
*
409+
* <p>See {@link #editDatasetWithHttpInfo}.
410+
*
411+
* @param datasetId The ID of a defined dataset. (required)
412+
* @param body Dataset payload (required)
413+
* @return CompletableFuture&lt;ApiResponse&lt;DatasetResponseSingle&gt;&gt;
414+
*/
415+
public CompletableFuture<ApiResponse<DatasetResponseSingle>> editDatasetWithHttpInfoAsync(
416+
String datasetId, DatasetEditRequest body) {
417+
Object localVarPostBody = body;
418+
419+
// verify the required parameter 'datasetId' is set
420+
if (datasetId == null) {
421+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
422+
result.completeExceptionally(
423+
new ApiException(
424+
400, "Missing the required parameter 'datasetId' when calling editDataset"));
425+
return result;
426+
}
427+
428+
// verify the required parameter 'body' is set
429+
if (body == null) {
430+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
431+
result.completeExceptionally(
432+
new ApiException(400, "Missing the required parameter 'body' when calling editDataset"));
433+
return result;
434+
}
435+
// create path and map variables
436+
String localVarPath =
437+
"/api/v2/datasets/{dataset_id}"
438+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
439+
440+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
441+
442+
Invocation.Builder builder;
443+
try {
444+
builder =
445+
apiClient.createBuilder(
446+
"v2.DatasetsApi.editDataset",
447+
localVarPath,
448+
new ArrayList<Pair>(),
449+
localVarHeaderParams,
450+
new HashMap<String, String>(),
451+
new String[] {"application/json"},
452+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
453+
} catch (ApiException ex) {
454+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
455+
result.completeExceptionally(ex);
456+
return result;
457+
}
458+
return apiClient.invokeAPIAsync(
459+
"PUT",
460+
builder,
461+
localVarHeaderParams,
462+
new String[] {"application/json"},
463+
localVarPostBody,
464+
new HashMap<String, Object>(),
465+
false,
466+
new GenericType<DatasetResponseSingle>() {});
467+
}
468+
313469
/**
314470
* Get all datasets.
315471
*

src/main/java/com/datadog/api/client/v2/model/Dataset.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,27 @@
1717
import java.util.Map;
1818
import java.util.Objects;
1919

20-
/** Dataset object. */
20+
/**
21+
* Dataset object.
22+
*
23+
* <h3>Datasets Constraints</h3>
24+
*
25+
* <ul>
26+
* <li><strong>Tag Limit per Dataset</strong>:
27+
* <li>
28+
* <p>Each restricted dataset supports a maximum of 10 key:value pairs within each dataset.
29+
* <li>
30+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
31+
* <li>Only one tag key or attribute may be used to define access within a single telemetry type.
32+
* <li>
33+
* <p>The same or different tag key may be used across different telemetry types.
34+
* <li>
35+
* <p><strong>Tag Value Uniqueness</strong>:
36+
* <li>Tag values must be unique within a single dataset.
37+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
38+
* type.
39+
* </ul>
40+
*/
2141
@JsonPropertyOrder({
2242
Dataset.JSON_PROPERTY_ATTRIBUTES,
2343
Dataset.JSON_PROPERTY_ID,

src/main/java/com/datadog/api/client/v2/model/DatasetCreateRequest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ public DatasetCreateRequest data(Dataset data) {
4444
/**
4545
* Dataset object.
4646
*
47+
* <h3>Datasets Constraints</h3>
48+
*
49+
* <ul>
50+
* <li><strong>Tag Limit per Dataset</strong>:
51+
* <li>
52+
* <p>Each restricted dataset supports a maximum of 10 key:value pairs within each dataset.
53+
* <li>
54+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
55+
* <li>Only one tag key or attribute may be used to define access within a single telemetry
56+
* type.
57+
* <li>
58+
* <p>The same or different tag key may be used across different telemetry types.
59+
* <li>
60+
* <p><strong>Tag Value Uniqueness</strong>:
61+
* <li>Tag values must be unique within a single dataset.
62+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
63+
* type.
64+
* </ul>
65+
*
4766
* @return data
4867
*/
4968
@JsonProperty(JSON_PROPERTY_DATA)

0 commit comments

Comments
 (0)