# Class OrgPolicyViolationsPreviewServiceClient (0.72.0)

0.72.0 (latest) 0.70.0 0.67.0 0.66.0 0.64.0 0.62.0 0.61.0 0.59.0 0.57.0 0.55.0 0.54.0 0.53.0 0.52.0 0.51.0 0.49.0 0.47.0 0.46.0 0.43.0 0.42.0 0.41.0 0.39.0 0.38.0 0.37.0 0.36.0 0.35.0 0.34.0 0.33.0 0.32.0 0.31.0 0.30.0 0.28.0 0.27.0 0.26.0 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.0 0.3.0 0.2.0 0.1.0

|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-policysimulator/google-cloud-policysimulator/src/main/java/com/google/cloud/policysimulator/v1/OrgPolicyViolationsPreviewServiceClient.java) | [Product Reference](https://cloud.google.com/policysimulator/docs/overview) |

Service Description: Violations Preview API service for OrgPolicy.

An OrgPolicyViolationsPreview is
a preview of the violations that will exist as soon as a proposed OrgPolicy change is submitted.
To create an
OrgPolicyViolationsPreview, the API
user specifies the changes they wish to make and requests the generation of a preview via
\[GenerateViolationsPreview\]\[\]. the OrgPolicy Simulator service then scans the API user's
currently existing resources to determine these resources violate the newly set OrgPolicy.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       OrgPolicyViolationsPreviewName name =
           OrgPolicyViolationsPreviewName.of(
               "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]");
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient.getOrgPolicyViolationsPreview(name);
     }
     
