# Class ContainerAnalysisV1Beta1Client (2.94.0)

2.94.0 (latest) 2.92.0 2.89.0 2.88.0 2.86.0 2.84.0 2.83.0 2.82.0 2.81.0 2.79.0 2.77.0 2.76.0 2.75.0 2.74.0 2.73.0 2.71.0 2.69.0 2.68.0 2.65.0 2.64.0 2.63.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.50.0 2.49.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.11.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.10 2.3.1 2.2.16

> [!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-containeranalysis/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java) | [Product Reference](https://cloud.google.com/container-registry/docs/container-analysis) |

Service Description: Retrieves analysis results of Cloud components such as Docker container
images. The Container Analysis API is an implementation of the [Grafeas](https://grafeas.io) API.

Analysis results are stored as a series of occurrences. An `Occurrence` contains information
about a specific analysis instance on a resource. An occurrence refers to a `Note`. A note
contains details describing the analysis and is generally stored in a separate project, called a
`Provider`. Multiple occurrences can refer to the same note.

For example, an SSL vulnerability could affect multiple images. In this case, there would be
one note for the vulnerability and an occurrence for each image with the vulnerability referring
to that note.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ResourceName resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "projects/project-8432/notes/note-8432";
             }
           };
       Policy policy = Policy.newBuilder().build();
       Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy);
     }
     
