Skip to content
Permalink
Browse files
feat: add GetVulnerabilityOccurrencesSummary rpc (#265)
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/d930cc96-a531-49bb-98d1-aa98f3e84e7c/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 334682521
Source-Link: googleapis/googleapis@cb7fc62
  • Loading branch information
yoshi-automation committed Oct 1, 2020
1 parent 344a26e commit e5ab75f50532a38e67aafc8ddaf1efbcee561ddb
Showing with 3,800 additions and 57 deletions.
  1. +122 −13 ...nalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java
  2. +19 −0 ...lysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisSettings.java
  3. +1 −1 ...-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/package-info.java
  4. +8 −0 ...ysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStub.java
  5. +43 −2 .../main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStubSettings.java
  6. +47 −0 .../src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisStub.java
  7. +54 −6 ...sis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClientTest.java
  8. +18 −0 ...lysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysisImpl.java
  9. +131 −0 ...oud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ContainerAnalysisGrpc.java
  10. +4 −0 proto-google-cloud-containeranalysis-v1/pom.xml
  11. +95 −29 ...e-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/Containeranalysis.java
  12. +861 −0 ...s-v1/src/main/java/com/google/containeranalysis/v1/GetVulnerabilityOccurrencesSummaryRequest.java
  13. +81 −0 ...main/java/com/google/containeranalysis/v1/GetVulnerabilityOccurrencesSummaryRequestOrBuilder.java
  14. +2,165 −0 ...neranalysis-v1/src/main/java/com/google/containeranalysis/v1/VulnerabilityOccurrencesSummary.java
  15. +94 −0 ...is-v1/src/main/java/com/google/containeranalysis/v1/VulnerabilityOccurrencesSummaryOrBuilder.java
  16. +48 −2 ...-containeranalysis-v1/src/main/proto/google/devtools/containeranalysis/v1/containeranalysis.proto
  17. +9 −4 synth.metadata
@@ -21,6 +21,9 @@
import com.google.api.resourcenames.ResourceName;
import com.google.cloud.devtools.containeranalysis.v1.stub.ContainerAnalysisStub;
import com.google.cloud.devtools.containeranalysis.v1.stub.ContainerAnalysisStubSettings;
import com.google.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest;
import com.google.containeranalysis.v1.ProjectName;
import com.google.containeranalysis.v1.VulnerabilityOccurrencesSummary;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -52,7 +55,7 @@
* <pre>
* <code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
* }
@@ -185,7 +188,7 @@ public ContainerAnalysisStub getStub() {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
* }
@@ -220,7 +223,7 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* Policy response = containerAnalysisClient.setIamPolicy(resource.toString(), policy);
* }
@@ -252,7 +255,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
* .setResource(resource.toString())
@@ -282,7 +285,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
* .setResource(resource.toString())
@@ -311,7 +314,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy response = containerAnalysisClient.getIamPolicy(resource);
* }
* </code></pre>
@@ -341,7 +344,7 @@ public final Policy getIamPolicy(ResourceName resource) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy response = containerAnalysisClient.getIamPolicy(resource.toString());
* }
* </code></pre>
@@ -368,7 +371,7 @@ public final Policy getIamPolicy(String resource) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
* .setResource(resource.toString())
* .build();
@@ -396,7 +399,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
* .setResource(resource.toString())
* .build();
@@ -422,7 +425,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
* TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource, permissions);
* }
@@ -457,7 +460,7 @@ public final TestIamPermissionsResponse testIamPermissions(
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
* TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource.toString(), permissions);
* }
@@ -492,7 +495,7 @@ public final TestIamPermissionsResponse testIamPermissions(
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
* .setResource(resource.toString())
@@ -521,7 +524,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
* .setResource(resource.toString())
@@ -538,6 +541,112 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
return stub.testIamPermissionsCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a summary of the number and severity of occurrences.
*
* <p>Sample code:
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String filter = "";
* VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(parent, filter);
* }
* </code></pre>
*
* @param parent The name of the project to get a vulnerability summary for in the form of
* `projects/[PROJECT_ID]`.
* @param filter The filter expression.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
ProjectName parent, String filter) {
GetVulnerabilityOccurrencesSummaryRequest request =
GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setFilter(filter)
.build();
return getVulnerabilityOccurrencesSummary(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a summary of the number and severity of occurrences.
*
* <p>Sample code:
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* String filter = "";
* VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(parent.toString(), filter);
* }
* </code></pre>
*
* @param parent The name of the project to get a vulnerability summary for in the form of
* `projects/[PROJECT_ID]`.
* @param filter The filter expression.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
String parent, String filter) {
GetVulnerabilityOccurrencesSummaryRequest request =
GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
.setParent(parent)
.setFilter(filter)
.build();
return getVulnerabilityOccurrencesSummary(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a summary of the number and severity of occurrences.
*
* <p>Sample code:
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
* .setParent(parent.toString())
* .build();
* VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(request);
* }
* </code></pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(
GetVulnerabilityOccurrencesSummaryRequest request) {
return getVulnerabilityOccurrencesSummaryCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD
/**
* Gets a summary of the number and severity of occurrences.
*
* <p>Sample code:
*
* <pre><code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* ProjectName parent = ProjectName.of("[PROJECT]");
* GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
* .setParent(parent.toString())
* .build();
* ApiFuture&lt;VulnerabilityOccurrencesSummary&gt; future = containerAnalysisClient.getVulnerabilityOccurrencesSummaryCallable().futureCall(request);
* // Do something
* VulnerabilityOccurrencesSummary response = future.get();
* }
* </code></pre>
*/
public final UnaryCallable<
GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary>
getVulnerabilityOccurrencesSummaryCallable() {
return stub.getVulnerabilityOccurrencesSummaryCallable();
}

@Override
public final void close() {
stub.close();
@@ -26,6 +26,8 @@
import com.google.api.gax.rpc.TransportChannelProvider;
import com.google.api.gax.rpc.UnaryCallSettings;
import com.google.cloud.devtools.containeranalysis.v1.stub.ContainerAnalysisStubSettings;
import com.google.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest;
import com.google.containeranalysis.v1.VulnerabilityOccurrencesSummary;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -86,6 +88,14 @@ public UnaryCallSettings<GetIamPolicyRequest, Policy> getIamPolicySettings() {
return ((ContainerAnalysisStubSettings) getStubSettings()).testIamPermissionsSettings();
}

/** Returns the object with the settings used for calls to getVulnerabilityOccurrencesSummary. */
public UnaryCallSettings<
GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary>
getVulnerabilityOccurrencesSummarySettings() {
return ((ContainerAnalysisStubSettings) getStubSettings())
.getVulnerabilityOccurrencesSummarySettings();
}

public static final ContainerAnalysisSettings create(ContainerAnalysisStubSettings stub)
throws IOException {
return new ContainerAnalysisSettings.Builder(stub.toBuilder()).build();
@@ -199,6 +209,15 @@ public UnaryCallSettings.Builder<GetIamPolicyRequest, Policy> getIamPolicySettin
return getStubSettingsBuilder().testIamPermissionsSettings();
}

/**
* Returns the builder for the settings used for calls to getVulnerabilityOccurrencesSummary.
*/
public UnaryCallSettings.Builder<
GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary>
getVulnerabilityOccurrencesSummarySettings() {
return getStubSettingsBuilder().getVulnerabilityOccurrencesSummarySettings();
}

@Override
public ContainerAnalysisSettings build() throws IOException {
return new ContainerAnalysisSettings(this);
@@ -38,7 +38,7 @@
* <pre>
* <code>
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
* String resource = "";
* ResourceName resource = ProjectName.of("[PROJECT]");
* Policy policy = Policy.newBuilder().build();
* Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
* }
@@ -18,6 +18,8 @@
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.containeranalysis.v1.GetVulnerabilityOccurrencesSummaryRequest;
import com.google.containeranalysis.v1.VulnerabilityOccurrencesSummary;
import com.google.iam.v1.GetIamPolicyRequest;
import com.google.iam.v1.Policy;
import com.google.iam.v1.SetIamPolicyRequest;
@@ -48,6 +50,12 @@ public UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()");
}

public UnaryCallable<GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary>
getVulnerabilityOccurrencesSummaryCallable() {
throw new UnsupportedOperationException(
"Not implemented: getVulnerabilityOccurrencesSummaryCallable()");
}

@Override
public abstract void close();
}

0 comments on commit e5ab75f

Please sign in to comment.