Skip to content

Commit 1180fb7

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 59e36a8d of spec repo
1 parent 6ac94d0 commit 1180fb7

File tree

3 files changed

+101
-10
lines changed

3 files changed

+101
-10
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-02 14:39:41.391682",
8-
"spec_repo_commit": "b4e964b3"
7+
"regenerated": "2025-01-02 17:21:20.005804",
8+
"spec_repo_commit": "59e36a8d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-02 14:39:41.406329",
13-
"spec_repo_commit": "b4e964b3"
12+
"regenerated": "2025-01-02 17:21:20.020697",
13+
"spec_repo_commit": "59e36a8d"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40785,6 +40785,14 @@ paths:
4078540785
operationId: UpdateRestrictionPolicy
4078640786
parameters:
4078740787
- $ref: '#/components/parameters/ResourceID'
40788+
- description: Allows admins (users with the user_access_manage permission)
40789+
to remove their own access from the resource if set to `true`. By default,
40790+
this is set to `false`, preventing admins from locking themselves out.
40791+
in: query
40792+
name: allow_self_lockout
40793+
required: false
40794+
schema:
40795+
type: string
4078840796
requestBody:
4078940797
content:
4079040798
application/json:

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

Lines changed: 89 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import jakarta.ws.rs.core.GenericType;
1111
import java.util.ArrayList;
1212
import java.util.HashMap;
13+
import java.util.List;
1314
import java.util.Map;
1415
import java.util.concurrent.CompletableFuture;
1516

@@ -335,6 +336,24 @@ public ApiResponse<RestrictionPolicyResponse> getRestrictionPolicyWithHttpInfo(S
335336
new GenericType<RestrictionPolicyResponse>() {});
336337
}
337338