Note: close() needs to be called on the ContainerAnalysisV1Beta1Client 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 |
|---|---|---|
| SetIamPolicy | Sets the access control policy on the specified note or occurrence. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or an occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - setIamPolicy(SetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - setIamPolicy(ResourceName resource, Policy policy) - setIamPolicy(String resource, Policy policy) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - setIamPolicyCallable() |
| GetIamPolicy | Gets the access control policy for a note or an occurrence resource. Requires `containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy` permission if the resource is a note or occurrence, respectively. The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getIamPolicy(GetIamPolicyRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getIamPolicy(ResourceName resource) - getIamPolicy(String resource) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getIamPolicyCallable() |
| TestIamPermissions | Returns the permissions that a caller has on the specified note or occurrence. Requires list permission on the project (for example, `containeranalysis.notes.list`). The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - testIamPermissions(TestIamPermissionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - testIamPermissions(ResourceName resource, List\<String\> permissions) - testIamPermissions(String resource, List\<String\> permissions) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - testIamPermissionsCallable() |
| GeneratePackagesSummary | Gets a summary of the packages within a given resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - generatePackagesSummary(GeneratePackagesSummaryRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - generatePackagesSummaryCallable() |
| ExportSBOM | Generates an SBOM and other dependency information for the given resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - exportSBOM(ExportSBOMRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - exportSBOMCallable() |
[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
ContainerAnalysisV1Beta1Settings 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
     ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
         ContainerAnalysisV1Beta1Settings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
     
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
     ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
         ContainerAnalysisV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
     ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
     
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
     ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
         ContainerAnalysisV1Beta1Settings.newHttpJsonBuilder().build();
     ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
     
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) \> ContainerAnalysisV1Beta1Client

## Static Methods

### create()

    public static final ContainerAnalysisV1Beta1Client create()

Constructs an instance of ContainerAnalysisV1Beta1Client with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client` |   |

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

### create(ContainerAnalysisV1Beta1Settings settings)

    public static final ContainerAnalysisV1Beta1Client create(ContainerAnalysisV1Beta1Settings settings)

Constructs an instance of ContainerAnalysisV1Beta1Client, 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-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Settings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client` |   |

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

### create(ContainerAnalysisV1Beta1Stub stub)

    public static final ContainerAnalysisV1Beta1Client create(ContainerAnalysisV1Beta1Stub stub)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1Stub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client` |   |

## Constructors

### ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Settings settings)

    protected ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Settings settings)

Constructs an instance of ContainerAnalysisV1Beta1Client, 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-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Settings` |

### ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Stub stub)

    protected ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Stub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1Stub` |

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

### exportSBOM(ExportSBOMRequest request)

    public final ExportSBOMResponse exportSBOM(ExportSBOMRequest request)

Generates an SBOM and other dependency information for the given resource.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ExportSBOMRequest request = ExportSBOMRequest.newBuilder().setName("name3373707").build();
       ExportSBOMResponse response = containerAnalysisV1Beta1Client.exportSBOM(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.containeranalysis.v1beta1.ExportSBOMRequest` 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-containeranalysis/latest/com.google.containeranalysis.v1beta1.ExportSBOMResponse` |   |

### exportSBOMCallable()

    public final UnaryCallable<ExportSBOMRequest,ExportSBOMResponse> exportSBOMCallable()

Generates an SBOM and other dependency information for the given resource.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ExportSBOMRequest request = ExportSBOMRequest.newBuilder().setName("name3373707").build();
       ApiFuture<ExportSBOMResponse> future =
           containerAnalysisV1Beta1Client.exportSBOMCallable().futureCall(request);
       // Do something.
       ExportSBOMResponse 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-containeranalysis/latest/com.google.containeranalysis.v1beta1.ExportSBOMRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.containeranalysis.v1beta1.ExportSBOMResponse>` |   |

### generatePackagesSummary(GeneratePackagesSummaryRequest request)

    public final PackagesSummaryResponse generatePackagesSummary(GeneratePackagesSummaryRequest request)

Gets a summary of the packages within a given resource.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       GeneratePackagesSummaryRequest request =
           GeneratePackagesSummaryRequest.newBuilder().setName("name3373707").build();
       PackagesSummaryResponse response =
           containerAnalysisV1Beta1Client.generatePackagesSummary(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.containeranalysis.v1beta1.GeneratePackagesSummaryRequest` 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-containeranalysis/latest/com.google.containeranalysis.v1beta1.PackagesSummaryResponse` |   |

### generatePackagesSummaryCallable()

    public final UnaryCallable<GeneratePackagesSummaryRequest,PackagesSummaryResponse> generatePackagesSummaryCallable()

Gets a summary of the packages within a given resource.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       GeneratePackagesSummaryRequest request =
           GeneratePackagesSummaryRequest.newBuilder().setName("name3373707").build();
       ApiFuture<PackagesSummaryResponse> future =
           containerAnalysisV1Beta1Client.generatePackagesSummaryCallable().futureCall(request);
       // Do something.
       PackagesSummaryResponse 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-containeranalysis/latest/com.google.containeranalysis.v1beta1.GeneratePackagesSummaryRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.containeranalysis.v1beta1.PackagesSummaryResponse>` |   |

### getIamPolicy(ResourceName resource)

    public final Policy getIamPolicy(ResourceName resource)

Gets the access control policy for a note or an occurrence resource. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ResourceName resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "projects/project-8432/notes/note-8432";
             }
           };
       Policy response = containerAnalysisV1Beta1Client.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(GetIamPolicyRequest request)

    public final Policy getIamPolicy(GetIamPolicyRequest request)

Gets the access control policy for a note or an occurrence resource. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource("GetIamPolicyRequest-1527610370".toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       Policy response = containerAnalysisV1Beta1Client.getIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.GetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicy(String resource)

    public final Policy getIamPolicy(String resource)

Gets the access control policy for a note or an occurrence resource. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       String resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "resource-341064690");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "resource-341064690";
             }
           }.toString();
       Policy response = containerAnalysisV1Beta1Client.getIamPolicy(resource);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### getIamPolicyCallable()

    public final UnaryCallable<GetIamPolicyRequest,Policy> getIamPolicyCallable()

Gets the access control policy for a note or an occurrence resource. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       GetIamPolicyRequest request =
           GetIamPolicyRequest.newBuilder()
               .setResource("GetIamPolicyRequest-1527610370".toString())
               .setOptions(GetPolicyOptions.newBuilder().build())
               .build();
       ApiFuture<Policy> future =
           containerAnalysisV1Beta1Client.getIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### getSettings()

    public final ContainerAnalysisV1Beta1Settings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Settings` |   |

### getStub()

    public ContainerAnalysisV1Beta1Stub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-containeranalysis/latest/com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1Stub` |   |

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

### setIamPolicy(ResourceName resource, Policy policy)

    public final Policy setIamPolicy(ResourceName resource, Policy policy)

Sets the access control policy on the specified note or occurrence. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or an occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ResourceName resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "projects/project-8432/notes/note-8432";
             }
           };
       Policy policy = Policy.newBuilder().build();
       Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(SetIamPolicyRequest request)

    public final Policy setIamPolicy(SetIamPolicyRequest request)

Sets the access control policy on the specified note or occurrence. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or an occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource("SetIamPolicyRequest1223629066".toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       Policy response = containerAnalysisV1Beta1Client.setIamPolicy(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.SetIamPolicyRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicy(String resource, Policy policy)

    public final Policy setIamPolicy(String resource, Policy policy)

Sets the access control policy on the specified note or occurrence. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or an occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       String resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "resource-341064690");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "resource-341064690";
             }
           }.toString();
       Policy policy = Policy.newBuilder().build();
       Policy response = containerAnalysisV1Beta1Client.setIamPolicy(resource, policy);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
| `policy` | `com.google.iam.v1.Policy` REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.Policy` |   |

### setIamPolicyCallable()

    public final UnaryCallable<SetIamPolicyRequest,Policy> setIamPolicyCallable()

Sets the access control policy on the specified note or occurrence. Requires
`containeranalysis.notes.setIamPolicy` or `containeranalysis.occurrences.setIamPolicy`
permission if the resource is a note or an occurrence, respectively.

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       SetIamPolicyRequest request =
           SetIamPolicyRequest.newBuilder()
               .setResource("SetIamPolicyRequest1223629066".toString())
               .setPolicy(Policy.newBuilder().build())
               .setUpdateMask(FieldMask.newBuilder().build())
               .build();
       ApiFuture<Policy> future =
           containerAnalysisV1Beta1Client.setIamPolicyCallable().futureCall(request);
       // Do something.
       Policy response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### testIamPermissions(ResourceName resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(ResourceName resource, List<String> permissions)

Returns the permissions that a caller has on the specified note or occurrence. Requires list
permission on the project (for example, `containeranalysis.notes.list`).

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       ResourceName resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "projects/project-8432/notes/note-8432");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "projects/project-8432/notes/note-8432";
             }
           };
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           containerAnalysisV1Beta1Client.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `com.google.api.resourcenames.ResourceName` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The set of permissions to check for the `resource`. Permissions with wildcards (such as '\*' or 'storage.\*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(TestIamPermissionsRequest request)

    public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)

Returns the permissions that a caller has on the specified note or occurrence. Requires list
permission on the project (for example, `containeranalysis.notes.list`).

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource("TestIamPermissionsRequest942398222".toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       TestIamPermissionsResponse response =
           containerAnalysisV1Beta1Client.testIamPermissions(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.iam.v1.TestIamPermissionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissions(String resource, List\<String\> permissions)

    public final TestIamPermissionsResponse testIamPermissions(String resource, List<String> permissions)

Returns the permissions that a caller has on the specified note or occurrence. Requires list
permission on the project (for example, `containeranalysis.notes.list`).

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       String resource =
           new ResourceName() {
             {@literal @}Override
             public Map<String, String> getFieldValuesMap() {
               Map<String, String> fieldValuesMap = new HashMap<>();
               fieldValuesMap.put("resource", "resource-341064690");
               return fieldValuesMap;
             }

             {@literal @}Override
             public String getFieldValue(String fieldName) {
               return getFieldValuesMap().get(fieldName);
             }

             {@literal @}Override
             public String toString() {
               return "resource-341064690";
             }
           }.toString();
       List<String> permissions = new ArrayList<>();
       TestIamPermissionsResponse response =
           containerAnalysisV1Beta1Client.testIamPermissions(resource, permissions);
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `resource` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
| `permissions` | `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` The set of permissions to check for the `resource`. Permissions with wildcards (such as '\*' or 'storage.\*') are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.iam.v1.TestIamPermissionsResponse` |   |

### testIamPermissionsCallable()

    public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()

Returns the permissions that a caller has on the specified note or occurrence. Requires list
permission on the project (for example, `containeranalysis.notes.list`).

The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for notes and
`projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for occurrences.

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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
         ContainerAnalysisV1Beta1Client.create()) {
       TestIamPermissionsRequest request =
           TestIamPermissionsRequest.newBuilder()
               .setResource("TestIamPermissionsRequest942398222".toString())
               .addAllPermissions(new ArrayList<String>())
               .build();
       ApiFuture<TestIamPermissionsResponse> future =
           containerAnalysisV1Beta1Client.testIamPermissionsCallable().futureCall(request);
       // Do something.
       TestIamPermissionsResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse>` |   |