Skip to content

Commit 4615595

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 463c2da of spec repo
1 parent 69d9b4f commit 4615595

File tree

7 files changed

+480
-3
lines changed

7 files changed

+480
-3
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": "8ca2883",
3-
"generated": "2025-07-22 07:16:11.777"
2+
"spec_repo_commit": "463c2da",
3+
"generated": "2025-07-22 13:57:17.537"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12537,6 +12537,14 @@ components:
1253712537
required:
1253812538
- data
1253912539
type: object
12540+
DatasetEditRequest:
12541+
description: Edit request for a dataset.
12542+
properties:
12543+
data:
12544+
$ref: '#/components/schemas/Dataset'
12545+
required:
12546+
- data
12547+
type: object
1254012548
DatasetResponseMulti:
1254112549
description: Response containing a list of datasets.
1254212550
properties:
@@ -48166,7 +48174,14 @@ paths:
4816648174
permissions:
4816748175
- user_access_read
4816848176
post:
48169-
description: Create a dataset with the configurations in the request.
48177+
description: "Create a dataset with the configurations in the request.\n\n###
48178+
Datasets Constraints\n\n- **Tag Limit per Dataset**:\n - Each Restricted
48179+
Dataset supports a maximum of 10 key:value pairs.\n\n- **Tag Key Rules per
48180+
Telemetry Type**:\n - Only one tag key or attribute may be used to define
48181+
access within a single telemetry type.\n - The same or different tag key
48182+
may be used across different telemetry types.\n\n- **Tag Value Uniqueness**:\n
48183+
\ - Tag values must be unique within a single dataset.\n - A tag value used
48184+
in one dataset cannot be reused in another dataset of the same telemetry type."
4817048185
operationId: CreateDataset
4817148186
requestBody:
4817248187
content:
@@ -48271,6 +48286,51 @@ paths:
4827148286
x-permission:
4827248287
operator: OPEN
4827348288
permissions: []
48289+
put:
48290+
description: "Edits the dataset associated with the ID.\n\n### Datasets Constraints\n\n-
48291+
**Tag Limit per Dataset**:\n - Each Restricted Dataset supports a maximum
48292+
of 10 key:value pairs.\n\n- **Tag Key Rules per Telemetry Type**:\n - Only
48293+
one tag key or attribute may be used to define access within a single telemetry
48294+
type.\n - The same or different tag key may be used across different telemetry
48295+
types.\n\n- **Tag Value Uniqueness**:\n - Tag values must be unique within
48296+
a single dataset.\n - A tag value used in one dataset cannot be reused in
48297+
another dataset of the same telemetry type."
48298+
operationId: EditDataset
48299+
parameters:
48300+
- $ref: '#/components/parameters/DatasetID'
48301+
requestBody:
48302+
content:
48303+
application/json:
48304+
schema:
48305+
$ref: '#/components/schemas/DatasetEditRequest'
48306+
description: Dataset payload
48307+
required: true
48308+
responses:
48309+
'200':
48310+
content:
48311+
application/json:
48312+
schema:
48313+
$ref: '#/components/schemas/DatasetResponseSingle'
48314+
description: OK
48315+
'400':
48316+
$ref: '#/components/responses/BadRequestResponse'
48317+
'403':
48318+
$ref: '#/components/responses/NotAuthorizedResponse'
48319+
'404':
48320+
$ref: '#/components/responses/NotFoundResponse'
48321+
'429':
48322+
$ref: '#/components/responses/TooManyRequestsResponse'
48323+
security:
48324+
- apiKeyAuth: []
48325+
appKeyAuth: []
48326+
- AuthZ: []
48327+
summary: Edits a dataset
48328+
tags:
48329+
- Datasets
48330+
x-codegen-request-body-name: body
48331+
x-permission:
48332+
operator: OPEN
48333+
permissions: []
4827448334
/api/v2/deletion/data/{product}:
4827548335
post:
4827648336
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: 194 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;
@@ -77,6 +78,25 @@ public CompletableFuture<DatasetResponseSingle> createDatasetAsync(DatasetCreate
7778
/**
7879
* Create a dataset with the configurations in the request.
7980
*
81+
* <h3>Datasets Constraints</h3>
82+
*
83+
* <ul>
84+
* <li><strong>Tag Limit per Dataset</strong>:
85+
* <li>
86+
* <p>Each Restricted Dataset supports a maximum of 10 key:value pairs.
87+
* <li>
88+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
89+
* <li>Only one tag key or attribute may be used to define access within a single telemetry
90+
* type.
91+
* <li>
92+
* <p>The same or different tag key may be used across different telemetry types.
93+
* <li>
94+
* <p><strong>Tag Value Uniqueness</strong>:
95+
* <li>Tag values must be unique within a single dataset.
96+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
97+
* type.
98+
* </ul>
99+
*
80100
* @param body Dataset payload (required)
81101
* @return ApiResponse&lt;DatasetResponseSingle&gt;
82102
* @throws ApiException if fails to make API call
@@ -310,6 +330,180 @@ public CompletableFuture<ApiResponse<Void>> deleteDatasetWithHttpInfoAsync(Strin
310330
null);
311331
}
312332

333+
/**
334+
* Edits a dataset.
335+
*
336+
* <p>See {@link #editDatasetWithHttpInfo}.
337+
*
338+
* @param datasetId The ID of a defined dataset. (required)
339+
* @param body Dataset payload (required)
340+
* @return DatasetResponseSingle
341+
* @throws ApiException if fails to make API call
342+
*/
343+
public DatasetResponseSingle editDataset(String datasetId, DatasetEditRequest body)
344+
throws ApiException {
345+
return editDatasetWithHttpInfo(datasetId, body).getData();
346+
}
347+
348+
/**
349+
* Edits a dataset.
350+
*
351+
* <p>See {@link #editDatasetWithHttpInfoAsync}.
352+
*
353+
* @param datasetId The ID of a defined dataset. (required)
354+
* @param body Dataset payload (required)
355+
* @return CompletableFuture&lt;DatasetResponseSingle&gt;
356+
*/
357+
public CompletableFuture<DatasetResponseSingle> editDatasetAsync(
358+
String datasetId, DatasetEditRequest body) {
359+
return editDatasetWithHttpInfoAsync(datasetId, body)
360+
.thenApply(
361+
response -> {
362+
return response.getData();
363+
});
364+
}
365+
366+
/**
367+
* Edits the dataset associated with the ID.
368+
*
369+
* <h3>Datasets Constraints</h3>
370+
*
371+
* <ul>
372+
* <li><strong>Tag Limit per Dataset</strong>:
373+
* <li>
374+
* <p>Each Restricted Dataset supports a maximum of 10 key:value pairs.
375+
* <li>
376+
* <p><strong>Tag Key Rules per Telemetry Type</strong>:
377+
* <li>Only one tag key or attribute may be used to define access within a single telemetry
378+
* type.
379+
* <li>
380+
* <p>The same or different tag key may be used across different telemetry types.
381+
* <li>
382+
* <p><strong>Tag Value Uniqueness</strong>:
383+
* <li>Tag values must be unique within a single dataset.
384+
* <li>A tag value used in one dataset cannot be reused in another dataset of the same telemetry
385+
* type.
386+
* </ul>
387+
*
388+
* @param datasetId The ID of a defined dataset. (required)
389+
* @param body Dataset payload (required)
390+
* @return ApiResponse&lt;DatasetResponseSingle&gt;
391+
* @throws ApiException if fails to make API call
392+
* @http.response.details
393+
* <table border="1">
394+
* <caption>Response details</caption>
395+
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
396+
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
397+
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
398+
* <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr>
399+
* <tr><td> 404 </td><td> Not Found </td><td> - </td></tr>
400+
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
401+
* </table>
402+
*/
403+
public ApiResponse<DatasetResponseSingle> editDatasetWithHttpInfo(
404+
String datasetId, DatasetEditRequest body) throws ApiException {
405+
Object localVarPostBody = body;
406+
407+
// verify the required parameter 'datasetId' is set
408+
if (datasetId == null) {
409+
throw new ApiException(
410+
400, "Missing the required parameter 'datasetId' when calling editDataset");
411+
}
412+
413+
// verify the required parameter 'body' is set
414+
if (body == null) {
415+
throw new ApiException(400, "Missing the required parameter 'body' when calling editDataset");
416+
}
417+
// create path and map variables
418+
String localVarPath =
419+
"/api/v2/datasets/{dataset_id}"
420+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
421+
422+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
423+
424+
Invocation.Builder builder =
425+
apiClient.createBuilder(
426+
"v2.DatasetsApi.editDataset",
427+
localVarPath,
428+
new ArrayList<Pair>(),
429+
localVarHeaderParams,
430+
new HashMap<String, String>(),
431+
new String[] {"application/json"},
432+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
433+
return apiClient.invokeAPI(
434+
"PUT",
435+
builder,
436+
localVarHeaderParams,
437+
new String[] {"application/json"},
438+
localVarPostBody,
439+
new HashMap<String, Object>(),
440+
false,
441+
new GenericType<DatasetResponseSingle>() {});
442+
}
443+
444+
/**
445+
* Edits a dataset.
446+
*
447+
* <p>See {@link #editDatasetWithHttpInfo}.
448+
*
449+
* @param datasetId The ID of a defined dataset. (required)
450+
* @param body Dataset payload (required)
451+
* @return CompletableFuture&lt;ApiResponse&lt;DatasetResponseSingle&gt;&gt;
452+
*/
453+
public CompletableFuture<ApiResponse<DatasetResponseSingle>> editDatasetWithHttpInfoAsync(
454+
String datasetId, DatasetEditRequest body) {
455+
Object localVarPostBody = body;
456+
457+
// verify the required parameter 'datasetId' is set
458+
if (datasetId == null) {
459+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
460+
result.completeExceptionally(
461+
new ApiException(
462+
400, "Missing the required parameter 'datasetId' when calling editDataset"));
463+
return result;
464+
}
465+
466+
// verify the required parameter 'body' is set
467+
if (body == null) {
468+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
469+
result.completeExceptionally(
470+
new ApiException(400, "Missing the required parameter 'body' when calling editDataset"));
471+
return result;
472+
}
473+
// create path and map variables
474+
String localVarPath =
475+
"/api/v2/datasets/{dataset_id}"
476+
.replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString()));
477+
478+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
479+
480+
Invocation.Builder builder;
481+
try {
482+
builder =
483+
apiClient.createBuilder(
484+
"v2.DatasetsApi.editDataset",
485+
localVarPath,
486+
new ArrayList<Pair>(),
487+
localVarHeaderParams,
488+
new HashMap<String, String>(),
489+
new String[] {"application/json"},
490+
new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"});
491+
} catch (ApiException ex) {
492+
CompletableFuture<ApiResponse<DatasetResponseSingle>> result = new CompletableFuture<>();
493+
result.completeExceptionally(ex);
494+
return result;
495+
}
496+
return apiClient.invokeAPIAsync(
497+
"PUT",
498+
builder,
499+
localVarHeaderParams,
500+
new String[] {"application/json"},
501+
localVarPostBody,
502+
new HashMap<String, Object>(),
503+
false,
504+
new GenericType<DatasetResponseSingle>() {});
505+
}
506+
313507
/**
314508
* Get all datasets.
315509
*

0 commit comments

Comments
 (0)