Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ If you are using Maven without BOM, add this to your dependencies:
If you are using Gradle 5.x or later, add this to your dependencies

```Groovy
implementation platform('com.google.cloud:libraries-bom:25.1.0')
implementation platform('com.google.cloud:libraries-bom:25.2.0')

implementation 'com.google.cloud:google-cloud-containeranalysis'
```
If you are using Gradle without BOM, add this to your dependencies

```Groovy
implementation 'com.google.cloud:google-cloud-containeranalysis:2.2.14'
implementation 'com.google.cloud:google-cloud-containeranalysis:2.2.16'
```

If you are using SBT, add this to your dependencies

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-containeranalysis" % "2.2.14"
libraryDependencies += "com.google.cloud" % "google-cloud-containeranalysis" % "2.2.16"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,6 +54,8 @@
* calls that map to API methods. Sample code to get started:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
Expand Down Expand Up @@ -91,6 +93,8 @@
* <p>To customize credentials:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* ContainerAnalysisSettings containerAnalysisSettings =
* ContainerAnalysisSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
Expand All @@ -102,6 +106,8 @@
* <p>To customize the endpoint:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* ContainerAnalysisSettings containerAnalysisSettings =
* ContainerAnalysisSettings.newBuilder().setEndpoint(myEndpoint).build();
* ContainerAnalysisClient containerAnalysisClient =
Expand Down Expand Up @@ -183,6 +189,8 @@ public ContainerAnalysisStub getStub() {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
Expand Down Expand Up @@ -218,6 +226,8 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = ProjectName.of("[PROJECT]").toString();
* Policy policy = Policy.newBuilder().build();
Expand Down Expand Up @@ -250,11 +260,14 @@ public final Policy setIamPolicy(String resource, Policy policy) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* Policy response = containerAnalysisClient.setIamPolicy(request);
* }
Expand All @@ -279,11 +292,14 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* SetIamPolicyRequest request =
* SetIamPolicyRequest.newBuilder()
* .setResource(ProjectName.of("[PROJECT]").toString())
* .setPolicy(Policy.newBuilder().build())
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture<Policy> future = containerAnalysisClient.setIamPolicyCallable().futureCall(request);
* // Do something.
Expand All @@ -307,6 +323,8 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy response = containerAnalysisClient.getIamPolicy(resource);
Expand Down Expand Up @@ -337,6 +355,8 @@ public final Policy getIamPolicy(ResourceName resource) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = ProjectName.of("[PROJECT]").toString();
* Policy response = containerAnalysisClient.getIamPolicy(resource);
Expand Down Expand Up @@ -364,6 +384,8 @@ public final Policy getIamPolicy(String resource) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
Expand Down Expand Up @@ -393,6 +415,8 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* GetIamPolicyRequest request =
* GetIamPolicyRequest.newBuilder()
Expand Down Expand Up @@ -420,6 +444,8 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ResourceName resource = ProjectName.of("[PROJECT]");
* List<String> permissions = new ArrayList<>();
Expand Down Expand Up @@ -456,6 +482,8 @@ public final TestIamPermissionsResponse testIamPermissions(
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = ProjectName.of("[PROJECT]").toString();
* List<String> permissions = new ArrayList<>();
Expand Down Expand Up @@ -492,6 +520,8 @@ public final TestIamPermissionsResponse testIamPermissions(
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
Expand Down Expand Up @@ -520,6 +550,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* TestIamPermissionsRequest request =
* TestIamPermissionsRequest.newBuilder()
Expand All @@ -545,6 +577,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String filter = "filter-1274492040";
Expand Down Expand Up @@ -575,6 +609,8 @@ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String parent = ProjectName.of("[PROJECT]").toString();
* String filter = "filter-1274492040";
Expand Down Expand Up @@ -605,6 +641,8 @@ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* GetVulnerabilityOccurrencesSummaryRequest request =
* GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
Expand All @@ -631,6 +669,8 @@ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* GetVulnerabilityOccurrencesSummaryRequest request =
* GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -57,6 +57,8 @@
* <p>For example, to set the total timeout of setIamPolicy to 30 seconds:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* ContainerAnalysisSettings.Builder containerAnalysisSettingsBuilder =
* ContainerAnalysisSettings.newBuilder();
* containerAnalysisSettingsBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,6 +36,8 @@
* <p>Sample for ContainerAnalysisClient:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ResourceName resource = BillingAccountName.of("[BILLING_ACCOUNT]");
* Policy policy = Policy.newBuilder().build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,6 +66,8 @@
* <p>For example, to set the total timeout of setIamPolicy to 30 seconds:
*
* <pre>{@code
* // This snippet has been automatically generated for illustrative purposes only.
* // It may require modifications to work in your environment.
* ContainerAnalysisStubSettings.Builder containerAnalysisSettingsBuilder =
* ContainerAnalysisStubSettings.newBuilder();
* containerAnalysisSettingsBuilder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,6 +27,7 @@
import com.google.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest;
import com.google.containeranalysis.v1.ProjectName;
import com.google.containeranalysis.v1.VulnerabilityOccurrencesSummary;
import com.google.iam.v1.AuditConfig;
import com.google.iam.v1.Binding;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
Expand Down Expand Up @@ -93,6 +94,7 @@ public void setIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockContainerAnalysis.addResponse(expectedResponse);
Expand Down Expand Up @@ -136,6 +138,7 @@ public void setIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockContainerAnalysis.addResponse(expectedResponse);
Expand Down Expand Up @@ -179,6 +182,7 @@ public void getIamPolicyTest() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockContainerAnalysis.addResponse(expectedResponse);
Expand Down Expand Up @@ -219,6 +223,7 @@ public void getIamPolicyTest2() throws Exception {
Policy.newBuilder()
.setVersion(351608024)
.addAllBindings(new ArrayList<Binding>())
.addAllAuditConfigs(new ArrayList<AuditConfig>())
.setEtag(ByteString.EMPTY)
.build();
mockContainerAnalysis.addResponse(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading