Skip to content

Commit

Permalink
Regenerate client from commit 733cf3ea of spec repo (#2636)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 3, 2025
1 parent ebf0afa commit 58c4d71
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -335,6 +336,25 @@ public ApiResponse<RestrictionPolicyResponse> getRestrictionPolicyWithHttpInfo(S
new GenericType<RestrictionPolicyResponse>() {});
}

/** Manage optional parameters to updateRestrictionPolicy. */
public static class UpdateRestrictionPolicyOptionalParameters {
private String allowSelfLockout;

/**
* Set allowSelfLockout.
*
* @param allowSelfLockout Allows admins (users with the <code>user_access_manage</code>
* permission) to remove their own access from the resource if set to <code>true</code>. By
* default, this is set to <code>false</code>, preventing admins from locking themselves
* out. (optional)
* @return UpdateRestrictionPolicyOptionalParameters
*/
public UpdateRestrictionPolicyOptionalParameters allowSelfLockout(String allowSelfLockout) {
this.allowSelfLockout = allowSelfLockout;
return this;
}
}

/**
* Update a restriction policy.
*
Expand All @@ -349,7 +369,9 @@ public ApiResponse<RestrictionPolicyResponse> getRestrictionPolicyWithHttpInfo(S
*/
public RestrictionPolicyResponse updateRestrictionPolicy(
String resourceId, RestrictionPolicyUpdateRequest body) throws ApiException {
return updateRestrictionPolicyWithHttpInfo(resourceId, body).getData();
return updateRestrictionPolicyWithHttpInfo(
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
.getData();
}

/**
Expand All @@ -365,7 +387,52 @@ public RestrictionPolicyResponse updateRestrictionPolicy(
*/
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
String resourceId, RestrictionPolicyUpdateRequest body) {
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body)
return updateRestrictionPolicyWithHttpInfoAsync(
resourceId, body, new UpdateRestrictionPolicyOptionalParameters())
.thenApply(
response -> {
return response.getData();
});
}

/**
* Update a restriction policy.
*
* <p>See {@link #updateRestrictionPolicyWithHttpInfo}.
*
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
* </code>, <code>security-rule</code>, <code>slo</code>. (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.
*
* <p>See {@link #updateRestrictionPolicyWithHttpInfoAsync}.
*
* @param resourceId Identifier, formatted as <code>type:id</code>. Supported types: <code>
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
* @param body Restriction policy payload (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;RestrictionPolicyResponse&gt;
*/
public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync(
String resourceId,
RestrictionPolicyUpdateRequest body,
UpdateRestrictionPolicyOptionalParameters parameters) {
return updateRestrictionPolicyWithHttpInfoAsync(resourceId, body, parameters)
.thenApply(
response -> {
return response.getData();
Expand Down Expand Up @@ -399,6 +466,7 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
* @param body Restriction policy payload (required)
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;RestrictionPolicyResponse&gt;
* @throws ApiException if fails to make API call
* @http.response.details
Expand All @@ -412,7 +480,10 @@ public CompletableFuture<RestrictionPolicyResponse> updateRestrictionPolicyAsync
* </table>
*/
public ApiResponse<RestrictionPolicyResponse> 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
Expand All @@ -426,19 +497,24 @@ public ApiResponse<RestrictionPolicyResponse> 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<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));

Invocation.Builder builder =
apiClient.createBuilder(
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand All @@ -463,11 +539,14 @@ public ApiResponse<RestrictionPolicyResponse> updateRestrictionPolicyWithHttpInf
* connection</code>, <code>dashboard</code>, <code>notebook</code>, <code>reference-table
* </code>, <code>security-rule</code>, <code>slo</code>. (required)
* @param body Restriction policy payload (required)
* @param parameters Optional parameters for the request.
* @return CompletableFuture&lt;ApiResponse&lt;RestrictionPolicyResponse&gt;&gt;
*/
public CompletableFuture<ApiResponse<RestrictionPolicyResponse>>
updateRestrictionPolicyWithHttpInfoAsync(
String resourceId, RestrictionPolicyUpdateRequest body) {
String resourceId,
RestrictionPolicyUpdateRequest body,
UpdateRestrictionPolicyOptionalParameters parameters) {
Object localVarPostBody = body;

// verify the required parameter 'resourceId' is set
Expand All @@ -488,21 +567,26 @@ public ApiResponse<RestrictionPolicyResponse> 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<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();

localVarQueryParams.addAll(
apiClient.parameterToPairs("", "allow_self_lockout", allowSelfLockout));

Invocation.Builder builder;
try {
builder =
apiClient.createBuilder(
"v2.RestrictionPoliciesApi.updateRestrictionPolicy",
localVarPath,
new ArrayList<Pair>(),
localVarQueryParams,
localVarHeaderParams,
new HashMap<String, String>(),
new String[] {"application/json"},
Expand Down

0 comments on commit 58c4d71

Please sign in to comment.