From 58c4d718ccf58c68347c134eab56a5ae3605910d Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:51:51 -0500 Subject: [PATCH] Regenerate client from commit 733cf3ea of spec repo (#2636) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 8 ++ .../client/v2/api/RestrictionPoliciesApi.java | 96 +++++++++++++++++-- 3 files changed, 102 insertions(+), 10 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 372071a2d80..598a316220f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 15:18:18.050924", - "spec_repo_commit": "bc53c28f" + "regenerated": "2025-01-02 17:32:09.022655", + "spec_repo_commit": "733cf3ea" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-02 15:18:18.073678", - "spec_repo_commit": "bc53c28f" + "regenerated": "2025-01-02 17:32:09.037464", + "spec_repo_commit": "733cf3ea" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 941ec65aef2..76195d0bb3d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -40985,6 +40985,14 @@ paths: operationId: UpdateRestrictionPolicy parameters: - $ref: '#/components/parameters/ResourceID' + - description: Allows admins (users with the `user_access_manage` permission) + to remove their own access from the resource if set to `true`. By default, + this is set to `false`, preventing admins from locking themselves out. + in: query + name: allow_self_lockout + required: false + schema: + type: string requestBody: content: application/json: diff --git a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java index e816e1ec5c7..149b4e635ae 100644 --- a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java @@ -10,6 +10,7 @@ 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; @@ -335,6 +336,25 @@ public ApiResponse getRestrictionPolicyWithHttpInfo(S new GenericType() {}); } + /** Manage optional parameters to updateRestrictionPolicy. */ + public static class UpdateRestrictionPolicyOptionalParameters { + private String allowSelfLockout; + + /** + * Set allowSelfLockout. + * + * @param allowSelfLockout Allows admins (users with the user_access_manage + * permission) to remove their own access from the resource if set to true. By + * default, this is set to false, preventing admins from locking themselves + * out. (optional) + * @return UpdateRestrictionPolicyOptionalParameters + */ + public UpdateRestrictionPolicyOptionalParameters allowSelfLockout(String allowSelfLockout) { + this.allowSelfLockout = allowSelfLockout; + return this; + } + } + /** * Update a restriction policy. * @@ -349,7 +369,9 @@ public ApiResponse getRestrictionPolicyWithHttpInfo(S */ public RestrictionPolicyResponse updateRestrictionPolicy( String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException { - return updateRestrictionPolicyWithHttpInfo(resourceId, body).getData(); + return updateRestrictionPolicyWithHttpInfo( + resourceId, body, new UpdateRestrictionPolicyOptionalParameters()) + .getData(); } /** @@ -365,7 +387,52 @@ public RestrictionPolicyResponse updateRestrictionPolicy( */ public CompletableFuture updateRestrictionPolicyAsync( String resourceId, RestrictionPolicyUpdateRequest body) { - return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body) + return updateRestrictionPolicyWithHttpInfoAsync( + resourceId, body, new UpdateRestrictionPolicyOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a restriction policy. + * + *

See {@link #updateRestrictionPolicyWithHttpInfo}. + * + * @param resourceId Identifier, formatted as type:id. Supported types: + * connection, dashboard, notebook, reference-table + * , security-rule, slo. (required) + * @param body Restriction policy payload (required) + * @param parameters Optional parameters for the request. + * @return RestrictionPolicyResponse + * @throws ApiException if fails to make API call + */ + public RestrictionPolicyResponse updateRestrictionPolicy( + String resourceId, + RestrictionPolicyUpdateRequest body, + UpdateRestrictionPolicyOptionalParameters parameters) + throws ApiException { + return updateRestrictionPolicyWithHttpInfo(resourceId, body, parameters).getData(); + } + + /** + * Update a restriction policy. + * + *

See {@link #updateRestrictionPolicyWithHttpInfoAsync}. + * + * @param resourceId Identifier, formatted as type:id. Supported types: + * connection, dashboard, notebook, reference-table + * , security-rule, slo. (required) + * @param body Restriction policy payload (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<RestrictionPolicyResponse> + */ + public CompletableFuture updateRestrictionPolicyAsync( + String resourceId, + RestrictionPolicyUpdateRequest body, + UpdateRestrictionPolicyOptionalParameters parameters) { + return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body, parameters) .thenApply( response -> { return response.getData(); @@ -399,6 +466,7 @@ public CompletableFuture updateRestrictionPolicyAsync * connection, dashboard, notebook, reference-table * , security-rule, slo. (required) * @param body Restriction policy payload (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<RestrictionPolicyResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -412,7 +480,10 @@ public CompletableFuture updateRestrictionPolicyAsync * */ public ApiResponse updateRestrictionPolicyWithHttpInfo( - String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException { + String resourceId, + RestrictionPolicyUpdateRequest body, + UpdateRestrictionPolicyOptionalParameters parameters) + throws ApiException { Object localVarPostBody = body; // verify the required parameter 'resourceId' is set @@ -426,19 +497,24 @@ public ApiResponse updateRestrictionPolicyWithHttpInf throw new ApiException( 400, "Missing the required parameter 'body' when calling updateRestrictionPolicy"); } + String allowSelfLockout = parameters.allowSelfLockout; // create path and map variables String localVarPath = "/api/v2/restriction_policy/{resource_id}" .replaceAll( "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout)); + Invocation.Builder builder = apiClient.createBuilder( "v2.RestrictionPoliciesApi.updateRestrictionPolicy", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -463,11 +539,14 @@ public ApiResponse updateRestrictionPolicyWithHttpInf * connection, dashboard, notebook, reference-table * , security-rule, slo. (required) * @param body Restriction policy payload (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<RestrictionPolicyResponse>> */ public CompletableFuture> updateRestrictionPolicyWithHttpInfoAsync( - String resourceId, RestrictionPolicyUpdateRequest body) { + String resourceId, + RestrictionPolicyUpdateRequest body, + UpdateRestrictionPolicyOptionalParameters parameters) { Object localVarPostBody = body; // verify the required parameter 'resourceId' is set @@ -488,21 +567,26 @@ public ApiResponse updateRestrictionPolicyWithHttpInf 400, "Missing the required parameter 'body' when calling updateRestrictionPolicy")); return result; } + String allowSelfLockout = parameters.allowSelfLockout; // create path and map variables String localVarPath = "/api/v2/restriction_policy/{resource_id}" .replaceAll( "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( "v2.RestrictionPoliciesApi.updateRestrictionPolicy", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"},