Skip to content

Commit 6fb62d2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 733cf3ea of spec repo
1 parent ebf0afa commit 6fb62d2

File tree

3 files changed

+102
-10
lines changed

3 files changed

+102
-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 15:18:18.050924",
8-
"spec_repo_commit": "bc53c28f"
7+
"regenerated": "2025-01-02 17:32:09.022655",
8+
"spec_repo_commit": "733cf3ea"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-02 15:18:18.073678",
13-
"spec_repo_commit": "bc53c28f"
12+
"regenerated": "2025-01-02 17:32:09.037464",
13+
"spec_repo_commit": "733cf3ea"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40985,6 +40985,14 @@ paths:
4098540985
operationId: UpdateRestrictionPolicy
4098640986
parameters:
4098740987
- $ref: '#/components/parameters/ResourceID'
40988+
- description: Allows admins (users with the `user_access_manage` permission)
40989+
to remove their own access from the resource if set to `true`. By default,
40990+
this is set to `false`, preventing admins from locking themselves out.
40991+
in: query
40992+
name: allow_self_lockout
40993+
required: false
40994+
schema:
40995+
type: string
4098840996
requestBody:
4098940997
content:
4099040998
application/json:

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

Lines changed: 90 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,25 @@ 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 <code>user_access_manage</code>
347+
* permission) to remove their own access from the resource if set to <code>true</code>. By
348+
* default, this is set to <code>false</code>, preventing admins from locking themselves
349+
* out. (optional)
350+
* @return UpdateRestrictionPolicyOptionalParameters
351+
*/
352+
public UpdateRestrictionPolicyOptionalParameters allowSelfLockout(String allowSelfLockout) {
353+
this.allowSelfLockout = allowSelfLockout;
354+
return this;
355+
}
356+
}
357+
338358
/**
339359
* Update a restriction policy.
340360
*
@@ -349,7 +369,9 @@ public ApiResponse<RestrictionPolicyResponse> getRestrictionPolicyWithHttpInfo(S
349369
*/
350370
public RestrictionPolicyResponse updateRestrictionPolicy(
351371
String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException {
352-
return updateRestrictionPolicyWithHttpInfo(resourceId, body).getData();
372+
return updateRestrictionPolicyWithHttpInfo(
373+
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
374+
.getData();
353375
}
354376

355377
/**
@@ -365,7 +387,52 @@ public RestrictionPolicyResponse updateRestrictionPolicy(
365387
*/
366388
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
367389
String resourceId, RestrictionPolicyUpdateRequest body) {
368-
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body)
390+
return updateRestrictionPolicyWithHttpInfoAsync(
391+
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
392+
.thenApply(
393+
response -> {
394+
return response.getData();
395+
});
396+
}
397+
398+
/**
399+
* Update a restriction policy.
400+
*
401+
* <p>See {@link #updateRestrictionPolicyWithHttpInfo}.
402+
*
403+
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
404+
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
405+
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
406+
* @param body Restriction policy payload (required)
407+
* @param parameters Optional parameters for the request.
408+
* @return RestrictionPolicyResponse
409+
* @throws ApiException if fails to make API call
410+
*/
411+
public RestrictionPolicyResponse updateRestrictionPolicy(
412+
String resourceId,
413+
RestrictionPolicyUpdateRequest body,
414+
UpdateRestrictionPolicyOptionalParameters parameters)
415+
throws ApiException {
416+
return updateRestrictionPolicyWithHttpInfo(resourceId, body, parameters).getData();
417+
}
418+
419+
/**
420+
* Update a restriction policy.
421+
*
422+
* <p>See {@link #updateRestrictionPolicyWithHttpInfoAsync}.
423+
*
424+
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
425+
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
426+
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
427+
* @param body Restriction policy payload (required)
428+
* @param parameters Optional parameters for the request.
429+
* @return CompletableFuture&lt;RestrictionPolicyResponse&gt;
430+
*/
431+
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
432+
String resourceId,
433+
RestrictionPolicyUpdateRequest body,
434+
UpdateRestrictionPolicyOptionalParameters parameters) {
435+
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body, parameters)
369436
.thenApply(
370437
response -> {
371438
return response.getData();
@@ -399,6 +466,7 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
399466
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
400467
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
401468
* @param body Restriction policy payload (required)
469+
* @param parameters Optional parameters for the request.
402470
* @return ApiResponse&lt;RestrictionPolicyResponse&gt;
403471
* @throws ApiException if fails to make API call
404472
* @http.response.details
@@ -412,7 +480,10 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
412480
* </table>
413481
*/
414482
public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInfo(
415-
String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException {
483+
String resourceId,
484+
RestrictionPolicyUpdateRequest body,
485+
UpdateRestrictionPolicyOptionalParameters parameters)
486+
throws ApiException {
416487
Object localVarPostBody = body;
417488

418489
// verify the required parameter 'resourceId' is set
@@ -426,19 +497,24 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
426497
throw new ApiException(
427498
400, "Missing the required parameter 'body' when calling updateRestrictionPolicy");
428499
}
500+
String allowSelfLockout = parameters.allowSelfLockout;
429501
// create path and map variables
430502
String localVarPath =
431503
"/api/v2/restriction_policy/{resource_id}"
432504
.replaceAll(
433505
"\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString()));
434506

507+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
435508
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
436509

510+
localVarQueryParams.addAll(
511+
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));
512+
437513
Invocation.Builder builder =
438514
apiClient.createBuilder(
439515
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
440516
localVarPath,
441-
new ArrayList<Pair>(),
517+
localVarQueryParams,
442518
localVarHeaderParams,
443519
new HashMap<String, String>(),
444520
new String[] {"application/json"},
@@ -463,11 +539,14 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
463539
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
464540
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
465541
* @param body Restriction policy payload (required)
542+
* @param parameters Optional parameters for the request.
466543
* @return CompletableFuture&lt;ApiResponse&lt;RestrictionPolicyResponse&gt;&gt;
467544
*/
468545
public CompletableFuture<ApiResponse<RestrictionPolicyResponse>>
469546
updateRestrictionPolicyWithHttpInfoAsync(
470-
String resourceId, RestrictionPolicyUpdateRequest body) {
547+
String resourceId,
548+
RestrictionPolicyUpdateRequest body,
549+
UpdateRestrictionPolicyOptionalParameters parameters) {
471550
Object localVarPostBody = body;
472551

473552
// verify the required parameter 'resourceId' is set
@@ -488,21 +567,26 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
488567
400, "Missing the required parameter 'body' when calling updateRestrictionPolicy"));
489568
return result;
490569
}
570+
String allowSelfLockout = parameters.allowSelfLockout;
491571
// create path and map variables
492572
String localVarPath =
493573
"/api/v2/restriction_policy/{resource_id}"
494574
.replaceAll(
495575
"\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString()));
496576

577+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
497578
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
498579

580+
localVarQueryParams.addAll(
581+
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));
582+
499583
Invocation.Builder builder;
500584
try {
501585
builder =
502586
apiClient.createBuilder(
503587
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
504588
localVarPath,
505-
new ArrayList<Pair>(),
589+
localVarQueryParams,
506590
localVarHeaderParams,
507591
new HashMap<String, String>(),
508592
new String[] {"application/json"},

0 commit comments

Comments
 (0)