# Class AccessPoliciesClient (1.90.0)

1.90.0 (latest) 1.88.0 1.86.0 1.85.0 1.83.0 1.81.0 1.80.0 1.79.0 1.78.0 1.76.0 1.74.0 1.73.0 1.72.0 1.71.0 1.70.0 1.68.0 1.66.0 1.65.0 1.62.0 1.61.0 1.60.0 1.58.0 1.57.0 1.56.0 1.55.0 1.54.0 1.53.0 1.52.0 1.51.0 1.50.0 1.49.0 1.47.0 1.46.0 1.45.0 1.44.0 1.43.0 1.42.0 1.41.0 1.40.0 1.39.0 1.38.0 1.37.0 1.35.0 1.34.0 1.33.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.0 1.17.0 1.16.0 1.15.0 1.14.0 1.13.0 1.12.0 1.11.0 1.10.0 1.9.0 1.7.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-iam-policy/google-iam-policy/src/main/java/com/google/iam/v3beta/AccessPoliciesClient.java) | [Product Reference](https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/n/a) |

Service Description: Manages Identity and Access Management (IAM) access policies.

This class provides the ability to make remote calls to the backing service through method
calls that map to API methods. Sample code to get started:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       AccessPolicyName name =
           AccessPolicyName.ofProjectLocationAccessPolicyName(
               "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]");
       AccessPolicy response = accessPoliciesClient.getAccessPolicy(name);
     }
     
Note: close() needs to be called on the AccessPoliciesClient object to clean up resources such
as threads. In the example above, try-with-resources is used, which automatically calls close().