Note: close() needs to be called on the OrgPolicyViolationsPreviewServiceClient 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 |
|---|---|---|
| ListOrgPolicyViolationsPreviews | ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview in an organization. Each OrgPolicyViolationsPreview is available for at least 7 days. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listOrgPolicyViolationsPreviews(ListOrgPolicyViolationsPreviewsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listOrgPolicyViolationsPreviews(OrganizationLocationName parent) - listOrgPolicyViolationsPreviews(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. - listOrgPolicyViolationsPreviewsPagedCallable() - listOrgPolicyViolationsPreviewsCallable() |
| GetOrgPolicyViolationsPreview | GetOrgPolicyViolationsPreview gets the specified OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for at least 7 days. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getOrgPolicyViolationsPreview(GetOrgPolicyViolationsPreviewRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getOrgPolicyViolationsPreview(OrgPolicyViolationsPreviewName name) - getOrgPolicyViolationsPreview(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. - getOrgPolicyViolationsPreviewCallable() |
| CreateOrgPolicyViolationsPreview | CreateOrgPolicyViolationsPreview creates an OrgPolicyViolationsPreview for the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are inferred from these specified changes. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createOrgPolicyViolationsPreviewAsync(CreateOrgPolicyViolationsPreviewRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createOrgPolicyViolationsPreviewAsync(OrganizationLocationName parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId) - createOrgPolicyViolationsPreviewAsync(String parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createOrgPolicyViolationsPreviewOperationCallable() - createOrgPolicyViolationsPreviewCallable() |
| ListOrgPolicyViolations | ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an OrgPolicyViolationsPreview. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listOrgPolicyViolations(ListOrgPolicyViolationsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listOrgPolicyViolations(OrgPolicyViolationsPreviewName parent) - listOrgPolicyViolations(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. - listOrgPolicyViolationsPagedCallable() - listOrgPolicyViolationsCallable() |
[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
OrgPolicyViolationsPreviewServiceSettings 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
     OrgPolicyViolationsPreviewServiceSettings orgPolicyViolationsPreviewServiceSettings =
         OrgPolicyViolationsPreviewServiceSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create(orgPolicyViolationsPreviewServiceSettings);
     
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
     OrgPolicyViolationsPreviewServiceSettings orgPolicyViolationsPreviewServiceSettings =
         OrgPolicyViolationsPreviewServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
     OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create(orgPolicyViolationsPreviewServiceSettings);
     
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
     OrgPolicyViolationsPreviewServiceSettings orgPolicyViolationsPreviewServiceSettings =
         OrgPolicyViolationsPreviewServiceSettings.newHttpJsonBuilder().build();
     OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create(orgPolicyViolationsPreviewServiceSettings);
     
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) \> OrgPolicyViolationsPreviewServiceClient

## Static Methods

### create()

    public static final OrgPolicyViolationsPreviewServiceClient create()

Constructs an instance of OrgPolicyViolationsPreviewServiceClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient` |   |

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

### create(OrgPolicyViolationsPreviewServiceSettings settings)

    public static final OrgPolicyViolationsPreviewServiceClient create(OrgPolicyViolationsPreviewServiceSettings settings)

Constructs an instance of OrgPolicyViolationsPreviewServiceClient, 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient` |   |

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

### create(OrgPolicyViolationsPreviewServiceStub stub)

    public static final OrgPolicyViolationsPreviewServiceClient create(OrgPolicyViolationsPreviewServiceStub stub)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.stub.OrgPolicyViolationsPreviewServiceStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient` |   |

## Constructors

### OrgPolicyViolationsPreviewServiceClient(OrgPolicyViolationsPreviewServiceSettings settings)

    protected OrgPolicyViolationsPreviewServiceClient(OrgPolicyViolationsPreviewServiceSettings settings)

Constructs an instance of OrgPolicyViolationsPreviewServiceClient, 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceSettings` |

### OrgPolicyViolationsPreviewServiceClient(OrgPolicyViolationsPreviewServiceStub stub)

    protected OrgPolicyViolationsPreviewServiceClient(OrgPolicyViolationsPreviewServiceStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.stub.OrgPolicyViolationsPreviewServiceStub` |

## 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()

### createOrgPolicyViolationsPreviewAsync(CreateOrgPolicyViolationsPreviewRequest request)

    public final OperationFuture<OrgPolicyViolationsPreview,CreateOrgPolicyViolationsPreviewOperationMetadata> createOrgPolicyViolationsPreviewAsync(CreateOrgPolicyViolationsPreviewRequest request)

CreateOrgPolicyViolationsPreview creates an
OrgPolicyViolationsPreview for
the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The
changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are
inferred from these specified changes.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       CreateOrgPolicyViolationsPreviewRequest request =
           CreateOrgPolicyViolationsPreviewRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setOrgPolicyViolationsPreview(OrgPolicyViolationsPreview.newBuilder().build())
               .setOrgPolicyViolationsPreviewId("orgPolicyViolationsPreviewId2098912671")
               .build();
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient
               .createOrgPolicyViolationsPreviewAsync(request)
               .get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewRequest` 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewOperationMetadata>` |   |

### createOrgPolicyViolationsPreviewAsync(OrganizationLocationName parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId)

    public final OperationFuture<OrgPolicyViolationsPreview,CreateOrgPolicyViolationsPreviewOperationMetadata> createOrgPolicyViolationsPreviewAsync(OrganizationLocationName parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId)

CreateOrgPolicyViolationsPreview creates an
OrgPolicyViolationsPreview for
the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The
changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are
inferred from these specified changes.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
       OrgPolicyViolationsPreview orgPolicyViolationsPreview =
           OrgPolicyViolationsPreview.newBuilder().build();
       String orgPolicyViolationsPreviewId = "orgPolicyViolationsPreviewId2098912671";
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient
               .createOrgPolicyViolationsPreviewAsync(
                   parent, orgPolicyViolationsPreview, orgPolicyViolationsPreviewId)
               .get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrganizationLocationName` Required. The organization under which this OrgPolicyViolationsPreview will be created. Example: `organizations/my-example-org/locations/global` |
| `orgPolicyViolationsPreview` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview` Required. The OrgPolicyViolationsPreview to generate. |
| `orgPolicyViolationsPreviewId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. An optional user-specified ID for the OrgPolicyViolationsPreview. If not provided, a random ID will be generated. |

| **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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewOperationMetadata>` |   |

### createOrgPolicyViolationsPreviewAsync(String parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId)

    public final OperationFuture<OrgPolicyViolationsPreview,CreateOrgPolicyViolationsPreviewOperationMetadata> createOrgPolicyViolationsPreviewAsync(String parent, OrgPolicyViolationsPreview orgPolicyViolationsPreview, String orgPolicyViolationsPreviewId)

CreateOrgPolicyViolationsPreview creates an
OrgPolicyViolationsPreview for
the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The
changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are
inferred from these specified changes.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
       OrgPolicyViolationsPreview orgPolicyViolationsPreview =
           OrgPolicyViolationsPreview.newBuilder().build();
       String orgPolicyViolationsPreviewId = "orgPolicyViolationsPreviewId2098912671";
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient
               .createOrgPolicyViolationsPreviewAsync(
                   parent, orgPolicyViolationsPreview, orgPolicyViolationsPreviewId)
               .get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The organization under which this OrgPolicyViolationsPreview will be created. Example: `organizations/my-example-org/locations/global` |
| `orgPolicyViolationsPreview` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview` Required. The OrgPolicyViolationsPreview to generate. |
| `orgPolicyViolationsPreviewId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. An optional user-specified ID for the OrgPolicyViolationsPreview. If not provided, a random ID will be generated. |

| **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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewOperationMetadata>` |   |

### createOrgPolicyViolationsPreviewCallable()

    public final UnaryCallable<CreateOrgPolicyViolationsPreviewRequest,Operation> createOrgPolicyViolationsPreviewCallable()

CreateOrgPolicyViolationsPreview creates an
OrgPolicyViolationsPreview for
the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The
changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are
inferred from these specified changes.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       CreateOrgPolicyViolationsPreviewRequest request =
           CreateOrgPolicyViolationsPreviewRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setOrgPolicyViolationsPreview(OrgPolicyViolationsPreview.newBuilder().build())
               .setOrgPolicyViolationsPreviewId("orgPolicyViolationsPreviewId2098912671")
               .build();
       ApiFuture<Operation> future =
           orgPolicyViolationsPreviewServiceClient
               .createOrgPolicyViolationsPreviewCallable()
               .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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createOrgPolicyViolationsPreviewOperationCallable()

    public final OperationCallable<CreateOrgPolicyViolationsPreviewRequest,OrgPolicyViolationsPreview,CreateOrgPolicyViolationsPreviewOperationMetadata> createOrgPolicyViolationsPreviewOperationCallable()

CreateOrgPolicyViolationsPreview creates an
OrgPolicyViolationsPreview for
the proposed changes in the provided \[OrgPolicyViolationsPreview.OrgPolicyOverlay\]\[\]. The
changes to OrgPolicy are specified by this `OrgPolicyOverlay`. The resources to scan are
inferred from these specified changes.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       CreateOrgPolicyViolationsPreviewRequest request =
           CreateOrgPolicyViolationsPreviewRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setOrgPolicyViolationsPreview(OrgPolicyViolationsPreview.newBuilder().build())
               .setOrgPolicyViolationsPreviewId("orgPolicyViolationsPreviewId2098912671")
               .build();
       OperationFuture<OrgPolicyViolationsPreview, CreateOrgPolicyViolationsPreviewOperationMetadata>
           future =
               orgPolicyViolationsPreviewServiceClient
                   .createOrgPolicyViolationsPreviewOperationCallable()
                   .futureCall(request);
       // Do something.
       OrgPolicyViolationsPreview 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.CreateOrgPolicyViolationsPreviewOperationMetadata>` |   |

### 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` |   |

### getOrgPolicyViolationsPreview(GetOrgPolicyViolationsPreviewRequest request)

    public final OrgPolicyViolationsPreview getOrgPolicyViolationsPreview(GetOrgPolicyViolationsPreviewRequest request)

GetOrgPolicyViolationsPreview gets the specified
OrgPolicyViolationsPreview. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       GetOrgPolicyViolationsPreviewRequest request =
           GetOrgPolicyViolationsPreviewRequest.newBuilder()
               .setName(
                   OrgPolicyViolationsPreviewName.of(
                           "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
                       .toString())
               .build();
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient.getOrgPolicyViolationsPreview(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.GetOrgPolicyViolationsPreviewRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview` |   |

### getOrgPolicyViolationsPreview(OrgPolicyViolationsPreviewName name)

    public final OrgPolicyViolationsPreview getOrgPolicyViolationsPreview(OrgPolicyViolationsPreviewName name)

GetOrgPolicyViolationsPreview gets the specified
OrgPolicyViolationsPreview. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       OrgPolicyViolationsPreviewName name =
           OrgPolicyViolationsPreviewName.of(
               "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]");
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient.getOrgPolicyViolationsPreview(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewName` Required. The name of the OrgPolicyViolationsPreview to get. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview` |   |

### getOrgPolicyViolationsPreview(String name)

    public final OrgPolicyViolationsPreview getOrgPolicyViolationsPreview(String name)

GetOrgPolicyViolationsPreview gets the specified
OrgPolicyViolationsPreview. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       String name =
           OrgPolicyViolationsPreviewName.of(
                   "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
               .toString();
       OrgPolicyViolationsPreview response =
           orgPolicyViolationsPreviewServiceClient.getOrgPolicyViolationsPreview(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the OrgPolicyViolationsPreview to get. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview` |   |

### getOrgPolicyViolationsPreviewCallable()

    public final UnaryCallable<GetOrgPolicyViolationsPreviewRequest,OrgPolicyViolationsPreview> getOrgPolicyViolationsPreviewCallable()

GetOrgPolicyViolationsPreview gets the specified
OrgPolicyViolationsPreview. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       GetOrgPolicyViolationsPreviewRequest request =
           GetOrgPolicyViolationsPreviewRequest.newBuilder()
               .setName(
                   OrgPolicyViolationsPreviewName.of(
                           "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
                       .toString())
               .build();
       ApiFuture<OrgPolicyViolationsPreview> future =
           orgPolicyViolationsPreviewServiceClient
               .getOrgPolicyViolationsPreviewCallable()
               .futureCall(request);
       // Do something.
       OrgPolicyViolationsPreview 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.GetOrgPolicyViolationsPreviewRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreview>` |   |

### getSettings()

    public final OrgPolicyViolationsPreviewServiceSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceSettings` |   |

### getStub()

    public OrgPolicyViolationsPreviewServiceStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.stub.OrgPolicyViolationsPreviewServiceStub` |   |

### 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` |   |

### listOrgPolicyViolations(ListOrgPolicyViolationsRequest request)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse listOrgPolicyViolations(ListOrgPolicyViolationsRequest request)

ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an
OrgPolicyViolationsPreview.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsRequest request =
           ListOrgPolicyViolationsRequest.newBuilder()
               .setParent(
                   OrgPolicyViolationsPreviewName.of(
                           "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (OrgPolicyViolation element :
           orgPolicyViolationsPreviewServiceClient.listOrgPolicyViolations(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse` |   |

### listOrgPolicyViolations(OrgPolicyViolationsPreviewName parent)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse listOrgPolicyViolations(OrgPolicyViolationsPreviewName parent)

ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an
OrgPolicyViolationsPreview.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       OrgPolicyViolationsPreviewName parent =
           OrgPolicyViolationsPreviewName.of(
               "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]");
       for (OrgPolicyViolation element :
           orgPolicyViolationsPreviewServiceClient.listOrgPolicyViolations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewName` Required. The OrgPolicyViolationsPreview to get OrgPolicyViolations from. Format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse` |   |

### listOrgPolicyViolations(String parent)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse listOrgPolicyViolations(String parent)

ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an
OrgPolicyViolationsPreview.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       String parent =
           OrgPolicyViolationsPreviewName.of(
                   "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
               .toString();
       for (OrgPolicyViolation element :
           orgPolicyViolationsPreviewServiceClient.listOrgPolicyViolations(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The OrgPolicyViolationsPreview to get OrgPolicyViolations from. Format: organizations/{organization}/locations/{location}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreview} |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse` |   |

### listOrgPolicyViolationsCallable()

    public final UnaryCallable<ListOrgPolicyViolationsRequest,ListOrgPolicyViolationsResponse> listOrgPolicyViolationsCallable()

ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an
OrgPolicyViolationsPreview.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsRequest request =
           ListOrgPolicyViolationsRequest.newBuilder()
               .setParent(
                   OrgPolicyViolationsPreviewName.of(
                           "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListOrgPolicyViolationsResponse response =
             orgPolicyViolationsPreviewServiceClient.listOrgPolicyViolationsCallable().call(request);
         for (OrgPolicyViolation element : response.getOrgPolicyViolationsList()) {
           // 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsResponse>` |   |

### listOrgPolicyViolationsPagedCallable()

    public final UnaryCallable<ListOrgPolicyViolationsRequest,OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse> listOrgPolicyViolationsPagedCallable()

ListOrgPolicyViolations lists the \[OrgPolicyViolations\]\[\] that are present in an
OrgPolicyViolationsPreview.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsRequest request =
           ListOrgPolicyViolationsRequest.newBuilder()
               .setParent(
                   OrgPolicyViolationsPreviewName.of(
                           "[ORGANIZATION]", "[LOCATION]", "[ORG_POLICY_VIOLATIONS_PREVIEW]")
                       .toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<OrgPolicyViolation> future =
           orgPolicyViolationsPreviewServiceClient
               .listOrgPolicyViolationsPagedCallable()
               .futureCall(request);
       // Do something.
       for (OrgPolicyViolation 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPagedResponse>` |   |

### listOrgPolicyViolationsPreviews(ListOrgPolicyViolationsPreviewsRequest request)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse listOrgPolicyViolationsPreviews(ListOrgPolicyViolationsPreviewsRequest request)

ListOrgPolicyViolationsPreviews lists each
OrgPolicyViolationsPreview in an
organization. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsPreviewsRequest request =
           ListOrgPolicyViolationsPreviewsRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (OrgPolicyViolationsPreview element :
           orgPolicyViolationsPreviewServiceClient
               .listOrgPolicyViolationsPreviews(request)
               .iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsPreviewsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse` |   |

### listOrgPolicyViolationsPreviews(OrganizationLocationName parent)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse listOrgPolicyViolationsPreviews(OrganizationLocationName parent)

ListOrgPolicyViolationsPreviews lists each
OrgPolicyViolationsPreview in an
organization. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       OrganizationLocationName parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]");
       for (OrgPolicyViolationsPreview element :
           orgPolicyViolationsPreviewServiceClient
               .listOrgPolicyViolationsPreviews(parent)
               .iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrganizationLocationName` Required. The parent the violations are scoped to. Format: `organizations/{organization}/locations/{location}` Example: `organizations/my-example-org/locations/global` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse` |   |

### listOrgPolicyViolationsPreviews(String parent)

    public final OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse listOrgPolicyViolationsPreviews(String parent)

ListOrgPolicyViolationsPreviews lists each
OrgPolicyViolationsPreview in an
organization. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       String parent = OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString();
       for (OrgPolicyViolationsPreview element :
           orgPolicyViolationsPreviewServiceClient
               .listOrgPolicyViolationsPreviews(parent)
               .iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent the violations are scoped to. Format: `organizations/{organization}/locations/{location}` Example: `organizations/my-example-org/locations/global` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse` |   |

### listOrgPolicyViolationsPreviewsCallable()

    public final UnaryCallable<ListOrgPolicyViolationsPreviewsRequest,ListOrgPolicyViolationsPreviewsResponse> listOrgPolicyViolationsPreviewsCallable()

ListOrgPolicyViolationsPreviews lists each
OrgPolicyViolationsPreview in an
organization. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsPreviewsRequest request =
           ListOrgPolicyViolationsPreviewsRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListOrgPolicyViolationsPreviewsResponse response =
             orgPolicyViolationsPreviewServiceClient
                 .listOrgPolicyViolationsPreviewsCallable()
                 .call(request);
         for (OrgPolicyViolationsPreview element : response.getOrgPolicyViolationsPreviewsList()) {
           // 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsPreviewsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsPreviewsResponse>` |   |

### listOrgPolicyViolationsPreviewsPagedCallable()

    public final UnaryCallable<ListOrgPolicyViolationsPreviewsRequest,OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse> listOrgPolicyViolationsPreviewsPagedCallable()

ListOrgPolicyViolationsPreviews lists each
OrgPolicyViolationsPreview in an
organization. Each
OrgPolicyViolationsPreview is
available for at least 7 days.

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 (OrgPolicyViolationsPreviewServiceClient orgPolicyViolationsPreviewServiceClient =
         OrgPolicyViolationsPreviewServiceClient.create()) {
       ListOrgPolicyViolationsPreviewsRequest request =
           ListOrgPolicyViolationsPreviewsRequest.newBuilder()
               .setParent(OrganizationLocationName.of("[ORGANIZATION]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<OrgPolicyViolationsPreview> future =
           orgPolicyViolationsPreviewServiceClient
               .listOrgPolicyViolationsPreviewsPagedCallable()
               .futureCall(request);
       // Do something.
       for (OrgPolicyViolationsPreview 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-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.ListOrgPolicyViolationsPreviewsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-policysimulator/latest/com.google.cloud.policysimulator.v1.OrgPolicyViolationsPreviewServiceClient.ListOrgPolicyViolationsPreviewsPagedResponse>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()