339+
/** Manage optional parameters to updateRestrictionPolicy. */
340+
public static class UpdateRestrictionPolicyOptionalParameters {
341+
private String allowSelfLockout;
342+
343+
/**
344+
* Set allowSelfLockout.
345+
*
346+
* @param allowSelfLockout Allows admins (users with the user_access_manage permission) to
347+
* remove their own access from the resource if set to <code>true</code>. By default, this
348+
* is set to <code>false</code>, preventing admins from locking themselves out. (optional)
349+
* @return UpdateRestrictionPolicyOptionalParameters
350+
*/
351+
public UpdateRestrictionPolicyOptionalParameters allowSelfLockout(String allowSelfLockout) {
352+
this.allowSelfLockout = allowSelfLockout;
353+
return this;
354+
}
355+
}
356+
338357
/**
339358
* Update a restriction policy.
340359
*
@@ -349,7 +368,9 @@ public ApiResponse<RestrictionPolicyResponse> getRestrictionPolicyWithHttpInfo(S
349368
*/
350369
public RestrictionPolicyResponse updateRestrictionPolicy(
351370
String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException {
352-
return updateRestrictionPolicyWithHttpInfo(resourceId, body).getData();
371+
return updateRestrictionPolicyWithHttpInfo(
372+
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
373+
.getData();
353374
}
354375

355376
/**
@@ -365,7 +386,52 @@ public RestrictionPolicyResponse updateRestrictionPolicy(
365386
*/
366387
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
367388
String resourceId, RestrictionPolicyUpdateRequest body) {
368-
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body)
389+
return updateRestrictionPolicyWithHttpInfoAsync(
390+
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
391+
.thenApply(
392+
response -> {
393+
return response.getData();
394+
});
395+
}
396+
397+
/**
398+
* Update a restriction policy.
399+
*
400+
* <p>See {@link #updateRestrictionPolicyWithHttpInfo}.
401+
*
402+
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
403+
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
404+
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
405+
* @param body Restriction policy payload (required)
406+
* @param parameters Optional parameters for the request.
407+
* @return RestrictionPolicyResponse
408+
* @throws ApiException if fails to make API call
409+
*/
410+
public RestrictionPolicyResponse updateRestrictionPolicy(
411+
String resourceId,
412+
RestrictionPolicyUpdateRequest body,
413+
UpdateRestrictionPolicyOptionalParameters parameters)
414+
throws ApiException {
415+
return updateRestrictionPolicyWithHttpInfo(resourceId, body, parameters).getData();
416+
}
417+
418+
/**
419+
* Update a restriction policy.
420+
*
421+
* <p>See {@link #updateRestrictionPolicyWithHttpInfoAsync}.
422+
*
423+
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
424+
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
425+
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
426+
* @param body Restriction policy payload (required)
427+
* @param parameters Optional parameters for the request.
428+
* @return CompletableFuture&lt;RestrictionPolicyResponse&gt;
429+
*/
430+
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
431+
String resourceId,
432+
RestrictionPolicyUpdateRequest body,
433+
UpdateRestrictionPolicyOptionalParameters parameters) {
434+
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body, parameters)
369435
.thenApply(
370436
response -> {
371437
return response.getData();
@@ -399,6 +465,7 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
399465
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
400466
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
401467
* @param body Restriction policy payload (required)
468+
* @param parameters Optional parameters for the request.
402469
* @return ApiResponse&lt;RestrictionPolicyResponse&gt;
403470
* @throws ApiException if fails to make API call
404471
* @http.response.details
@@ -412,7 +479,10 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
412479
* </table>
413480
*/
414481
public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInfo(
415-
String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException {
482+
String resourceId,
483+
RestrictionPolicyUpdateRequest body,
484+
UpdateRestrictionPolicyOptionalParameters parameters)
485+
throws ApiException {
416486
Object localVarPostBody = body;
417487

418488
// verify the required parameter 'resourceId' is set
@@ -426,19 +496,24 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
426496
throw new ApiException(
427497
400, "Missing the required parameter 'body' when calling updateRestrictionPolicy");
428498
}
499+
String allowSelfLockout = parameters.allowSelfLockout;
429500
// create path and map variables
430501
String localVarPath =
431502
"/api/v2/restriction_policy/{resource_id}"
432503
.replaceAll(
433504
"\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString()));
434505

506+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
435507
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
436508

509+
localVarQueryParams.addAll(
510+
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));
511+
437512
Invocation.Builder builder =
438513
apiClient.createBuilder(
439514
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
440515
localVarPath,
441-
new ArrayList<Pair>(),
516+
localVarQueryParams,
442517
localVarHeaderParams,
443518
new HashMap<String, String>(),
444519
new String[] {"application/json"},
@@ -463,11 +538,14 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
463538
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
464539
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
465540
* @param body Restriction policy payload (required)
541+
* @param parameters Optional parameters for the request.
466542
* @return CompletableFuture&lt;ApiResponse&lt;RestrictionPolicyResponse&gt;&gt;
467543
*/
468544
public CompletableFuture<ApiResponse<RestrictionPolicyResponse>>
469545
updateRestrictionPolicyWithHttpInfoAsync(
470-
String resourceId, RestrictionPolicyUpdateRequest body) {
546+
String resourceId,
547+
RestrictionPolicyUpdateRequest body,
548+
UpdateRestrictionPolicyOptionalParameters parameters) {
471549
Object localVarPostBody = body;
472550

473551
// verify the required parameter 'resourceId' is set
@@ -488,21 +566,26 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
488566
400, "Missing the required parameter 'body' when calling updateRestrictionPolicy"));
489567
return result;
490568
}
569+
String allowSelfLockout = parameters.allowSelfLockout;
491570
// create path and map variables
492571
String localVarPath =
493572
"/api/v2/restriction_policy/{resource_id}"
494573
.replaceAll(
495574
"\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString()));
496575

576+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
497577
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
498578

579+
localVarQueryParams.addAll(
580+
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));
581+
499582
Invocation.Builder builder;
500583
try {
501584
builder =
502585
apiClient.createBuilder(
503586
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
504587
localVarPath,
505-
new ArrayList<Pair>(),
588+
localVarQueryParams,
506589
localVarHeaderParams,
507590
new HashMap<String, String>(),
508591
new String[] {"application/json"},

0 commit comments

Comments
 (0)