| Method | Description | Method Variants |
|---|---|---|
| CreateAccessPolicy | Creates an access policy, and returns a long running operation. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createAccessPolicyAsync(CreateAccessPolicyRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createAccessPolicyAsync(FolderLocationName parent, AccessPolicy accessPolicy, String accessPolicyId) - createAccessPolicyAsync(LocationName parent, AccessPolicy accessPolicy, String accessPolicyId) - createAccessPolicyAsync(OrganizationLocationName parent, AccessPolicy accessPolicy, String accessPolicyId) - createAccessPolicyAsync(String parent, AccessPolicy accessPolicy, String accessPolicyId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createAccessPolicyOperationCallable() - createAccessPolicyCallable() |
| GetAccessPolicy | Gets an access policy. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getAccessPolicy(GetAccessPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getAccessPolicy(AccessPolicyName name) - getAccessPolicy(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getAccessPolicyCallable() |
| UpdateAccessPolicy | Updates an access policy. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateAccessPolicyAsync(UpdateAccessPolicyRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateAccessPolicyOperationCallable() - updateAccessPolicyCallable() |
| DeleteAccessPolicy | Deletes an access policy. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteAccessPolicyAsync(DeleteAccessPolicyRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteAccessPolicyAsync(AccessPolicyName name) - deleteAccessPolicyAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteAccessPolicyOperationCallable() - deleteAccessPolicyCallable() |
| ListAccessPolicies | Lists access policies. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listAccessPolicies(ListAccessPoliciesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listAccessPolicies(FolderLocationName parent) - listAccessPolicies(LocationName parent) - listAccessPolicies(OrganizationLocationName parent) - listAccessPolicies(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listAccessPoliciesPagedCallable() - listAccessPoliciesCallable() |
| SearchAccessPolicyBindings | Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings permission on that policy. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - searchAccessPolicyBindings(SearchAccessPolicyBindingsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - searchAccessPolicyBindings(AccessPolicyName name) - searchAccessPolicyBindings(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - searchAccessPolicyBindingsPagedCallable() - searchAccessPolicyBindingsCallable() |
[Methods]

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with
these names, this class includes a format method for each type of name, and additionally a parse
method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of AccessPoliciesSettings to
create(). For example:

To customize credentials:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     AccessPoliciesSettings accessPoliciesSettings =
         AccessPoliciesSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create(accessPoliciesSettings);
     
To customize the endpoint:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     AccessPoliciesSettings accessPoliciesSettings =
         AccessPoliciesSettings.newBuilder().setEndpoint(myEndpoint).build();
     AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create(accessPoliciesSettings);
     
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
the wire:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     AccessPoliciesSettings accessPoliciesSettings =
         AccessPoliciesSettings.newHttpJsonBuilder().build();
     AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create(accessPoliciesSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> AccessPoliciesClient

## Static Methods

### create()

    public static final AccessPoliciesClient create()

Constructs an instance of AccessPoliciesClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(AccessPoliciesSettings settings)

    public static final AccessPoliciesClient create(AccessPoliciesSettings settings)

Constructs an instance of AccessPoliciesClient, using the given settings. The channels are
created based on the settings passed in, or defaults for any settings that are not set.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(AccessPoliciesStub stub)

    public static final AccessPoliciesClient create(AccessPoliciesStub stub)

Constructs an instance of AccessPoliciesClient, using the given stub for making calls. This is
for advanced usage - prefer using create(AccessPoliciesSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.stub.AccessPoliciesStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient` |   |

## Constructors

### AccessPoliciesClient(AccessPoliciesSettings settings)

    protected AccessPoliciesClient(AccessPoliciesSettings settings)

Constructs an instance of AccessPoliciesClient, using the given settings. This is protected so
that it is easy to make a subclass, but otherwise, the static factory methods should be
preferred.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesSettings` |

### AccessPoliciesClient(AccessPoliciesStub stub)

    protected AccessPoliciesClient(AccessPoliciesStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.stub.AccessPoliciesStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createAccessPolicyAsync(CreateAccessPolicyRequest request)

    public final OperationFuture<AccessPolicy,OperationMetadata> createAccessPolicyAsync(CreateAccessPolicyRequest request)

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       CreateAccessPolicyRequest request =
           CreateAccessPolicyRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setAccessPolicyId("accessPolicyId97623921")
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       AccessPolicy response = accessPoliciesClient.createAccessPolicyAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.CreateAccessPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### createAccessPolicyAsync(FolderLocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

    public final OperationFuture<AccessPolicy,OperationMetadata> createAccessPolicyAsync(FolderLocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
       AccessPolicy accessPolicy = AccessPolicy.newBuilder().build();
       String accessPolicyId = "accessPolicyId97623921";
       AccessPolicy response =
           accessPoliciesClient.createAccessPolicyAsync(parent, accessPolicy, accessPolicyId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.FolderLocationName` Required. The parent resource where this access policy will be created. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |
| `accessPolicy` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` Required. The access policy to create. |
| `accessPolicyId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the access policy, which will become the final component of the access policy's resource name. This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /a-z{2,62}/. This value must be unique among all access policies with the same parent. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### createAccessPolicyAsync(LocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

    public final OperationFuture<AccessPolicy,OperationMetadata> createAccessPolicyAsync(LocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       AccessPolicy accessPolicy = AccessPolicy.newBuilder().build();
       String accessPolicyId = "accessPolicyId97623921";
       AccessPolicy response =
           accessPoliciesClient.createAccessPolicyAsync(parent, accessPolicy, accessPolicyId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.LocationName` Required. The parent resource where this access policy will be created. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |
| `accessPolicy` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` Required. The access policy to create. |
| `accessPolicyId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the access policy, which will become the final component of the access policy's resource name. This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /a-z{2,62}/. This value must be unique among all access policies with the same parent. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### createAccessPolicyAsync(OrganizationLocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

    public final OperationFuture<AccessPolicy,OperationMetadata> createAccessPolicyAsync(OrganizationLocationName parent, AccessPolicy accessPolicy, String accessPolicyId)

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
       AccessPolicy accessPolicy = AccessPolicy.newBuilder().build();
       String accessPolicyId = "accessPolicyId97623921";
       AccessPolicy response =
           accessPoliciesClient.createAccessPolicyAsync(parent, accessPolicy, accessPolicyId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OrganizationLocationName` Required. The parent resource where this access policy will be created. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |
| `accessPolicy` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` Required. The access policy to create. |
| `accessPolicyId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the access policy, which will become the final component of the access policy's resource name. This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /a-z{2,62}/. This value must be unique among all access policies with the same parent. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### createAccessPolicyAsync(String parent, AccessPolicy accessPolicy, String accessPolicyId)

    public final OperationFuture<AccessPolicy,OperationMetadata> createAccessPolicyAsync(String parent, AccessPolicy accessPolicy, String accessPolicyId)

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
       AccessPolicy accessPolicy = AccessPolicy.newBuilder().build();
       String accessPolicyId = "accessPolicyId97623921";
       AccessPolicy response =
           accessPoliciesClient.createAccessPolicyAsync(parent, accessPolicy, accessPolicyId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource where this access policy will be created. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |
| `accessPolicy` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` Required. The access policy to create. |
| `accessPolicyId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The ID to use for the access policy, which will become the final component of the access policy's resource name. This value must start with a lowercase letter followed by up to 62 lowercase letters, numbers, hyphens, or dots. Pattern, /a-z{2,62}/. This value must be unique among all access policies with the same parent. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### createAccessPolicyCallable()

    public final UnaryCallable<CreateAccessPolicyRequest,Operation> createAccessPolicyCallable()

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       CreateAccessPolicyRequest request =
           CreateAccessPolicyRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setAccessPolicyId("accessPolicyId97623921")
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       ApiFuture<Operation> future =
           accessPoliciesClient.createAccessPolicyCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.CreateAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createAccessPolicyOperationCallable()

    public final OperationCallable<CreateAccessPolicyRequest,AccessPolicy,OperationMetadata> createAccessPolicyOperationCallable()

Creates an access policy, and returns a long running operation.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       CreateAccessPolicyRequest request =
           CreateAccessPolicyRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setAccessPolicyId("accessPolicyId97623921")
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       OperationFuture<AccessPolicy, OperationMetadata> future =
           accessPoliciesClient.createAccessPolicyOperationCallable().futureCall(request);
       // Do something.
       AccessPolicy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.CreateAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### deleteAccessPolicyAsync(AccessPolicyName name)

    public final OperationFuture<Empty,OperationMetadata> deleteAccessPolicyAsync(AccessPolicyName name)

Deletes an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       AccessPolicyName name =
           AccessPolicyName.ofProjectLocationAccessPolicyName(
               "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]");
       accessPoliciesClient.deleteAccessPolicyAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicyName` Required. The name of the access policy to delete. Format: `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### deleteAccessPolicyAsync(DeleteAccessPolicyRequest request)

    public final OperationFuture<Empty,OperationMetadata> deleteAccessPolicyAsync(DeleteAccessPolicyRequest request)

Deletes an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       DeleteAccessPolicyRequest request =
           DeleteAccessPolicyRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofProjectLocationAccessPolicyName(
                           "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setEtag("etag3123477")
               .setValidateOnly(true)
               .setForce(true)
               .build();
       accessPoliciesClient.deleteAccessPolicyAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.DeleteAccessPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### deleteAccessPolicyAsync(String name)

    public final OperationFuture<Empty,OperationMetadata> deleteAccessPolicyAsync(String name)

Deletes an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       String name =
           AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                   "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
               .toString();
       accessPoliciesClient.deleteAccessPolicyAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the access policy to delete. Format: `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### deleteAccessPolicyCallable()

    public final UnaryCallable<DeleteAccessPolicyRequest,Operation> deleteAccessPolicyCallable()

Deletes an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       DeleteAccessPolicyRequest request =
           DeleteAccessPolicyRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofProjectLocationAccessPolicyName(
                           "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setEtag("etag3123477")
               .setValidateOnly(true)
               .setForce(true)
               .build();
       ApiFuture<Operation> future =
           accessPoliciesClient.deleteAccessPolicyCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.DeleteAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteAccessPolicyOperationCallable()

    public final OperationCallable<DeleteAccessPolicyRequest,Empty,OperationMetadata> deleteAccessPolicyOperationCallable()

Deletes an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       DeleteAccessPolicyRequest request =
           DeleteAccessPolicyRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofProjectLocationAccessPolicyName(
                           "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setEtag("etag3123477")
               .setValidateOnly(true)
               .setForce(true)
               .build();
       OperationFuture<Empty, OperationMetadata> future =
           accessPoliciesClient.deleteAccessPolicyOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.DeleteAccessPolicyRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### getAccessPolicy(AccessPolicyName name)

    public final AccessPolicy getAccessPolicy(AccessPolicyName name)

Gets an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       AccessPolicyName name =
           AccessPolicyName.ofProjectLocationAccessPolicyName(
               "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]");
       AccessPolicy response = accessPoliciesClient.getAccessPolicy(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicyName` Required. The name of the access policy to retrieve. Format: `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` |   |

### getAccessPolicy(GetAccessPolicyRequest request)

    public final AccessPolicy getAccessPolicy(GetAccessPolicyRequest request)

Gets an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       GetAccessPolicyRequest request =
           GetAccessPolicyRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofProjectLocationAccessPolicyName(
                           "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .build();
       AccessPolicy response = accessPoliciesClient.getAccessPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.GetAccessPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` |   |

### getAccessPolicy(String name)

    public final AccessPolicy getAccessPolicy(String name)

Gets an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       String name =
           AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                   "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
               .toString();
       AccessPolicy response = accessPoliciesClient.getAccessPolicy(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the access policy to retrieve. Format: `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy` |   |

### getAccessPolicyCallable()

    public final UnaryCallable<GetAccessPolicyRequest,AccessPolicy> getAccessPolicyCallable()

Gets an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       GetAccessPolicyRequest request =
           GetAccessPolicyRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofProjectLocationAccessPolicyName(
                           "[PROJECT]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .build();
       ApiFuture<AccessPolicy> future =
           accessPoliciesClient.getAccessPolicyCallable().futureCall(request);
       // Do something.
       AccessPolicy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.GetAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getSettings()

    public final AccessPoliciesSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesSettings` |   |

### getStub()

    public AccessPoliciesStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.stub.AccessPoliciesStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listAccessPolicies(FolderLocationName parent)

    public final AccessPoliciesClient.ListAccessPoliciesPagedResponse listAccessPolicies(FolderLocationName parent)

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       FolderLocationName parent = FolderLocationName.of("[FOLDER]", "[LOCATION]");
       for (AccessPolicy element : accessPoliciesClient.listAccessPolicies(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.FolderLocationName` Required. The parent resource, which owns the collection of access policy resources. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse` |   |

### listAccessPolicies(ListAccessPoliciesRequest request)

    public final AccessPoliciesClient.ListAccessPoliciesPagedResponse listAccessPolicies(ListAccessPoliciesRequest request)

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       ListAccessPoliciesRequest request =
           ListAccessPoliciesRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (AccessPolicy element : accessPoliciesClient.listAccessPolicies(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.ListAccessPoliciesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse` |   |

### listAccessPolicies(LocationName parent)

    public final AccessPoliciesClient.ListAccessPoliciesPagedResponse listAccessPolicies(LocationName parent)

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (AccessPolicy element : accessPoliciesClient.listAccessPolicies(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.LocationName` Required. The parent resource, which owns the collection of access policy resources. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse` |   |

### listAccessPolicies(OrganizationLocationName parent)

    public final AccessPoliciesClient.ListAccessPoliciesPagedResponse listAccessPolicies(OrganizationLocationName parent)

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
       for (AccessPolicy element : accessPoliciesClient.listAccessPolicies(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OrganizationLocationName` Required. The parent resource, which owns the collection of access policy resources. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse` |   |

### listAccessPolicies(String parent)

    public final AccessPoliciesClient.ListAccessPoliciesPagedResponse listAccessPolicies(String parent)

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
       for (AccessPolicy element : accessPoliciesClient.listAccessPolicies(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource, which owns the collection of access policy resources. Format: `projects/{project_id}/locations/{location}` `projects/{project_number}/locations/{location}` `folders/{folder_id}/locations/{location}` `organizations/{organization_id}/locations/{location}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse` |   |

### listAccessPoliciesCallable()

    public final UnaryCallable<ListAccessPoliciesRequest,ListAccessPoliciesResponse> listAccessPoliciesCallable()

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       ListAccessPoliciesRequest request =
           ListAccessPoliciesRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListAccessPoliciesResponse response =
             accessPoliciesClient.listAccessPoliciesCallable().call(request);
         for (AccessPolicy element : response.getAccessPoliciesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.ListAccessPoliciesRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.ListAccessPoliciesResponse>` |   |

### listAccessPoliciesPagedCallable()

    public final UnaryCallable<ListAccessPoliciesRequest,AccessPoliciesClient.ListAccessPoliciesPagedResponse> listAccessPoliciesPagedCallable()

Lists access policies.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       ListAccessPoliciesRequest request =
           ListAccessPoliciesRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<AccessPolicy> future =
           accessPoliciesClient.listAccessPoliciesPagedCallable().futureCall(request);
       // Do something.
       for (AccessPolicy element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.ListAccessPoliciesRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.ListAccessPoliciesPagedResponse>` |   |

### searchAccessPolicyBindings(AccessPolicyName name)

    public final AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse searchAccessPolicyBindings(AccessPolicyName name)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings
permission on that policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       AccessPolicyName name =
           AccessPolicyName.ofOrganizationLocationAccessPolicyName(
               "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]");
       for (PolicyBinding element :
           accessPoliciesClient.searchAccessPolicyBindings(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicyName` Required. The name of the access policy. Format: `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse` |   |

### searchAccessPolicyBindings(SearchAccessPolicyBindingsRequest request)

    public final AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse searchAccessPolicyBindings(SearchAccessPolicyBindingsRequest request)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings
permission on that policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       SearchAccessPolicyBindingsRequest request =
           SearchAccessPolicyBindingsRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                           "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (PolicyBinding element :
           accessPoliciesClient.searchAccessPolicyBindings(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.SearchAccessPolicyBindingsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse` |   |

### searchAccessPolicyBindings(String name)

    public final AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse searchAccessPolicyBindings(String name)

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings
permission on that policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       String name =
           AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                   "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
               .toString();
       for (PolicyBinding element :
           accessPoliciesClient.searchAccessPolicyBindings(name).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the access policy. Format: `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse` |   |

### searchAccessPolicyBindingsCallable()

    public final UnaryCallable<SearchAccessPolicyBindingsRequest,SearchAccessPolicyBindingsResponse> searchAccessPolicyBindingsCallable()

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings
permission on that policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       SearchAccessPolicyBindingsRequest request =
           SearchAccessPolicyBindingsRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                           "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         SearchAccessPolicyBindingsResponse response =
             accessPoliciesClient.searchAccessPolicyBindingsCallable().call(request);
         for (PolicyBinding element : response.getPolicyBindingsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.SearchAccessPolicyBindingsRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.SearchAccessPolicyBindingsResponse>` |   |

### searchAccessPolicyBindingsPagedCallable()

    public final UnaryCallable<SearchAccessPolicyBindingsRequest,AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse> searchAccessPolicyBindingsPagedCallable()

Returns all policy bindings that bind a specific policy if a user has searchPolicyBindings
permission on that policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       SearchAccessPolicyBindingsRequest request =
           SearchAccessPolicyBindingsRequest.newBuilder()
               .setName(
                   AccessPolicyName.ofOrganizationLocationAccessPolicyName(
                           "[ORGANIZATION]", "[LOCATION]", "[ACCESS_POLICY]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<PolicyBinding> future =
           accessPoliciesClient.searchAccessPolicyBindingsPagedCallable().futureCall(request);
       // Do something.
       for (PolicyBinding element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.SearchAccessPolicyBindingsRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPoliciesClient.SearchAccessPolicyBindingsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### updateAccessPolicyAsync(UpdateAccessPolicyRequest request)

    public final OperationFuture<AccessPolicy,OperationMetadata> updateAccessPolicyAsync(UpdateAccessPolicyRequest request)

Updates an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       UpdateAccessPolicyRequest request =
           UpdateAccessPolicyRequest.newBuilder()
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       AccessPolicy response = accessPoliciesClient.updateAccessPolicyAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.UpdateAccessPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |

### updateAccessPolicyCallable()

    public final UnaryCallable<UpdateAccessPolicyRequest,Operation> updateAccessPolicyCallable()

Updates an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       UpdateAccessPolicyRequest request =
           UpdateAccessPolicyRequest.newBuilder()
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       ApiFuture<Operation> future =
           accessPoliciesClient.updateAccessPolicyCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.UpdateAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateAccessPolicyOperationCallable()

    public final OperationCallable<UpdateAccessPolicyRequest,AccessPolicy,OperationMetadata> updateAccessPolicyOperationCallable()

Updates an access policy.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (AccessPoliciesClient accessPoliciesClient = AccessPoliciesClient.create()) {
       UpdateAccessPolicyRequest request =
           UpdateAccessPolicyRequest.newBuilder()
               .setAccessPolicy(AccessPolicy.newBuilder().build())
               .setValidateOnly(true)
               .build();
       OperationFuture<AccessPolicy, OperationMetadata> future =
           accessPoliciesClient.updateAccessPolicyOperationCallable().futureCall(request);
       // Do something.
       AccessPolicy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.UpdateAccessPolicyRequest,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.AccessPolicy,https://docs.cloud.google.com/java/docs/reference/google-iam-policy/latest/com.google.iam.v3beta.OperationMetadata>` |   |