-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathDataDeletionApi.java
More file actions
594 lines (548 loc) · 21.1 KB
/
Copy pathDataDeletionApi.java
File metadata and controls
594 lines (548 loc) · 21.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
package com.datadog.api.client.v2.api;
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.CancelDataDeletionResponseBody;
import com.datadog.api.client.v2.model.CreateDataDeletionRequestBody;
import com.datadog.api.client.v2.model.CreateDataDeletionResponseBody;
import com.datadog.api.client.v2.model.GetDataDeletionsResponseBody;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class DataDeletionApi {
private ApiClient apiClient;
public DataDeletionApi() {
this(ApiClient.getDefaultApiClient());
}
public DataDeletionApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API client.
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API client.
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Cancels a data deletion request.
*
* <p>See {@link #cancelDataDeletionRequestWithHttpInfo}.
*
* @param id ID of the deletion request. (required)
* @return CancelDataDeletionResponseBody
* @throws ApiException if fails to make API call
*/
public CancelDataDeletionResponseBody cancelDataDeletionRequest(String id) throws ApiException {
return cancelDataDeletionRequestWithHttpInfo(id).getData();
}
/**
* Cancels a data deletion request.
*
* <p>See {@link #cancelDataDeletionRequestWithHttpInfoAsync}.
*
* @param id ID of the deletion request. (required)
* @return CompletableFuture<CancelDataDeletionResponseBody>
*/
public CompletableFuture<CancelDataDeletionResponseBody> cancelDataDeletionRequestAsync(
String id) {
return cancelDataDeletionRequestWithHttpInfoAsync(id)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Cancels a data deletion request by providing its ID.
*
* @param id ID of the deletion request. (required)
* @return ApiResponse<CancelDataDeletionResponseBody>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 412 </td><td> Precondition failed error </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* <tr><td> 500 </td><td> Internal server error </td><td> - </td></tr>
* </table>
*/
public ApiResponse<CancelDataDeletionResponseBody> cancelDataDeletionRequestWithHttpInfo(
String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(
400, "Missing the required parameter 'id' when calling cancelDataDeletionRequest");
}
// create path and map variables
String localVarPath =
"/api/v2/deletion/requests/{id}/cancel"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.DataDeletionApi.cancelDataDeletionRequest",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"PUT",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CancelDataDeletionResponseBody>() {});
}
/**
* Cancels a data deletion request.
*
* <p>See {@link #cancelDataDeletionRequestWithHttpInfo}.
*
* @param id ID of the deletion request. (required)
* @return CompletableFuture<ApiResponse<CancelDataDeletionResponseBody>>
*/
public CompletableFuture<ApiResponse<CancelDataDeletionResponseBody>>
cancelDataDeletionRequestWithHttpInfoAsync(String id) {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
CompletableFuture<ApiResponse<CancelDataDeletionResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'id' when calling cancelDataDeletionRequest"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/deletion/requests/{id}/cancel"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.DataDeletionApi.cancelDataDeletionRequest",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<CancelDataDeletionResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"PUT",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CancelDataDeletionResponseBody>() {});
}
/**
* Creates a data deletion request.
*
* <p>See {@link #createDataDeletionRequestWithHttpInfo}.
*
* @param product Name of the product to be deleted. Only <code>logs</code> is supported.
* (required)
* @param body (required)
* @return CreateDataDeletionResponseBody
* @throws ApiException if fails to make API call
*/
public CreateDataDeletionResponseBody createDataDeletionRequest(
String product, CreateDataDeletionRequestBody body) throws ApiException {
return createDataDeletionRequestWithHttpInfo(product, body).getData();
}
/**
* Creates a data deletion request.
*
* <p>See {@link #createDataDeletionRequestWithHttpInfoAsync}.
*
* @param product Name of the product to be deleted. Only <code>logs</code> is supported.
* (required)
* @param body (required)
* @return CompletableFuture<CreateDataDeletionResponseBody>
*/
public CompletableFuture<CreateDataDeletionResponseBody> createDataDeletionRequestAsync(
String product, CreateDataDeletionRequestBody body) {
return createDataDeletionRequestWithHttpInfoAsync(product, body)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Creates a data deletion request by providing a query and a timeframe targeting the proper data.
*
* @param product Name of the product to be deleted. Only <code>logs</code> is supported.
* (required)
* @param body (required)
* @return ApiResponse<CreateDataDeletionResponseBody>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 412 </td><td> Precondition failed error </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* <tr><td> 500 </td><td> Internal server error </td><td> - </td></tr>
* </table>
*/
public ApiResponse<CreateDataDeletionResponseBody> createDataDeletionRequestWithHttpInfo(
String product, CreateDataDeletionRequestBody body) throws ApiException {
Object localVarPostBody = body;
// verify the required parameter 'product' is set
if (product == null) {
throw new ApiException(
400, "Missing the required parameter 'product' when calling createDataDeletionRequest");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException(
400, "Missing the required parameter 'body' when calling createDataDeletionRequest");
}
// create path and map variables
String localVarPath =
"/api/v2/deletion/data/{product}"
.replaceAll("\\{" + "product" + "\\}", apiClient.escapeString(product.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder =
apiClient.createBuilder(
"v2.DataDeletionApi.createDataDeletionRequest",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CreateDataDeletionResponseBody>() {});
}
/**
* Creates a data deletion request.
*
* <p>See {@link #createDataDeletionRequestWithHttpInfo}.
*
* @param product Name of the product to be deleted. Only <code>logs</code> is supported.
* (required)
* @param body (required)
* @return CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>>
*/
public CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>>
createDataDeletionRequestWithHttpInfoAsync(
String product, CreateDataDeletionRequestBody body) {
Object localVarPostBody = body;
// verify the required parameter 'product' is set
if (product == null) {
CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400,
"Missing the required parameter 'product' when calling createDataDeletionRequest"));
return result;
}
// verify the required parameter 'body' is set
if (body == null) {
CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(
new ApiException(
400, "Missing the required parameter 'body' when calling createDataDeletionRequest"));
return result;
}
// create path and map variables
String localVarPath =
"/api/v2/deletion/data/{product}"
.replaceAll("\\{" + "product" + "\\}", apiClient.escapeString(product.toString()));
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.DataDeletionApi.createDataDeletionRequest",
localVarPath,
new ArrayList<Pair>(),
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<CreateDataDeletionResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"POST",
builder,
localVarHeaderParams,
new String[] {"application/json"},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<CreateDataDeletionResponseBody>() {});
}
/** Manage optional parameters to getDataDeletionRequests. */
public static class GetDataDeletionRequestsOptionalParameters {
private String nextPage;
private String product;
private String query;
private String status;
private Long pageSize;
/**
* Set nextPage.
*
* @param nextPage The next page of the previous search. If the next_page parameter is included,
* the rest of the query elements are ignored. (optional)
* @return GetDataDeletionRequestsOptionalParameters
*/
public GetDataDeletionRequestsOptionalParameters nextPage(String nextPage) {
this.nextPage = nextPage;
return this;
}
/**
* Set product.
*
* @param product Retrieve only the requests related to the given product. (optional)
* @return GetDataDeletionRequestsOptionalParameters
*/
public GetDataDeletionRequestsOptionalParameters product(String product) {
this.product = product;
return this;
}
/**
* Set query.
*
* @param query Retrieve only the requests that matches the given query. (optional)
* @return GetDataDeletionRequestsOptionalParameters
*/
public GetDataDeletionRequestsOptionalParameters query(String query) {
this.query = query;
return this;
}
/**
* Set status.
*
* @param status Retrieve only the requests with the given status. (optional)
* @return GetDataDeletionRequestsOptionalParameters
*/
public GetDataDeletionRequestsOptionalParameters status(String status) {
this.status = status;
return this;
}
/**
* Set pageSize.
*
* @param pageSize Sets the page size of the search. (optional, default to 50)
* @return GetDataDeletionRequestsOptionalParameters
*/
public GetDataDeletionRequestsOptionalParameters pageSize(Long pageSize) {
this.pageSize = pageSize;
return this;
}
}
/**
* Gets a list of data deletion requests.
*
* <p>See {@link #getDataDeletionRequestsWithHttpInfo}.
*
* @return GetDataDeletionsResponseBody
* @throws ApiException if fails to make API call
*/
public GetDataDeletionsResponseBody getDataDeletionRequests() throws ApiException {
return getDataDeletionRequestsWithHttpInfo(new GetDataDeletionRequestsOptionalParameters())
.getData();
}
/**
* Gets a list of data deletion requests.
*
* <p>See {@link #getDataDeletionRequestsWithHttpInfoAsync}.
*
* @return CompletableFuture<GetDataDeletionsResponseBody>
*/
public CompletableFuture<GetDataDeletionsResponseBody> getDataDeletionRequestsAsync() {
return getDataDeletionRequestsWithHttpInfoAsync(new GetDataDeletionRequestsOptionalParameters())
.thenApply(
response -> {
return response.getData();
});
}
/**
* Gets a list of data deletion requests.
*
* <p>See {@link #getDataDeletionRequestsWithHttpInfo}.
*
* @param parameters Optional parameters for the request.
* @return GetDataDeletionsResponseBody
* @throws ApiException if fails to make API call
*/
public GetDataDeletionsResponseBody getDataDeletionRequests(
GetDataDeletionRequestsOptionalParameters parameters) throws ApiException {
return getDataDeletionRequestsWithHttpInfo(parameters).getData();
}
/**
* Gets a list of data deletion requests.
*
* <p>See {@link #getDataDeletionRequestsWithHttpInfoAsync}.
*
* @param parameters Optional parameters for the request.
* @return CompletableFuture<GetDataDeletionsResponseBody>
*/
public CompletableFuture<GetDataDeletionsResponseBody> getDataDeletionRequestsAsync(
GetDataDeletionRequestsOptionalParameters parameters) {
return getDataDeletionRequestsWithHttpInfoAsync(parameters)
.thenApply(
response -> {
return response.getData();
});
}
/**
* Gets a list of data deletion requests based on several filter parameters.
*
* @param parameters Optional parameters for the request.
* @return ApiResponse<GetDataDeletionsResponseBody>
* @throws ApiException if fails to make API call
* @http.response.details
* <table border="1">
* <caption>Response details</caption>
* <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
* <tr><td> 200 </td><td> OK </td><td> - </td></tr>
* <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr>
* <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr>
* <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr>
* <tr><td> 500 </td><td> Internal server error </td><td> - </td></tr>
* </table>
*/
public ApiResponse<GetDataDeletionsResponseBody> getDataDeletionRequestsWithHttpInfo(
GetDataDeletionRequestsOptionalParameters parameters) throws ApiException {
Object localVarPostBody = null;
String nextPage = parameters.nextPage;
String product = parameters.product;
String query = parameters.query;
String status = parameters.status;
Long pageSize = parameters.pageSize;
// create path and map variables
String localVarPath = "/api/v2/deletion/requests";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "next_page", nextPage));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize));
Invocation.Builder builder =
apiClient.createBuilder(
"v2.DataDeletionApi.getDataDeletionRequests",
localVarPath,
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
return apiClient.invokeAPI(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<GetDataDeletionsResponseBody>() {});
}
/**
* Gets a list of data deletion requests.
*
* <p>See {@link #getDataDeletionRequestsWithHttpInfo}.
*
* @param parameters Optional parameters for the request.
* @return CompletableFuture<ApiResponse<GetDataDeletionsResponseBody>>
*/
public CompletableFuture<ApiResponse<GetDataDeletionsResponseBody>>
getDataDeletionRequestsWithHttpInfoAsync(
GetDataDeletionRequestsOptionalParameters parameters) {
Object localVarPostBody = null;
String nextPage = parameters.nextPage;
String product = parameters.product;
String query = parameters.query;
String status = parameters.status;
Long pageSize = parameters.pageSize;
// create path and map variables
String localVarPath = "/api/v2/deletion/requests";
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "next_page", nextPage));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_size", pageSize));
Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.DataDeletionApi.getDataDeletionRequests",
localVarPath,
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
new String[] {"apiKeyAuth", "appKeyAuth"});
} catch (ApiException ex) {
CompletableFuture<ApiResponse<GetDataDeletionsResponseBody>> result =
new CompletableFuture<>();
result.completeExceptionally(ex);
return result;
}
return apiClient.invokeAPIAsync(
"GET",
builder,
localVarHeaderParams,
new String[] {},
localVarPostBody,
new HashMap<String, Object>(),
false,
new GenericType<GetDataDeletionsResponseBody>() {});
}
}