From b064d6cbf848a754331eee11919190218901208e Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Tue, 4 Jun 2019 23:17:07 -0700 Subject: [PATCH] Add Container Analysis v1 service --- .../pom.xml | 52 ++ .../v1/ContainerAnalysisGrpc.java | 702 ++++++++++++++++++ google-api-grpc/pom.xml | 12 + .../pom.xml | 36 + .../v1/Containeranalysis.java | 72 ++ .../containeranalysis/v1/IamResourceName.java | 23 + .../v1/IamResourceNames.java | 31 + .../google/containeranalysis/v1/NoteName.java | 179 +++++ .../containeranalysis/v1/OccurrenceName.java | 179 +++++ .../containeranalysis/v1/ProjectName.java | 160 ++++ .../v1/UntypedIamResourceName.java | 99 +++ .../v1/containeranalysis.proto | 100 +++ .../v1beta1/Containeranalysis.java | 26 +- .../v1beta1/GetScanConfigRequest.java | 7 +- .../v1beta1/ListScanConfigsRequest.java | 7 +- .../v1beta1/ListScanConfigsResponse.java | 9 +- .../containeranalysis/v1beta1/ScanConfig.java | 7 +- .../v1beta1/UpdateScanConfigRequest.java | 7 +- .../v1beta1/BatchCreateNotesRequest.java | 13 +- .../v1beta1/BatchCreateNotesResponse.java | 6 + .../BatchCreateOccurrencesRequest.java | 33 +- .../BatchCreateOccurrencesResponse.java | 6 + .../io/grafeas/v1beta1/CreateNoteRequest.java | 7 +- .../v1beta1/CreateOccurrenceRequest.java | 7 +- .../io/grafeas/v1beta1/DeleteNoteRequest.java | 7 +- .../v1beta1/DeleteOccurrenceRequest.java | 7 +- .../io/grafeas/v1beta1/GetNoteRequest.java | 7 +- .../v1beta1/GetOccurrenceNoteRequest.java | 7 +- .../grafeas/v1beta1/GetOccurrenceRequest.java | 7 +- ...ulnerabilityOccurrencesSummaryRequest.java | 7 +- .../main/java/io/grafeas/v1beta1/Grafeas.java | 44 +- .../v1beta1/ListNoteOccurrencesRequest.java | 7 +- .../v1beta1/ListNoteOccurrencesResponse.java | 9 +- .../io/grafeas/v1beta1/ListNotesRequest.java | 7 +- .../io/grafeas/v1beta1/ListNotesResponse.java | 9 +- .../v1beta1/ListOccurrencesRequest.java | 7 +- .../v1beta1/ListOccurrencesResponse.java | 9 +- .../main/java/io/grafeas/v1beta1/Note.java | 53 +- .../java/io/grafeas/v1beta1/Occurrence.java | 7 +- .../java/io/grafeas/v1beta1/Resource.java | 7 +- .../io/grafeas/v1beta1/UpdateNoteRequest.java | 7 +- .../v1beta1/UpdateOccurrenceRequest.java | 7 +- .../VulnerabilityOccurrencesSummary.java | 13 +- .../v1beta1/attestation/Attestation.java | 7 +- .../attestation/AttestationOuterClass.java | 13 +- .../v1beta1/attestation/Authority.java | 14 +- .../grafeas/v1beta1/attestation/Details.java | 7 +- .../attestation/PgpSignedAttestation.java | 7 +- .../java/io/grafeas/v1beta1/build/Build.java | 7 +- .../v1beta1/build/BuildOuterClass.java | 20 +- .../grafeas/v1beta1/build/BuildSignature.java | 7 +- .../io/grafeas/v1beta1/build/Details.java | 7 +- .../io/grafeas/v1beta1/common/Common.java | 13 +- .../io/grafeas/v1beta1/common/RelatedUrl.java | 7 +- .../v1beta1/deployment/Deployable.java | 6 + .../v1beta1/deployment/Deployment.java | 29 +- .../deployment/DeploymentOuterClass.java | 20 +- .../grafeas/v1beta1/deployment/Details.java | 7 +- .../io/grafeas/v1beta1/discovery/Details.java | 7 +- .../grafeas/v1beta1/discovery/Discovered.java | 7 +- .../grafeas/v1beta1/discovery/Discovery.java | 7 +- .../discovery/DiscoveryOuterClass.java | 24 +- .../java/io/grafeas/v1beta1/image/Basis.java | 7 +- .../io/grafeas/v1beta1/image/Derived.java | 33 +- .../io/grafeas/v1beta1/image/Details.java | 7 +- .../io/grafeas/v1beta1/image/Fingerprint.java | 29 +- .../java/io/grafeas/v1beta1/image/Image.java | 13 +- .../java/io/grafeas/v1beta1/image/Layer.java | 7 +- .../java/io/grafeas/v1beta1/pkg/Details.java | 7 +- .../io/grafeas/v1beta1/pkg/Distribution.java | 7 +- .../io/grafeas/v1beta1/pkg/Installation.java | 33 +- .../java/io/grafeas/v1beta1/pkg/Location.java | 7 +- .../java/io/grafeas/v1beta1/pkg/Package.java | 33 +- .../v1beta1/pkg/PackageOuterClass.java | 13 +- .../java/io/grafeas/v1beta1/pkg/Version.java | 7 +- .../grafeas/v1beta1/provenance/Artifact.java | 29 +- .../v1beta1/provenance/BuildProvenance.java | 61 +- .../grafeas/v1beta1/provenance/Command.java | 69 +- .../v1beta1/provenance/FileHashes.java | 6 + .../io/grafeas/v1beta1/provenance/Hash.java | 7 +- .../v1beta1/provenance/Provenance.java | 22 +- .../io/grafeas/v1beta1/provenance/Source.java | 37 +- .../grafeas/v1beta1/source/AliasContext.java | 7 +- .../source/CloudRepoSourceContext.java | 7 +- .../v1beta1/source/GerritSourceContext.java | 7 +- .../v1beta1/source/GitSourceContext.java | 7 +- .../grafeas/v1beta1/source/ProjectRepoId.java | 7 +- .../io/grafeas/v1beta1/source/RepoId.java | 7 +- .../io/grafeas/v1beta1/source/Source.java | 13 +- .../grafeas/v1beta1/source/SourceContext.java | 13 +- .../v1beta1/vulnerability/Details.java | 57 +- .../v1beta1/vulnerability/PackageIssue.java | 7 +- .../v1beta1/vulnerability/Vulnerability.java | 40 +- .../vulnerability/VulnerabilityLocation.java | 7 +- .../VulnerabilityOuterClass.java | 22 +- .../google-cloud-containeranalysis/pom.xml | 21 +- .../v1/ContainerAnalysisClient.java | 567 ++++++++++++++ .../v1/ContainerAnalysisSettings.java | 202 +++++ .../containeranalysis/v1/package-info.java | 48 ++ .../v1/stub/ContainerAnalysisStub.java | 53 ++ .../stub/ContainerAnalysisStubSettings.java | 316 ++++++++ .../GrpcContainerAnalysisCallableFactory.java | 115 +++ .../v1/stub/GrpcContainerAnalysisStub.java | 221 ++++++ .../v1/ContainerAnalysisClientTest.java | 209 ++++++ .../v1/MockContainerAnalysis.java | 57 ++ .../v1/MockContainerAnalysisImpl.java | 107 +++ .../synth.metadata | 20 +- .../google-cloud-containeranalysis/synth.py | 2 +- versions.txt | 2 + 109 files changed, 4307 insertions(+), 492 deletions(-) create mode 100644 google-api-grpc/grpc-google-cloud-containeranalysis-v1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ContainerAnalysisGrpc.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/Containeranalysis.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/IamResourceName.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/IamResourceNames.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/NoteName.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/OccurrenceName.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ProjectName.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/UntypedIamResourceName.java create mode 100644 google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/proto/google/devtools/containeranalysis/v1/containeranalysis.proto create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisSettings.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/package-info.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStub.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStubSettings.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisCallableFactory.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisStub.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClientTest.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysis.java create mode 100644 google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysisImpl.java diff --git a/google-api-grpc/grpc-google-cloud-containeranalysis-v1/pom.xml b/google-api-grpc/grpc-google-cloud-containeranalysis-v1/pom.xml new file mode 100644 index 000000000000..d32e76b436ca --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-containeranalysis-v1/pom.xml @@ -0,0 +1,52 @@ + + 4.0.0 + grpc-google-cloud-containeranalysis-v1 + 0.59.1-SNAPSHOT + grpc-google-cloud-containeranalysis-v1 + GRPC library for grpc-google-cloud-containeranalysis-v1 + + com.google.api.grpc + google-api-grpc + 0.59.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1beta1 + compile + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../proto-google-cloud-containeranalysis-v1/target/site/apidocs/ + + + + + + + diff --git a/google-api-grpc/grpc-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ContainerAnalysisGrpc.java b/google-api-grpc/grpc-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ContainerAnalysisGrpc.java new file mode 100644 index 000000000000..8a457a973699 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ContainerAnalysisGrpc.java @@ -0,0 +1,702 @@ +package com.google.containeranalysis.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Retrieves analysis results of Cloud components such as Docker container
+ * images. The Container Analysis API is an implementation of the
+ * [Grafeas](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.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/devtools/containeranalysis/v1/containeranalysis.proto") +public final class ContainerAnalysisGrpc { + + private ContainerAnalysisGrpc() {} + + public static final String SERVICE_NAME = + "google.devtools.containeranalysis.v1.ContainerAnalysis"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getSetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_SET_IAM_POLICY = getSetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethod() { + return getSetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy> + getSetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = ContainerAnalysisGrpc.getSetIamPolicyMethod) == null) { + synchronized (ContainerAnalysisGrpc.class) { + if ((getSetIamPolicyMethod = ContainerAnalysisGrpc.getSetIamPolicyMethod) == null) { + ContainerAnalysisGrpc.getSetIamPolicyMethod = + getSetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.devtools.containeranalysis.v1.ContainerAnalysis", + "SetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ContainerAnalysisMethodDescriptorSupplier("SetIamPolicy")) + .build(); + } + } + } + return getSetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetIamPolicyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + METHOD_GET_IAM_POLICY = getGetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethod() { + return getGetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy> + getGetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor + getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = ContainerAnalysisGrpc.getGetIamPolicyMethod) == null) { + synchronized (ContainerAnalysisGrpc.class) { + if ((getGetIamPolicyMethod = ContainerAnalysisGrpc.getGetIamPolicyMethod) == null) { + ContainerAnalysisGrpc.getGetIamPolicyMethod = + getGetIamPolicyMethod = + io.grpc.MethodDescriptor + .newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.devtools.containeranalysis.v1.ContainerAnalysis", + "GetIamPolicy")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.Policy.getDefaultInstance())) + .setSchemaDescriptor( + new ContainerAnalysisMethodDescriptorSupplier("GetIamPolicy")) + .build(); + } + } + } + return getGetIamPolicyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getTestIamPermissionsMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + METHOD_TEST_IAM_PERMISSIONS = getTestIamPermissionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod() { + return getTestIamPermissionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethodHelper() { + io.grpc.MethodDescriptor< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse> + getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = ContainerAnalysisGrpc.getTestIamPermissionsMethod) == null) { + synchronized (ContainerAnalysisGrpc.class) { + if ((getTestIamPermissionsMethod = ContainerAnalysisGrpc.getTestIamPermissionsMethod) + == null) { + ContainerAnalysisGrpc.getTestIamPermissionsMethod = + getTestIamPermissionsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.devtools.containeranalysis.v1.ContainerAnalysis", + "TestIamPermissions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.iam.v1.TestIamPermissionsResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ContainerAnalysisMethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static ContainerAnalysisStub newStub(io.grpc.Channel channel) { + return new ContainerAnalysisStub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ContainerAnalysisBlockingStub newBlockingStub(io.grpc.Channel channel) { + return new ContainerAnalysisBlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static ContainerAnalysisFutureStub newFutureStub(io.grpc.Channel channel) { + return new ContainerAnalysisFutureStub(channel); + } + + /** + * + * + *
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images. The Container Analysis API is an implementation of the
+   * [Grafeas](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.
+   * 
+ */ + public abstract static class ContainerAnalysisImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetIamPolicyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getTestIamPermissionsMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.SetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_SET_IAM_POLICY))) + .addMethod( + getGetIamPolicyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.GetIamPolicyRequest, com.google.iam.v1.Policy>( + this, METHODID_GET_IAM_POLICY))) + .addMethod( + getTestIamPermissionsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.iam.v1.TestIamPermissionsRequest, + com.google.iam.v1.TestIamPermissionsResponse>( + this, METHODID_TEST_IAM_PERMISSIONS))) + .build(); + } + } + + /** + * + * + *
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images. The Container Analysis API is an implementation of the
+   * [Grafeas](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.
+   * 
+ */ + public static final class ContainerAnalysisStub + extends io.grpc.stub.AbstractStub { + private ContainerAnalysisStub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContainerAnalysisStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void setIamPolicy( + com.google.iam.v1.SetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void getIamPolicy( + com.google.iam.v1.GetIamPolicyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public void testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images. The Container Analysis API is an implementation of the
+   * [Grafeas](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.
+   * 
+ */ + public static final class ContainerAnalysisBlockingStub + extends io.grpc.stub.AbstractStub { + private ContainerAnalysisBlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContainerAnalysisBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getSetIamPolicyMethodHelper(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return blockingUnaryCall( + getChannel(), getGetIamPolicyMethodHelper(), getCallOptions(), 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.
+     * 
+ */ + public com.google.iam.v1.TestIamPermissionsResponse testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return blockingUnaryCall( + getChannel(), getTestIamPermissionsMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images. The Container Analysis API is an implementation of the
+   * [Grafeas](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.
+   * 
+ */ + public static final class ContainerAnalysisFutureStub + extends io.grpc.stub.AbstractStub { + private ContainerAnalysisFutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ContainerAnalysisFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getSetIamPolicyMethodHelper(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetIamPolicyMethodHelper(), getCallOptions()), 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.iam.v1.TestIamPermissionsResponse> + testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_SET_IAM_POLICY = 0; + private static final int METHODID_GET_IAM_POLICY = 1; + private static final int METHODID_TEST_IAM_PERMISSIONS = 2; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final ContainerAnalysisImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ContainerAnalysisImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SET_IAM_POLICY: + serviceImpl.setIamPolicy( + (com.google.iam.v1.SetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IAM_POLICY: + serviceImpl.getIamPolicy( + (com.google.iam.v1.GetIamPolicyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TEST_IAM_PERMISSIONS: + serviceImpl.testIamPermissions( + (com.google.iam.v1.TestIamPermissionsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class ContainerAnalysisBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ContainerAnalysisBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.containeranalysis.v1.Containeranalysis.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ContainerAnalysis"); + } + } + + private static final class ContainerAnalysisFileDescriptorSupplier + extends ContainerAnalysisBaseDescriptorSupplier { + ContainerAnalysisFileDescriptorSupplier() {} + } + + private static final class ContainerAnalysisMethodDescriptorSupplier + extends ContainerAnalysisBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ContainerAnalysisMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (ContainerAnalysisGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ContainerAnalysisFileDescriptorSupplier()) + .addMethod(getSetIamPolicyMethodHelper()) + .addMethod(getGetIamPolicyMethodHelper()) + .addMethod(getTestIamPermissionsMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 3e3c97266f23..b6d5065c98ad 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -220,6 +220,16 @@ grpc-google-cloud-container-v1 0.59.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1 + 0.59.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-containeranalysis-v1 + 0.59.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-containeranalysis-v1beta1 @@ -807,6 +817,7 @@ grpc-google-cloud-bigtable-admin-v2 grpc-google-cloud-bigtable-v2 grpc-google-cloud-container-v1 + grpc-google-cloud-containeranalysis-v1 grpc-google-cloud-containeranalysis-v1beta1 grpc-google-cloud-datacatalog-v1beta1 grpc-google-cloud-datalabeling-v1beta1 @@ -873,6 +884,7 @@ proto-google-cloud-bigtable-admin-v2 proto-google-cloud-bigtable-v2 proto-google-cloud-container-v1 + proto-google-cloud-containeranalysis-v1 proto-google-cloud-containeranalysis-v1beta1 proto-google-cloud-datacatalog-v1beta1 proto-google-cloud-datalabeling-v1beta1 diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/pom.xml b/google-api-grpc/proto-google-cloud-containeranalysis-v1/pom.xml new file mode 100644 index 000000000000..2be6733aee76 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-containeranalysis-v1 + 0.59.1-SNAPSHOT + proto-google-cloud-containeranalysis-v1 + PROTO library for proto-google-cloud-containeranalysis-v1 + + com.google.api.grpc + google-api-grpc + 0.59.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + com.google.api.grpc + proto-google-iam-v1 + compile + + + \ No newline at end of file diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/Containeranalysis.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/Containeranalysis.java new file mode 100644 index 000000000000..b6656956a5c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/Containeranalysis.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1/containeranalysis.proto + +package com.google.containeranalysis.v1; + +public final class Containeranalysis { + private Containeranalysis() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n fieldValuesMap; + + private final String project; + private final String note; + + public String getProject() { + return project; + } + + public String getNote() { + return note; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private NoteName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + note = Preconditions.checkNotNull(builder.getNote()); + } + + public static NoteName of(String project, String note) { + return newBuilder().setProject(project).setNote(note).build(); + } + + public static String format(String project, String note) { + return newBuilder().setProject(project).setNote(note).build().toString(); + } + + public static NoteName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "NoteName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("note")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (NoteName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("note", note); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "note", note); + } + + /** Builder for NoteName. */ + public static class Builder { + + private String project; + private String note; + + public String getProject() { + return project; + } + + public String getNote() { + return note; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setNote(String note) { + this.note = note; + return this; + } + + private Builder() {} + + private Builder(NoteName noteName) { + project = noteName.project; + note = noteName.note; + } + + public NoteName build() { + return new NoteName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof NoteName) { + NoteName that = (NoteName) o; + return (this.project.equals(that.project)) && (this.note.equals(that.note)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= note.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/OccurrenceName.java new file mode 100644 index 000000000000..6927a7e52a71 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/OccurrenceName.java @@ -0,0 +1,179 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.containeranalysis.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName extends IamResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/occurrences/{occurrence}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String occurrence; + + public String getProject() { + return project; + } + + public String getOccurrence() { + return occurrence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private OccurrenceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + occurrence = Preconditions.checkNotNull(builder.getOccurrence()); + } + + public static OccurrenceName of(String project, String occurrence) { + return newBuilder().setProject(project).setOccurrence(occurrence).build(); + } + + public static String format(String project, String occurrence) { + return newBuilder().setProject(project).setOccurrence(occurrence).build().toString(); + } + + public static OccurrenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "OccurrenceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("occurrence")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (OccurrenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("occurrence", occurrence); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "occurrence", occurrence); + } + + /** Builder for OccurrenceName. */ + public static class Builder { + + private String project; + private String occurrence; + + public String getProject() { + return project; + } + + public String getOccurrence() { + return occurrence; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setOccurrence(String occurrence) { + this.occurrence = occurrence; + return this; + } + + private Builder() {} + + private Builder(OccurrenceName occurrenceName) { + project = occurrenceName.project; + occurrence = occurrenceName.occurrence; + } + + public OccurrenceName build() { + return new OccurrenceName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof OccurrenceName) { + OccurrenceName that = (OccurrenceName) o; + return (this.project.equals(that.project)) && (this.occurrence.equals(that.occurrence)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= occurrence.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ProjectName.java new file mode 100644 index 000000000000..b9c9996a80bd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/ProjectName.java @@ -0,0 +1,160 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.containeranalysis.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private volatile Map fieldValuesMap; + + private final String project; + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project); + } + + /** Builder for ProjectName. */ + public static class Builder { + + private String project; + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + private Builder(ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectName) { + ProjectName that = (ProjectName) o; + return (this.project.equals(that.project)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/UntypedIamResourceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/UntypedIamResourceName.java new file mode 100644 index 000000000000..019b93b0fcdb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/java/com/google/containeranalysis/v1/UntypedIamResourceName.java @@ -0,0 +1,99 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.containeranalysis.v1; + +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class UntypedIamResourceName extends IamResourceName { + + private final String rawValue; + private Map valueMap; + + private UntypedIamResourceName(String rawValue) { + this.rawValue = Preconditions.checkNotNull(rawValue); + this.valueMap = ImmutableMap.of("", rawValue); + } + + public static UntypedIamResourceName from(ResourceName resourceName) { + return new UntypedIamResourceName(resourceName.toString()); + } + + public static UntypedIamResourceName parse(String formattedString) { + return new UntypedIamResourceName(formattedString); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (UntypedIamResourceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return true; + } + + /** Return a map with a single value rawValue keyed on an empty String "". */ + public Map getFieldValuesMap() { + return valueMap; + } + + /** Return the initial rawValue if @param fieldName is an empty String, else return null. */ + public String getFieldValue(String fieldName) { + return valueMap.get(fieldName); + } + + @Override + public String toString() { + return rawValue; + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof UntypedIamResourceName) { + UntypedIamResourceName that = (UntypedIamResourceName) o; + return this.rawValue.equals(that.rawValue); + } + return false; + } + + @Override + public int hashCode() { + return rawValue.hashCode(); + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/proto/google/devtools/containeranalysis/v1/containeranalysis.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/proto/google/devtools/containeranalysis/v1/containeranalysis.proto new file mode 100644 index 000000000000..5c855acbd5ee --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1/src/main/proto/google/devtools/containeranalysis/v1/containeranalysis.proto @@ -0,0 +1,100 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.devtools.containeranalysis.v1; + +import "google/api/annotations.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1"; +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis"; +option java_multiple_files = true; +option java_package = "com.google.containeranalysis.v1"; +option objc_class_prefix = "GCA"; + +// Retrieves analysis results of Cloud components such as Docker container +// images. The Container Analysis API is an implementation of the +// [Grafeas](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. +service ContainerAnalysis { + // 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. + rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/notes/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/occurrences/*}:setIamPolicy" + body: "*" + } + }; + } + + // 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. + rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/notes/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/occurrences/*}:getIamPolicy" + body: "*" + } + }; + } + + // 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. + rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) { + option (google.api.http) = { + post: "/v1/{resource=projects/*/notes/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1/{resource=projects/*/occurrences/*}:testIamPermissions" + body: "*" + } + }; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/Containeranalysis.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/Containeranalysis.java index fe0538dd5d52..1781519803c0 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/Containeranalysis.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/Containeranalysis.java @@ -98,23 +98,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ntaineranalysis/v1beta1;containeranalysi" + "s\242\002\003GCAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - com.google.iam.v1.IamPolicyProto.getDescriptor(), - com.google.iam.v1.PolicyProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.iam.v1.IamPolicyProto.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequest.java index 2878f5965601..36021f8a5adf 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequest.java @@ -26,6 +26,12 @@ private GetScanConfigRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetScanConfigRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private GetScanConfigRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequest.java index 55acacc0dc30..53d67d7b834b 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequest.java @@ -28,6 +28,12 @@ private ListScanConfigsRequest() { pageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanConfigsRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private ListScanConfigsRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponse.java index d13901d39d85..d1a55466d72e 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponse.java @@ -27,6 +27,12 @@ private ListScanConfigsResponse() { nextPageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanConfigsResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -107,7 +113,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.containeranalysis.v1beta1.ListScanConfigsResponse.Builder.class); } - private int bitField0_; public static final int SCAN_CONFIGS_FIELD_NUMBER = 1; private java.util.List scanConfigs_; /** @@ -475,7 +480,6 @@ public com.google.containeranalysis.v1beta1.ListScanConfigsResponse buildPartial com.google.containeranalysis.v1beta1.ListScanConfigsResponse result = new com.google.containeranalysis.v1beta1.ListScanConfigsResponse(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (scanConfigsBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { scanConfigs_ = java.util.Collections.unmodifiableList(scanConfigs_); @@ -486,7 +490,6 @@ public com.google.containeranalysis.v1beta1.ListScanConfigsResponse buildPartial result.scanConfigs_ = scanConfigsBuilder_.build(); } result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfig.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfig.java index ed284f0bbdae..5e08fddb7d15 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfig.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfig.java @@ -29,6 +29,12 @@ private ScanConfig() { description_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanConfig(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -42,7 +48,6 @@ private ScanConfig( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequest.java index 7235a7c494c9..b427faac9250 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequest.java @@ -26,6 +26,12 @@ private UpdateScanConfigRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateScanConfigRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private UpdateScanConfigRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequest.java index 4adf9d81353a..700ccade3b68 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequest.java @@ -26,6 +26,12 @@ private BatchCreateNotesRequest() { parent_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateNotesRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -59,10 +65,10 @@ private BatchCreateNotesRequest( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { notes_ = com.google.protobuf.MapField.newMapField(NotesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } com.google.protobuf.MapEntry notes__ = input.readMessage( @@ -115,7 +121,6 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { io.grafeas.v1beta1.BatchCreateNotesRequest.Builder.class); } - private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; private volatile java.lang.Object parent_; /** @@ -530,11 +535,9 @@ public io.grafeas.v1beta1.BatchCreateNotesRequest buildPartial() { io.grafeas.v1beta1.BatchCreateNotesRequest result = new io.grafeas.v1beta1.BatchCreateNotesRequest(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.parent_ = parent_; result.notes_ = internalGetNotes(); result.notes_.makeImmutable(); - result.bitField0_ = to_bitField0_; onBuilt(); return result; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponse.java index bf407610c4f5..e7a045162e37 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponse.java @@ -26,6 +26,12 @@ private BatchCreateNotesResponse() { notes_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateNotesResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequest.java index 029e0b189336..fd70fb6451f5 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequest.java @@ -27,6 +27,12 @@ private BatchCreateOccurrencesRequest() { occurrences_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateOccurrencesRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -60,9 +66,9 @@ private BatchCreateOccurrencesRequest( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { occurrences_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } occurrences_.add( input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry)); @@ -82,7 +88,7 @@ private BatchCreateOccurrencesRequest( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { occurrences_ = java.util.Collections.unmodifiableList(occurrences_); } this.unknownFields = unknownFields.build(); @@ -105,7 +111,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.BatchCreateOccurrencesRequest.Builder.class); } - private int bitField0_; public static final int PARENT_FIELD_NUMBER = 1; private volatile java.lang.Object parent_; /** @@ -436,7 +441,7 @@ public Builder clear() { if (occurrencesBuilder_ == null) { occurrences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { occurrencesBuilder_.clear(); } @@ -468,18 +473,16 @@ public io.grafeas.v1beta1.BatchCreateOccurrencesRequest buildPartial() { io.grafeas.v1beta1.BatchCreateOccurrencesRequest result = new io.grafeas.v1beta1.BatchCreateOccurrencesRequest(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.parent_ = parent_; if (occurrencesBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { occurrences_ = java.util.Collections.unmodifiableList(occurrences_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.occurrences_ = occurrences_; } else { result.occurrences_ = occurrencesBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -538,7 +541,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateOccurrencesRequest other) if (!other.occurrences_.isEmpty()) { if (occurrences_.isEmpty()) { occurrences_ = other.occurrences_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureOccurrencesIsMutable(); occurrences_.addAll(other.occurrences_); @@ -551,7 +554,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateOccurrencesRequest other) occurrencesBuilder_.dispose(); occurrencesBuilder_ = null; occurrences_ = other.occurrences_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); occurrencesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getOccurrencesFieldBuilder() @@ -695,9 +698,9 @@ public Builder setParentBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureOccurrencesIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { occurrences_ = new java.util.ArrayList(occurrences_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -912,7 +915,7 @@ public Builder addAllOccurrences( public Builder clearOccurrences() { if (occurrencesBuilder_ == null) { occurrences_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { occurrencesBuilder_.clear(); @@ -1033,7 +1036,7 @@ public java.util.List getOccurrencesBuild io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( - occurrences_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + occurrences_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); occurrences_ = null; } return occurrencesBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponse.java index 376c2a968896..2281c24a0c3e 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponse.java @@ -27,6 +27,12 @@ private BatchCreateOccurrencesResponse() { occurrences_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BatchCreateOccurrencesResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequest.java index f7f334ecaffe..b119a7d77a07 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequest.java @@ -27,6 +27,12 @@ private CreateNoteRequest() { noteId_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateNoteRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private CreateNoteRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequest.java index 1a1e6c6e0742..a63a1699df5e 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequest.java @@ -26,6 +26,12 @@ private CreateOccurrenceRequest() { parent_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateOccurrenceRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private CreateOccurrenceRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequest.java index 96ed2588a3ea..c028135468ed 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequest.java @@ -26,6 +26,12 @@ private DeleteNoteRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteNoteRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private DeleteNoteRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequest.java index 8cacedb40ed6..3ddc8ef487ce 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequest.java @@ -26,6 +26,12 @@ private DeleteOccurrenceRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteOccurrenceRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private DeleteOccurrenceRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequest.java index 11a205b43e2b..7be9c35e8694 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequest.java @@ -26,6 +26,12 @@ private GetNoteRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetNoteRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private GetNoteRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequest.java index 23d0ce2afc03..4f7323b3be9f 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequest.java @@ -26,6 +26,12 @@ private GetOccurrenceNoteRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOccurrenceNoteRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private GetOccurrenceNoteRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequest.java index 2cdd2e65af1f..d0f079012e8a 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequest.java @@ -26,6 +26,12 @@ private GetOccurrenceRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetOccurrenceRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private GetOccurrenceRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequest.java index e42d51e218d7..69c7b7469d79 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequest.java @@ -29,6 +29,12 @@ private GetVulnerabilityOccurrencesSummaryRequest() { filter_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetVulnerabilityOccurrencesSummaryRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -42,7 +48,6 @@ private GetVulnerabilityOccurrencesSummaryRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Grafeas.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Grafeas.java index 1e985fa9b57b..cb9a4fc597aa 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Grafeas.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Grafeas.java @@ -295,32 +295,24 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "evtools/containeranalysis/v1beta1/grafea" + "s;grafeas\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.api.AnnotationsProto.getDescriptor(), - io.grafeas.v1beta1.attestation.AttestationOuterClass.getDescriptor(), - io.grafeas.v1beta1.build.BuildOuterClass.getDescriptor(), - io.grafeas.v1beta1.common.Common.getDescriptor(), - io.grafeas.v1beta1.deployment.DeploymentOuterClass.getDescriptor(), - io.grafeas.v1beta1.discovery.DiscoveryOuterClass.getDescriptor(), - io.grafeas.v1beta1.image.Image.getDescriptor(), - io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor(), - io.grafeas.v1beta1.provenance.Provenance.getDescriptor(), - io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.getDescriptor(), - com.google.protobuf.EmptyProto.getDescriptor(), - com.google.protobuf.FieldMaskProto.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + io.grafeas.v1beta1.attestation.AttestationOuterClass.getDescriptor(), + io.grafeas.v1beta1.build.BuildOuterClass.getDescriptor(), + io.grafeas.v1beta1.common.Common.getDescriptor(), + io.grafeas.v1beta1.deployment.DeploymentOuterClass.getDescriptor(), + io.grafeas.v1beta1.discovery.DiscoveryOuterClass.getDescriptor(), + io.grafeas.v1beta1.image.Image.getDescriptor(), + io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor(), + io.grafeas.v1beta1.provenance.Provenance.getDescriptor(), + io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); internal_static_grafeas_v1beta1_Occurrence_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_Occurrence_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequest.java index bda62926e7b7..b625f2766976 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequest.java @@ -28,6 +28,12 @@ private ListNoteOccurrencesRequest() { pageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNoteOccurrencesRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private ListNoteOccurrencesRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponse.java index 22ce63b29adf..9becfd2196d6 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponse.java @@ -27,6 +27,12 @@ private ListNoteOccurrencesResponse() { nextPageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNoteOccurrencesResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -105,7 +111,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.ListNoteOccurrencesResponse.Builder.class); } - private int bitField0_; public static final int OCCURRENCES_FIELD_NUMBER = 1; private java.util.List occurrences_; /** @@ -466,7 +471,6 @@ public io.grafeas.v1beta1.ListNoteOccurrencesResponse buildPartial() { io.grafeas.v1beta1.ListNoteOccurrencesResponse result = new io.grafeas.v1beta1.ListNoteOccurrencesResponse(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (occurrencesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { occurrences_ = java.util.Collections.unmodifiableList(occurrences_); @@ -477,7 +481,6 @@ public io.grafeas.v1beta1.ListNoteOccurrencesResponse buildPartial() { result.occurrences_ = occurrencesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequest.java index 47aaa5180bcd..f8130af0b340 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequest.java @@ -28,6 +28,12 @@ private ListNotesRequest() { pageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotesRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private ListNotesRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponse.java index 17dc2542edc8..724dfca48ba7 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponse.java @@ -27,6 +27,12 @@ private ListNotesResponse() { nextPageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListNotesResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -103,7 +109,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.ListNotesResponse.Builder.class); } - private int bitField0_; public static final int NOTES_FIELD_NUMBER = 1; private java.util.List notes_; /** @@ -464,7 +469,6 @@ public io.grafeas.v1beta1.ListNotesResponse build() { public io.grafeas.v1beta1.ListNotesResponse buildPartial() { io.grafeas.v1beta1.ListNotesResponse result = new io.grafeas.v1beta1.ListNotesResponse(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (notesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { notes_ = java.util.Collections.unmodifiableList(notes_); @@ -475,7 +479,6 @@ public io.grafeas.v1beta1.ListNotesResponse buildPartial() { result.notes_ = notesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequest.java index cd0a582d76ad..e79e6e7fe312 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequest.java @@ -28,6 +28,12 @@ private ListOccurrencesRequest() { pageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOccurrencesRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private ListOccurrencesRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponse.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponse.java index dc7b034a024f..f5126cbfe388 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponse.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponse.java @@ -27,6 +27,12 @@ private ListOccurrencesResponse() { nextPageToken_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListOccurrencesResponse(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -105,7 +111,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.ListOccurrencesResponse.Builder.class); } - private int bitField0_; public static final int OCCURRENCES_FIELD_NUMBER = 1; private java.util.List occurrences_; /** @@ -470,7 +475,6 @@ public io.grafeas.v1beta1.ListOccurrencesResponse buildPartial() { io.grafeas.v1beta1.ListOccurrencesResponse result = new io.grafeas.v1beta1.ListOccurrencesResponse(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (occurrencesBuilder_ == null) { if (((bitField0_ & 0x00000001) != 0)) { occurrences_ = java.util.Collections.unmodifiableList(occurrences_); @@ -481,7 +485,6 @@ public io.grafeas.v1beta1.ListOccurrencesResponse buildPartial() { result.occurrences_ = occurrencesBuilder_.build(); } result.nextPageToken_ = nextPageToken_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Note.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Note.java index 29084fc4c2ab..d943a5672b4f 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Note.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Note.java @@ -31,6 +31,12 @@ private Note() { relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Note(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -85,9 +91,9 @@ private Note( } case 42: { - if (!((mutable_bitField0_ & 0x00000010) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { relatedUrl_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000010; + mutable_bitField0_ |= 0x00000001; } relatedUrl_.add( input.readMessage( @@ -142,9 +148,9 @@ private Note( case 74: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000100) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { relatedNoteNames_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000100; + mutable_bitField0_ |= 0x00000002; } relatedNoteNames_.add(s); break; @@ -269,10 +275,10 @@ private Note( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000010) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { relatedUrl_ = java.util.Collections.unmodifiableList(relatedUrl_); } - if (((mutable_bitField0_ & 0x00000100) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { relatedNoteNames_ = relatedNoteNames_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -292,7 +298,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.Note.class, io.grafeas.v1beta1.Note.Builder.class); } - private int bitField0_; private int typeCase_ = 0; private java.lang.Object type_; @@ -1479,7 +1484,7 @@ public Builder clear() { if (relatedUrlBuilder_ == null) { relatedUrl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } else { relatedUrlBuilder_.clear(); } @@ -1502,7 +1507,7 @@ public Builder clear() { updateTimeBuilder_ = null; } relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000002); typeCase_ = 0; type_ = null; return this; @@ -1531,15 +1536,14 @@ public io.grafeas.v1beta1.Note build() { public io.grafeas.v1beta1.Note buildPartial() { io.grafeas.v1beta1.Note result = new io.grafeas.v1beta1.Note(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.name_ = name_; result.shortDescription_ = shortDescription_; result.longDescription_ = longDescription_; result.kind_ = kind_; if (relatedUrlBuilder_ == null) { - if (((bitField0_ & 0x00000010) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { relatedUrl_ = java.util.Collections.unmodifiableList(relatedUrl_); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } result.relatedUrl_ = relatedUrl_; } else { @@ -1560,9 +1564,9 @@ public io.grafeas.v1beta1.Note buildPartial() { } else { result.updateTime_ = updateTimeBuilder_.build(); } - if (((bitField0_ & 0x00000100) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { relatedNoteNames_ = relatedNoteNames_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000002); } result.relatedNoteNames_ = relatedNoteNames_; if (typeCase_ == 10) { @@ -1614,7 +1618,6 @@ public io.grafeas.v1beta1.Note buildPartial() { result.type_ = attestationAuthorityBuilder_.build(); } } - result.bitField0_ = to_bitField0_; result.typeCase_ = typeCase_; onBuilt(); return result; @@ -1684,7 +1687,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.Note other) { if (!other.relatedUrl_.isEmpty()) { if (relatedUrl_.isEmpty()) { relatedUrl_ = other.relatedUrl_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureRelatedUrlIsMutable(); relatedUrl_.addAll(other.relatedUrl_); @@ -1697,7 +1700,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.Note other) { relatedUrlBuilder_.dispose(); relatedUrlBuilder_ = null; relatedUrl_ = other.relatedUrl_; - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); relatedUrlBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRelatedUrlFieldBuilder() @@ -1719,7 +1722,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.Note other) { if (!other.relatedNoteNames_.isEmpty()) { if (relatedNoteNames_.isEmpty()) { relatedNoteNames_ = other.relatedNoteNames_; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureRelatedNoteNamesIsMutable(); relatedNoteNames_.addAll(other.relatedNoteNames_); @@ -2183,9 +2186,9 @@ public Builder clearKind() { java.util.Collections.emptyList(); private void ensureRelatedUrlIsMutable() { - if (!((bitField0_ & 0x00000010) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { relatedUrl_ = new java.util.ArrayList(relatedUrl_); - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000001; } } @@ -2400,7 +2403,7 @@ public Builder addAllRelatedUrl( public Builder clearRelatedUrl() { if (relatedUrlBuilder_ == null) { relatedUrl_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { relatedUrlBuilder_.clear(); @@ -2521,7 +2524,7 @@ public java.util.List getRelatedUr io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder>( - relatedUrl_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); + relatedUrl_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); relatedUrl_ = null; } return relatedUrlBuilder_; @@ -3088,9 +3091,9 @@ public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureRelatedNoteNamesIsMutable() { - if (!((bitField0_ & 0x00000100) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { relatedNoteNames_ = new com.google.protobuf.LazyStringArrayList(relatedNoteNames_); - bitField0_ |= 0x00000100; + bitField0_ |= 0x00000002; } } /** @@ -3203,7 +3206,7 @@ public Builder addAllRelatedNoteNames(java.lang.Iterable value */ public Builder clearRelatedNoteNames() { relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000100); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Occurrence.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Occurrence.java index 69216d5685a7..f24f8e457c75 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Occurrence.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Occurrence.java @@ -29,6 +29,12 @@ private Occurrence() { remediation_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Occurrence(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -42,7 +48,6 @@ private Occurrence( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Resource.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Resource.java index 4a8906f7a4f4..f0fbb21ace4d 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Resource.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Resource.java @@ -27,6 +27,12 @@ private Resource() { uri_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Resource(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private Resource( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequest.java index d693f718fa50..e95ec7718937 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequest.java @@ -26,6 +26,12 @@ private UpdateNoteRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateNoteRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private UpdateNoteRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequest.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequest.java index 833710d9eb9c..46b7bcc8265f 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequest.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequest.java @@ -26,6 +26,12 @@ private UpdateOccurrenceRequest() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateOccurrenceRequest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private UpdateOccurrenceRequest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummary.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummary.java index a5bd73918838..3147980a8131 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummary.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummary.java @@ -28,6 +28,12 @@ private VulnerabilityOccurrencesSummary() { counts_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VulnerabilityOccurrencesSummary(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -208,6 +214,12 @@ private FixableTotalByDigest() { severity_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FixableTotalByDigest(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -221,7 +233,6 @@ private FixableTotalByDigest( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Attestation.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Attestation.java index 574901d1bf1e..e3f8597ac7d2 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Attestation.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Attestation.java @@ -31,6 +31,12 @@ private Attestation(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Attestation() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Attestation(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -44,7 +50,6 @@ private Attestation( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOuterClass.java index d3727183f2a4..03122013f310 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOuterClass.java @@ -62,16 +62,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ineranalysis/v1beta1/attestation;attesta" + "tion\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Authority.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Authority.java index 04dc39960c05..77c310697d44 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Authority.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Authority.java @@ -31,6 +31,12 @@ private Authority(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Authority() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Authority(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -44,7 +50,6 @@ private Authority( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -160,6 +165,12 @@ private Hint() { humanReadableName_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Hint(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -173,7 +184,6 @@ private Hint( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Details.java index b9e121cafb50..38c82fcea119 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Details.java @@ -24,6 +24,12 @@ private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Details() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestation.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestation.java index aff40b1fa5b1..0266b8d6984b 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestation.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestation.java @@ -29,6 +29,12 @@ private PgpSignedAttestation() { contentType_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PgpSignedAttestation(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -42,7 +48,6 @@ private PgpSignedAttestation( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Build.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Build.java index b57f4d99c341..4dd59d17fde5 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Build.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Build.java @@ -27,6 +27,12 @@ private Build() { builderVersion_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Build(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private Build( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOuterClass.java index 7aad855176f5..d37f7758b861 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOuterClass.java @@ -52,20 +52,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/containeranalysis/v1beta1/build;build\242\002" + "\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.grafeas.v1beta1.provenance.Provenance.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1beta1.provenance.Provenance.getDescriptor(), + }); internal_static_grafeas_v1beta1_build_Build_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_build_Build_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignature.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignature.java index 6a7c9581d696..0eda58aaefe9 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignature.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignature.java @@ -29,6 +29,12 @@ private BuildSignature() { keyType_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuildSignature(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -42,7 +48,6 @@ private BuildSignature( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Details.java index 65ef709e7642..c5a4ec9da1f9 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Details.java @@ -26,6 +26,12 @@ private Details() { provenanceBytes_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -39,7 +45,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/Common.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/Common.java index 412b065b8e97..03ae16818b0a 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/Common.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/Common.java @@ -36,16 +36,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "oto/googleapis/devtools/containeranalysi" + "s/v1beta1/common;common\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_grafeas_v1beta1_RelatedUrl_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_RelatedUrl_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrl.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrl.java index 5e1f4b966d5c..d60ba77ab1a9 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrl.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrl.java @@ -27,6 +27,12 @@ private RelatedUrl() { label_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelatedUrl(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private RelatedUrl( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployable.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployable.java index 58543ce8905d..09b35da40950 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployable.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployable.java @@ -26,6 +26,12 @@ private Deployable() { resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Deployable(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployment.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployment.java index f164a4212e52..6b720fba266a 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployment.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployment.java @@ -30,6 +30,12 @@ private Deployment() { platform_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Deployment(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -108,9 +114,9 @@ private Deployment( case 50: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000020) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { resourceUri_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000001; } resourceUri_.add(s); break; @@ -136,7 +142,7 @@ private Deployment( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000020) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { resourceUri_ = resourceUri_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -326,7 +332,6 @@ private Platform(int value) { // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.deployment.Deployment.Platform) } - private int bitField0_; public static final int USER_EMAIL_FIELD_NUMBER = 1; private volatile java.lang.Object userEmail_; /** @@ -916,7 +921,7 @@ public Builder clear() { address_ = ""; resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000001); platform_ = 0; return this; @@ -947,7 +952,6 @@ public io.grafeas.v1beta1.deployment.Deployment buildPartial() { io.grafeas.v1beta1.deployment.Deployment result = new io.grafeas.v1beta1.deployment.Deployment(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.userEmail_ = userEmail_; if (deployTimeBuilder_ == null) { result.deployTime_ = deployTime_; @@ -961,13 +965,12 @@ public io.grafeas.v1beta1.deployment.Deployment buildPartial() { } result.config_ = config_; result.address_ = address_; - if (((bitField0_ & 0x00000020) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { resourceUri_ = resourceUri_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000001); } result.resourceUri_ = resourceUri_; result.platform_ = platform_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -1038,7 +1041,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.deployment.Deployment other) { if (!other.resourceUri_.isEmpty()) { if (resourceUri_.isEmpty()) { resourceUri_ = other.resourceUri_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureResourceUriIsMutable(); resourceUri_.addAll(other.resourceUri_); @@ -1725,9 +1728,9 @@ public Builder setAddressBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureResourceUriIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { resourceUri_ = new com.google.protobuf.LazyStringArrayList(resourceUri_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000001; } } /** @@ -1848,7 +1851,7 @@ public Builder addAllResourceUri(java.lang.Iterable values) { */ public Builder clearResourceUri() { resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOuterClass.java index 27860465d1f9..dd7c90f55da1 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOuterClass.java @@ -52,20 +52,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "/devtools/containeranalysis/v1beta1/depl" + "oyment;deployment\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - com.google.protobuf.TimestampProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.TimestampProto.getDescriptor(), + }); internal_static_grafeas_v1beta1_deployment_Deployable_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_deployment_Deployable_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Details.java index 3c293ecfef3a..e601c7dff32b 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Details.java @@ -24,6 +24,12 @@ private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Details() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Details.java index 4eaf0da89ec2..8cf44aa1fb30 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Details.java @@ -24,6 +24,12 @@ private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Details() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovered.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovered.java index a6a09b205421..027360b47eed 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovered.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovered.java @@ -27,6 +27,12 @@ private Discovered() { analysisStatus_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Discovered(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private Discovered( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovery.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovery.java index 446bfe3498fd..88e6bb50df92 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovery.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovery.java @@ -28,6 +28,12 @@ private Discovery() { analysisKind_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Discovery(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private Discovery( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOuterClass.java index 7b33ccd4004c..a45b75d13f4e 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOuterClass.java @@ -60,22 +60,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ineranalysis/v1beta1/discovery;discovery" + "\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.grafeas.v1beta1.common.Common.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - com.google.rpc.StatusProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1beta1.common.Common.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), + }); internal_static_grafeas_v1beta1_discovery_Discovery_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_discovery_Discovery_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Basis.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Basis.java index 08f90b2a1264..144731e0ac59 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Basis.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Basis.java @@ -30,6 +30,12 @@ private Basis() { resourceUrl_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Basis(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -43,7 +49,6 @@ private Basis( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Derived.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Derived.java index 1d1eb583d13f..f0889eb188b0 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Derived.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Derived.java @@ -29,6 +29,12 @@ private Derived() { baseResourceUrl_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Derived(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -76,9 +82,9 @@ private Derived( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { layerInfo_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } layerInfo_.add( input.readMessage(io.grafeas.v1beta1.image.Layer.parser(), extensionRegistry)); @@ -105,7 +111,7 @@ private Derived( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { layerInfo_ = java.util.Collections.unmodifiableList(layerInfo_); } this.unknownFields = unknownFields.build(); @@ -126,7 +132,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.image.Derived.class, io.grafeas.v1beta1.image.Derived.Builder.class); } - private int bitField0_; public static final int FINGERPRINT_FIELD_NUMBER = 1; private io.grafeas.v1beta1.image.Fingerprint fingerprint_; /** @@ -553,7 +558,7 @@ public Builder clear() { if (layerInfoBuilder_ == null) { layerInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { layerInfoBuilder_.clear(); } @@ -586,7 +591,6 @@ public io.grafeas.v1beta1.image.Derived build() { public io.grafeas.v1beta1.image.Derived buildPartial() { io.grafeas.v1beta1.image.Derived result = new io.grafeas.v1beta1.image.Derived(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (fingerprintBuilder_ == null) { result.fingerprint_ = fingerprint_; } else { @@ -594,16 +598,15 @@ public io.grafeas.v1beta1.image.Derived buildPartial() { } result.distance_ = distance_; if (layerInfoBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { layerInfo_ = java.util.Collections.unmodifiableList(layerInfo_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.layerInfo_ = layerInfo_; } else { result.layerInfo_ = layerInfoBuilder_.build(); } result.baseResourceUrl_ = baseResourceUrl_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -663,7 +666,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.image.Derived other) { if (!other.layerInfo_.isEmpty()) { if (layerInfo_.isEmpty()) { layerInfo_ = other.layerInfo_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLayerInfoIsMutable(); layerInfo_.addAll(other.layerInfo_); @@ -676,7 +679,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.image.Derived other) { layerInfoBuilder_.dispose(); layerInfoBuilder_ = null; layerInfo_ = other.layerInfo_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); layerInfoBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getLayerInfoFieldBuilder() @@ -953,9 +956,9 @@ public Builder clearDistance() { java.util.Collections.emptyList(); private void ensureLayerInfoIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { layerInfo_ = new java.util.ArrayList(layerInfo_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -1190,7 +1193,7 @@ public Builder addAllLayerInfo( public Builder clearLayerInfo() { if (layerInfoBuilder_ == null) { layerInfo_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { layerInfoBuilder_.clear(); @@ -1325,7 +1328,7 @@ public java.util.List getLayerInfoBuilde io.grafeas.v1beta1.image.Layer, io.grafeas.v1beta1.image.Layer.Builder, io.grafeas.v1beta1.image.LayerOrBuilder>( - layerInfo_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + layerInfo_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); layerInfo_ = null; } return layerInfoBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Details.java index eeeb5ff69419..d1ff805cae62 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Details.java @@ -24,6 +24,12 @@ private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Details() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Fingerprint.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Fingerprint.java index 530c3e2b6b2c..7f1aa1f4d238 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Fingerprint.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Fingerprint.java @@ -28,6 +28,12 @@ private Fingerprint() { v2Name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Fingerprint(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -62,9 +68,9 @@ private Fingerprint( case 18: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { v2Blob_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } v2Blob_.add(s); break; @@ -90,7 +96,7 @@ private Fingerprint( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { v2Blob_ = v2Blob_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -113,7 +119,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.image.Fingerprint.Builder.class); } - private int bitField0_; public static final int V1_NAME_FIELD_NUMBER = 1; private volatile java.lang.Object v1Name_; /** @@ -487,7 +492,7 @@ public Builder clear() { v1Name_ = ""; v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); v2Name_ = ""; return this; @@ -517,15 +522,13 @@ public io.grafeas.v1beta1.image.Fingerprint build() { public io.grafeas.v1beta1.image.Fingerprint buildPartial() { io.grafeas.v1beta1.image.Fingerprint result = new io.grafeas.v1beta1.image.Fingerprint(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.v1Name_ = v1Name_; - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { v2Blob_ = v2Blob_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.v2Blob_ = v2Blob_; result.v2Name_ = v2Name_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -582,7 +585,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.image.Fingerprint other) { if (!other.v2Blob_.isEmpty()) { if (v2Blob_.isEmpty()) { v2Blob_ = other.v2Blob_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureV2BlobIsMutable(); v2Blob_.addAll(other.v2Blob_); @@ -722,9 +725,9 @@ public Builder setV1NameBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureV2BlobIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { v2Blob_ = new com.google.protobuf.LazyStringArrayList(v2Blob_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } /** @@ -837,7 +840,7 @@ public Builder addAllV2Blob(java.lang.Iterable values) { */ public Builder clearV2Blob() { v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Image.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Image.java index 07c426ea996f..de32435b1048 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Image.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Image.java @@ -66,16 +66,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ntaineranalysis/v1beta1/image;image\242\002\003GR" + "Ab\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_grafeas_v1beta1_image_Layer_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_image_Layer_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Layer.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Layer.java index 785a9b0829e2..12d0f3f3b1cd 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Layer.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Layer.java @@ -27,6 +27,12 @@ private Layer() { arguments_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Layer(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private Layer( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Details.java index 0d02a5b21566..afe510b8eca5 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Details.java @@ -24,6 +24,12 @@ private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Details() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private Details( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Distribution.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Distribution.java index 15b5c35c9796..202c33d674f6 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Distribution.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Distribution.java @@ -31,6 +31,12 @@ private Distribution() { description_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Distribution(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -44,7 +50,6 @@ private Distribution( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Installation.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Installation.java index 95528469a39c..da086f16a654 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Installation.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Installation.java @@ -28,6 +28,12 @@ private Installation() { location_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Installation(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -61,9 +67,9 @@ private Installation( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { location_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } location_.add( input.readMessage(io.grafeas.v1beta1.pkg.Location.parser(), extensionRegistry)); @@ -83,7 +89,7 @@ private Installation( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { location_ = java.util.Collections.unmodifiableList(location_); } this.unknownFields = unknownFields.build(); @@ -106,7 +112,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.pkg.Installation.Builder.class); } - private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -439,7 +444,7 @@ public Builder clear() { if (locationBuilder_ == null) { location_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { locationBuilder_.clear(); } @@ -470,18 +475,16 @@ public io.grafeas.v1beta1.pkg.Installation build() { public io.grafeas.v1beta1.pkg.Installation buildPartial() { io.grafeas.v1beta1.pkg.Installation result = new io.grafeas.v1beta1.pkg.Installation(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.name_ = name_; if (locationBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { location_ = java.util.Collections.unmodifiableList(location_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.location_ = location_; } else { result.location_ = locationBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -539,7 +542,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.pkg.Installation other) { if (!other.location_.isEmpty()) { if (location_.isEmpty()) { location_ = other.location_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureLocationIsMutable(); location_.addAll(other.location_); @@ -552,7 +555,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.pkg.Installation other) { locationBuilder_.dispose(); locationBuilder_ = null; location_ = other.location_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); locationBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getLocationFieldBuilder() @@ -691,9 +694,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureLocationIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { location_ = new java.util.ArrayList(location_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -917,7 +920,7 @@ public Builder addAllLocation( public Builder clearLocation() { if (locationBuilder_ == null) { location_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { locationBuilder_.clear(); @@ -1045,7 +1048,7 @@ public java.util.List getLocationBuilde io.grafeas.v1beta1.pkg.Location, io.grafeas.v1beta1.pkg.Location.Builder, io.grafeas.v1beta1.pkg.LocationOrBuilder>( - location_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + location_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); location_ = null; } return locationBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Location.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Location.java index 6286ebfbbfd2..4c0f1be97320 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Location.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Location.java @@ -28,6 +28,12 @@ private Location() { path_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Location(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private Location( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Package.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Package.java index bf4d0914261e..adde4cf781aa 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Package.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Package.java @@ -29,6 +29,12 @@ private Package() { distribution_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Package(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -62,9 +68,9 @@ private Package( } case 82: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { distribution_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } distribution_.add( input.readMessage( @@ -85,7 +91,7 @@ private Package( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { distribution_ = java.util.Collections.unmodifiableList(distribution_); } this.unknownFields = unknownFields.build(); @@ -107,7 +113,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.pkg.Package.class, io.grafeas.v1beta1.pkg.Package.Builder.class); } - private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -435,7 +440,7 @@ public Builder clear() { if (distributionBuilder_ == null) { distribution_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { distributionBuilder_.clear(); } @@ -466,18 +471,16 @@ public io.grafeas.v1beta1.pkg.Package build() { public io.grafeas.v1beta1.pkg.Package buildPartial() { io.grafeas.v1beta1.pkg.Package result = new io.grafeas.v1beta1.pkg.Package(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.name_ = name_; if (distributionBuilder_ == null) { - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { distribution_ = java.util.Collections.unmodifiableList(distribution_); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.distribution_ = distribution_; } else { result.distribution_ = distributionBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -535,7 +538,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.pkg.Package other) { if (!other.distribution_.isEmpty()) { if (distribution_.isEmpty()) { distribution_ = other.distribution_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDistributionIsMutable(); distribution_.addAll(other.distribution_); @@ -548,7 +551,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.pkg.Package other) { distributionBuilder_.dispose(); distributionBuilder_ = null; distribution_ = other.distribution_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); distributionBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDistributionFieldBuilder() @@ -687,9 +690,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureDistributionIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { distribution_ = new java.util.ArrayList(distribution_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } @@ -904,7 +907,7 @@ public Builder addAllDistribution( public Builder clearDistribution() { if (distributionBuilder_ == null) { distribution_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { distributionBuilder_.clear(); @@ -1026,7 +1029,7 @@ public io.grafeas.v1beta1.pkg.Distribution.Builder addDistributionBuilder(int in io.grafeas.v1beta1.pkg.Distribution, io.grafeas.v1beta1.pkg.Distribution.Builder, io.grafeas.v1beta1.pkg.DistributionOrBuilder>( - distribution_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); + distribution_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); distribution_ = null; } return distributionBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOuterClass.java index e86b405e4e69..d7270ff0dff1 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOuterClass.java @@ -72,16 +72,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "eapis/devtools/containeranalysis/v1beta1" + "/package;package\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_grafeas_v1beta1_package_Distribution_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_package_Distribution_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Version.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Version.java index 263ee21c25a3..6aeb4d57e58d 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Version.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Version.java @@ -28,6 +28,12 @@ private Version() { kind_ = 0; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Version(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private Version( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Artifact.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Artifact.java index 1d40b2c53ade..50820d1da233 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Artifact.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Artifact.java @@ -28,6 +28,12 @@ private Artifact() { names_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Artifact(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -69,9 +75,9 @@ private Artifact( case 26: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { names_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } names_.add(s); break; @@ -90,7 +96,7 @@ private Artifact( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { names_ = names_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -113,7 +119,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.provenance.Artifact.Builder.class); } - private int bitField0_; public static final int CHECKSUM_FIELD_NUMBER = 1; private volatile java.lang.Object checksum_; /** @@ -504,7 +509,7 @@ public Builder clear() { id_ = ""; names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); return this; } @@ -533,15 +538,13 @@ public io.grafeas.v1beta1.provenance.Artifact buildPartial() { io.grafeas.v1beta1.provenance.Artifact result = new io.grafeas.v1beta1.provenance.Artifact(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.checksum_ = checksum_; result.id_ = id_; - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { names_ = names_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.names_ = names_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -602,7 +605,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Artifact other) { if (!other.names_.isEmpty()) { if (names_.isEmpty()) { names_ = other.names_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureNamesIsMutable(); names_.addAll(other.names_); @@ -842,9 +845,9 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureNamesIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { names_ = new com.google.protobuf.LazyStringArrayList(names_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } /** @@ -989,7 +992,7 @@ public Builder addAllNames(java.lang.Iterable values) { */ public Builder clearNames() { names_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenance.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenance.java index 18a1eaebcf0e..0d17eb1d2a6c 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenance.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenance.java @@ -34,6 +34,12 @@ private BuildProvenance() { builderVersion_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BuildProvenance(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -74,9 +80,9 @@ private BuildProvenance( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { commands_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } commands_.add( input.readMessage( @@ -85,9 +91,9 @@ private BuildProvenance( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { builtArtifacts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000002; } builtArtifacts_.add( input.readMessage( @@ -178,11 +184,11 @@ private BuildProvenance( } case 98: { - if (!((mutable_bitField0_ & 0x00000800) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { buildOptions_ = com.google.protobuf.MapField.newMapField( BuildOptionsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000800; + mutable_bitField0_ |= 0x00000004; } com.google.protobuf.MapEntry buildOptions__ = input.readMessage( @@ -212,10 +218,10 @@ private BuildProvenance( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { commands_ = java.util.Collections.unmodifiableList(commands_); } - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { builtArtifacts_ = java.util.Collections.unmodifiableList(builtArtifacts_); } this.unknownFields = unknownFields.build(); @@ -249,7 +255,6 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { io.grafeas.v1beta1.provenance.BuildProvenance.Builder.class); } - private int bitField0_; public static final int ID_FIELD_NUMBER = 1; private volatile java.lang.Object id_; /** @@ -1272,13 +1277,13 @@ public Builder clear() { if (commandsBuilder_ == null) { commands_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { commandsBuilder_.clear(); } if (builtArtifactsBuilder_ == null) { builtArtifacts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { builtArtifactsBuilder_.clear(); } @@ -1343,22 +1348,21 @@ public io.grafeas.v1beta1.provenance.BuildProvenance buildPartial() { io.grafeas.v1beta1.provenance.BuildProvenance result = new io.grafeas.v1beta1.provenance.BuildProvenance(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.id_ = id_; result.projectId_ = projectId_; if (commandsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { commands_ = java.util.Collections.unmodifiableList(commands_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.commands_ = commands_; } else { result.commands_ = commandsBuilder_.build(); } if (builtArtifactsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { builtArtifacts_ = java.util.Collections.unmodifiableList(builtArtifacts_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } result.builtArtifacts_ = builtArtifacts_; } else { @@ -1390,7 +1394,6 @@ public io.grafeas.v1beta1.provenance.BuildProvenance buildPartial() { result.buildOptions_ = internalGetBuildOptions(); result.buildOptions_.makeImmutable(); result.builderVersion_ = builderVersion_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -1452,7 +1455,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.BuildProvenance other) { if (!other.commands_.isEmpty()) { if (commands_.isEmpty()) { commands_ = other.commands_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureCommandsIsMutable(); commands_.addAll(other.commands_); @@ -1465,7 +1468,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.BuildProvenance other) { commandsBuilder_.dispose(); commandsBuilder_ = null; commands_ = other.commands_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); commandsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getCommandsFieldBuilder() @@ -1479,7 +1482,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.BuildProvenance other) { if (!other.builtArtifacts_.isEmpty()) { if (builtArtifacts_.isEmpty()) { builtArtifacts_ = other.builtArtifacts_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureBuiltArtifactsIsMutable(); builtArtifacts_.addAll(other.builtArtifacts_); @@ -1492,7 +1495,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.BuildProvenance other) { builtArtifactsBuilder_.dispose(); builtArtifactsBuilder_ = null; builtArtifacts_ = other.builtArtifacts_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); builtArtifactsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getBuiltArtifactsFieldBuilder() @@ -1754,9 +1757,9 @@ public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureCommandsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { commands_ = new java.util.ArrayList(commands_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -1971,7 +1974,7 @@ public Builder addAllCommands( public Builder clearCommands() { if (commandsBuilder_ == null) { commands_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { commandsBuilder_.clear(); @@ -2092,7 +2095,7 @@ public java.util.List getCommands io.grafeas.v1beta1.provenance.Command, io.grafeas.v1beta1.provenance.Command.Builder, io.grafeas.v1beta1.provenance.CommandOrBuilder>( - commands_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + commands_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); commands_ = null; } return commandsBuilder_; @@ -2102,10 +2105,10 @@ public java.util.List getCommands java.util.Collections.emptyList(); private void ensureBuiltArtifactsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { builtArtifacts_ = new java.util.ArrayList(builtArtifacts_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; } } @@ -2321,7 +2324,7 @@ public Builder addAllBuiltArtifacts( public Builder clearBuiltArtifacts() { if (builtArtifactsBuilder_ == null) { builtArtifacts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { builtArtifactsBuilder_.clear(); @@ -2444,7 +2447,7 @@ public io.grafeas.v1beta1.provenance.Artifact.Builder addBuiltArtifactsBuilder(i io.grafeas.v1beta1.provenance.Artifact.Builder, io.grafeas.v1beta1.provenance.ArtifactOrBuilder>( builtArtifacts_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); builtArtifacts_ = null; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Command.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Command.java index cc3da42143f1..6a4a62b3f026 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Command.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Command.java @@ -31,6 +31,12 @@ private Command() { waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Command(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -65,9 +71,9 @@ private Command( case 18: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { env_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } env_.add(s); break; @@ -75,9 +81,9 @@ private Command( case 26: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { args_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000002; } args_.add(s); break; @@ -99,9 +105,9 @@ private Command( case 50: { java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000020) != 0)) { + if (!((mutable_bitField0_ & 0x00000004) != 0)) { waitFor_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000004; } waitFor_.add(s); break; @@ -120,13 +126,13 @@ private Command( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000002) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { env_ = env_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { args_ = args_.getUnmodifiableView(); } - if (((mutable_bitField0_ & 0x00000020) != 0)) { + if (((mutable_bitField0_ & 0x00000004) != 0)) { waitFor_ = waitFor_.getUnmodifiableView(); } this.unknownFields = unknownFields.build(); @@ -149,7 +155,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.provenance.Command.Builder.class); } - private int bitField0_; public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -709,15 +714,15 @@ public Builder clear() { name_ = ""; env_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); args_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); dir_ = ""; id_ = ""; waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -746,26 +751,24 @@ public io.grafeas.v1beta1.provenance.Command buildPartial() { io.grafeas.v1beta1.provenance.Command result = new io.grafeas.v1beta1.provenance.Command(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.name_ = name_; - if (((bitField0_ & 0x00000002) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { env_ = env_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } result.env_ = env_; - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { args_ = args_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } result.args_ = args_; result.dir_ = dir_; result.id_ = id_; - if (((bitField0_ & 0x00000020) != 0)) { + if (((bitField0_ & 0x00000004) != 0)) { waitFor_ = waitFor_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); } result.waitFor_ = waitFor_; - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -822,7 +825,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Command other) { if (!other.env_.isEmpty()) { if (env_.isEmpty()) { env_ = other.env_; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureEnvIsMutable(); env_.addAll(other.env_); @@ -832,7 +835,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Command other) { if (!other.args_.isEmpty()) { if (args_.isEmpty()) { args_ = other.args_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureArgsIsMutable(); args_.addAll(other.args_); @@ -850,7 +853,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Command other) { if (!other.waitFor_.isEmpty()) { if (waitFor_.isEmpty()) { waitFor_ = other.waitFor_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); } else { ensureWaitForIsMutable(); waitFor_.addAll(other.waitFor_); @@ -990,9 +993,9 @@ public Builder setNameBytes(com.google.protobuf.ByteString value) { private com.google.protobuf.LazyStringList env_ = com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureEnvIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { env_ = new com.google.protobuf.LazyStringArrayList(env_); - bitField0_ |= 0x00000002; + bitField0_ |= 0x00000001; } } /** @@ -1105,7 +1108,7 @@ public Builder addAllEnv(java.lang.Iterable values) { */ public Builder clearEnv() { env_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } @@ -1133,9 +1136,9 @@ public Builder addEnvBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureArgsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { args_ = new com.google.protobuf.LazyStringArrayList(args_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; } } /** @@ -1248,7 +1251,7 @@ public Builder addAllArgs(java.lang.Iterable values) { */ public Builder clearArgs() { args_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); return this; } @@ -1474,9 +1477,9 @@ public Builder setIdBytes(com.google.protobuf.ByteString value) { com.google.protobuf.LazyStringArrayList.EMPTY; private void ensureWaitForIsMutable() { - if (!((bitField0_ & 0x00000020) != 0)) { + if (!((bitField0_ & 0x00000004) != 0)) { waitFor_ = new com.google.protobuf.LazyStringArrayList(waitFor_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000004; } } /** @@ -1589,7 +1592,7 @@ public Builder addAllWaitFor(java.lang.Iterable values) { */ public Builder clearWaitFor() { waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashes.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashes.java index daac09abca0d..885460f6d0d6 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashes.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashes.java @@ -27,6 +27,12 @@ private FileHashes() { fileHash_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FileHashes(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Hash.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Hash.java index 1736b048395f..5103afbced69 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Hash.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Hash.java @@ -27,6 +27,12 @@ private Hash() { value_ = com.google.protobuf.ByteString.EMPTY; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Hash(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private Hash( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Provenance.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Provenance.java index 6f213136cfc4..ae6408b93afa 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Provenance.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Provenance.java @@ -95,21 +95,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "s/containeranalysis/v1beta1/provenance;p" + "rovenance\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.grafeas.v1beta1.source.Source.getDescriptor(), - com.google.protobuf.TimestampProto.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1beta1.source.Source.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_provenance_BuildProvenance_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Source.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Source.java index 6430bb0485b2..116fd2b028e6 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Source.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Source.java @@ -27,6 +27,12 @@ private Source() { additionalContexts_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Source(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -60,11 +66,11 @@ private Source( } case 18: { - if (!((mutable_bitField0_ & 0x00000002) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { fileHashes_ = com.google.protobuf.MapField.newMapField( FileHashesDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000002; + mutable_bitField0_ |= 0x00000001; } com.google.protobuf.MapEntry< java.lang.String, io.grafeas.v1beta1.provenance.FileHashes> @@ -93,10 +99,10 @@ private Source( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { additionalContexts_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000002; } additionalContexts_.add( input.readMessage( @@ -117,7 +123,7 @@ private Source( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { additionalContexts_ = java.util.Collections.unmodifiableList(additionalContexts_); } this.unknownFields = unknownFields.build(); @@ -151,7 +157,6 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { io.grafeas.v1beta1.provenance.Source.Builder.class); } - private int bitField0_; public static final int ARTIFACT_STORAGE_SOURCE_URI_FIELD_NUMBER = 1; private volatile java.lang.Object artifactStorageSourceUri_; /** @@ -720,7 +725,7 @@ public Builder clear() { } if (additionalContextsBuilder_ == null) { additionalContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { additionalContextsBuilder_.clear(); } @@ -751,7 +756,6 @@ public io.grafeas.v1beta1.provenance.Source build() { public io.grafeas.v1beta1.provenance.Source buildPartial() { io.grafeas.v1beta1.provenance.Source result = new io.grafeas.v1beta1.provenance.Source(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.artifactStorageSourceUri_ = artifactStorageSourceUri_; result.fileHashes_ = internalGetFileHashes(); result.fileHashes_.makeImmutable(); @@ -761,15 +765,14 @@ public io.grafeas.v1beta1.provenance.Source buildPartial() { result.context_ = contextBuilder_.build(); } if (additionalContextsBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { additionalContexts_ = java.util.Collections.unmodifiableList(additionalContexts_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } result.additionalContexts_ = additionalContexts_; } else { result.additionalContexts_ = additionalContextsBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -831,7 +834,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Source other) { if (!other.additionalContexts_.isEmpty()) { if (additionalContexts_.isEmpty()) { additionalContexts_ = other.additionalContexts_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureAdditionalContextsIsMutable(); additionalContexts_.addAll(other.additionalContexts_); @@ -844,7 +847,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.provenance.Source other) { additionalContextsBuilder_.dispose(); additionalContextsBuilder_ = null; additionalContexts_ = other.additionalContexts_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); additionalContextsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAdditionalContextsFieldBuilder() @@ -1367,10 +1370,10 @@ public io.grafeas.v1beta1.source.SourceContextOrBuilder getContextOrBuilder() { java.util.Collections.emptyList(); private void ensureAdditionalContextsIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { additionalContexts_ = new java.util.ArrayList(additionalContexts_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; } } @@ -1619,7 +1622,7 @@ public Builder addAllAdditionalContexts( public Builder clearAdditionalContexts() { if (additionalContextsBuilder_ == null) { additionalContexts_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { additionalContextsBuilder_.clear(); @@ -1764,7 +1767,7 @@ public io.grafeas.v1beta1.source.SourceContext.Builder addAdditionalContextsBuil io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder>( additionalContexts_, - ((bitField0_ & 0x00000008) != 0), + ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); additionalContexts_ = null; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContext.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContext.java index fe42f701e1ff..9fc77208d3a1 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContext.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContext.java @@ -27,6 +27,12 @@ private AliasContext() { name_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AliasContext(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private AliasContext( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContext.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContext.java index 9242fc5899fb..ff078e5545a7 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContext.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContext.java @@ -25,6 +25,12 @@ private CloudRepoSourceContext(com.google.protobuf.GeneratedMessageV3.Builder private CloudRepoSourceContext() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CloudRepoSourceContext(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -38,7 +44,6 @@ private CloudRepoSourceContext( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContext.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContext.java index d9927ca870dd..11ddac5ced5e 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContext.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContext.java @@ -27,6 +27,12 @@ private GerritSourceContext() { gerritProject_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GerritSourceContext(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private GerritSourceContext( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContext.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContext.java index 8de5fa81a220..33b14ef591ee 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContext.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContext.java @@ -28,6 +28,12 @@ private GitSourceContext() { revisionId_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GitSourceContext(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private GitSourceContext( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoId.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoId.java index 40b590e05def..4836aaff9e98 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoId.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoId.java @@ -28,6 +28,12 @@ private ProjectRepoId() { repoName_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ProjectRepoId(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -41,7 +47,6 @@ private ProjectRepoId( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoId.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoId.java index 170712cd7f77..4094ec6773e7 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoId.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoId.java @@ -24,6 +24,12 @@ private RepoId(com.google.protobuf.GeneratedMessageV3.Builder builder) { private RepoId() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RepoId(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -37,7 +43,6 @@ private RepoId( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/Source.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/Source.java index 25c861321c8d..f0d09842cfb3 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/Source.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/Source.java @@ -86,16 +86,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ntaineranalysis/v1beta1/source;source\242\002\003" + "GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}, assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); internal_static_grafeas_v1beta1_source_SourceContext_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_source_SourceContext_fieldAccessorTable = diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContext.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContext.java index fef52ae912ab..bb2e93e0b81b 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContext.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContext.java @@ -25,6 +25,12 @@ private SourceContext(com.google.protobuf.GeneratedMessageV3.Builder builder) private SourceContext() {} + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SourceContext(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -100,10 +106,10 @@ private SourceContext( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000001; } com.google.protobuf.MapEntry labels__ = input.readMessage( @@ -156,7 +162,6 @@ protected com.google.protobuf.MapField internalGetMapField(int number) { io.grafeas.v1beta1.source.SourceContext.Builder.class); } - private int bitField0_; private int contextCase_ = 0; private java.lang.Object context_; @@ -742,7 +747,6 @@ public io.grafeas.v1beta1.source.SourceContext buildPartial() { io.grafeas.v1beta1.source.SourceContext result = new io.grafeas.v1beta1.source.SourceContext(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; if (contextCase_ == 1) { if (cloudRepoBuilder_ == null) { result.context_ = context_; @@ -766,7 +770,6 @@ public io.grafeas.v1beta1.source.SourceContext buildPartial() { } result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); - result.bitField0_ = to_bitField0_; result.contextCase_ = contextCase_; onBuilt(); return result; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Details.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Details.java index d75d84c49436..51c3d35136d7 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Details.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Details.java @@ -31,6 +31,12 @@ private Details() { relatedUrls_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -76,10 +82,10 @@ private Details( } case 34: { - if (!((mutable_bitField0_ & 0x00000008) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { packageIssue_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000008; + mutable_bitField0_ |= 0x00000001; } packageIssue_.add( input.readMessage( @@ -102,9 +108,9 @@ private Details( } case 58: { - if (!((mutable_bitField0_ & 0x00000040) != 0)) { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { relatedUrls_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; + mutable_bitField0_ |= 0x00000002; } relatedUrls_.add( input.readMessage( @@ -125,10 +131,10 @@ private Details( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000008) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); } - if (((mutable_bitField0_ & 0x00000040) != 0)) { + if (((mutable_bitField0_ & 0x00000002) != 0)) { relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); } this.unknownFields = unknownFields.build(); @@ -151,7 +157,6 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { io.grafeas.v1beta1.vulnerability.Details.Builder.class); } - private int bitField0_; public static final int TYPE_FIELD_NUMBER = 1; private volatile java.lang.Object type_; /** @@ -737,7 +742,7 @@ public Builder clear() { if (packageIssueBuilder_ == null) { packageIssue_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { packageIssueBuilder_.clear(); } @@ -747,7 +752,7 @@ public Builder clear() { if (relatedUrlsBuilder_ == null) { relatedUrls_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000002); } else { relatedUrlsBuilder_.clear(); } @@ -779,14 +784,13 @@ public io.grafeas.v1beta1.vulnerability.Details buildPartial() { io.grafeas.v1beta1.vulnerability.Details result = new io.grafeas.v1beta1.vulnerability.Details(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.type_ = type_; result.severity_ = severity_; result.cvssScore_ = cvssScore_; if (packageIssueBuilder_ == null) { - if (((bitField0_ & 0x00000008) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } result.packageIssue_ = packageIssue_; } else { @@ -795,15 +799,14 @@ public io.grafeas.v1beta1.vulnerability.Details buildPartial() { result.shortDescription_ = shortDescription_; result.longDescription_ = longDescription_; if (relatedUrlsBuilder_ == null) { - if (((bitField0_ & 0x00000040) != 0)) { + if (((bitField0_ & 0x00000002) != 0)) { relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000002); } result.relatedUrls_ = relatedUrls_; } else { result.relatedUrls_ = relatedUrlsBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -867,7 +870,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Details other) { if (!other.packageIssue_.isEmpty()) { if (packageIssue_.isEmpty()) { packageIssue_ = other.packageIssue_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensurePackageIssueIsMutable(); packageIssue_.addAll(other.packageIssue_); @@ -880,7 +883,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Details other) { packageIssueBuilder_.dispose(); packageIssueBuilder_ = null; packageIssue_ = other.packageIssue_; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); packageIssueBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getPackageIssueFieldBuilder() @@ -902,7 +905,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Details other) { if (!other.relatedUrls_.isEmpty()) { if (relatedUrls_.isEmpty()) { relatedUrls_ = other.relatedUrls_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000002); } else { ensureRelatedUrlsIsMutable(); relatedUrls_.addAll(other.relatedUrls_); @@ -915,7 +918,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Details other) { relatedUrlsBuilder_.dispose(); relatedUrlsBuilder_ = null; relatedUrls_ = other.relatedUrls_; - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000002); relatedUrlsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRelatedUrlsFieldBuilder() @@ -1185,10 +1188,10 @@ public Builder clearCvssScore() { java.util.Collections.emptyList(); private void ensurePackageIssueIsMutable() { - if (!((bitField0_ & 0x00000008) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { packageIssue_ = new java.util.ArrayList(packageIssue_); - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000001; } } @@ -1415,7 +1418,7 @@ public Builder addAllPackageIssue( public Builder clearPackageIssue() { if (packageIssueBuilder_ == null) { packageIssue_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { packageIssueBuilder_.clear(); @@ -1545,7 +1548,7 @@ public io.grafeas.v1beta1.vulnerability.PackageIssue.Builder addPackageIssueBuil io.grafeas.v1beta1.vulnerability.PackageIssue, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder, io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder>( - packageIssue_, ((bitField0_ & 0x00000008) != 0), getParentForChildren(), isClean()); + packageIssue_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); packageIssue_ = null; } return packageIssueBuilder_; @@ -1743,9 +1746,9 @@ public Builder setLongDescriptionBytes(com.google.protobuf.ByteString value) { java.util.Collections.emptyList(); private void ensureRelatedUrlsIsMutable() { - if (!((bitField0_ & 0x00000040) != 0)) { + if (!((bitField0_ & 0x00000002) != 0)) { relatedUrls_ = new java.util.ArrayList(relatedUrls_); - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000002; } } @@ -1960,7 +1963,7 @@ public Builder addAllRelatedUrls( public Builder clearRelatedUrls() { if (relatedUrlsBuilder_ == null) { relatedUrls_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { relatedUrlsBuilder_.clear(); @@ -2082,7 +2085,7 @@ public io.grafeas.v1beta1.common.RelatedUrl.Builder addRelatedUrlsBuilder(int in io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder>( - relatedUrls_, ((bitField0_ & 0x00000040) != 0), getParentForChildren(), isClean()); + relatedUrls_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); relatedUrls_ = null; } return relatedUrlsBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssue.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssue.java index b6ecf5152cbb..ef3dd8338c5c 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssue.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssue.java @@ -27,6 +27,12 @@ private PackageIssue() { severityName_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PackageIssue(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private PackageIssue( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Vulnerability.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Vulnerability.java index 4a2777528468..a90eebc08638 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Vulnerability.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Vulnerability.java @@ -27,6 +27,12 @@ private Vulnerability() { details_ = java.util.Collections.emptyList(); } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Vulnerability(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -65,11 +71,11 @@ private Vulnerability( } case 26: { - if (!((mutable_bitField0_ & 0x00000004) != 0)) { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { details_ = new java.util.ArrayList< io.grafeas.v1beta1.vulnerability.Vulnerability.Detail>(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000001; } details_.add( input.readMessage( @@ -91,7 +97,7 @@ private Vulnerability( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) != 0)) { + if (((mutable_bitField0_ & 0x00000001) != 0)) { details_ = java.util.Collections.unmodifiableList(details_); } this.unknownFields = unknownFields.build(); @@ -364,6 +370,12 @@ private Detail() { packageType_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Detail(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -377,7 +389,6 @@ private Detail( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -2492,7 +2503,6 @@ public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDefaultInstanceF } } - private int bitField0_; public static final int CVSS_SCORE_FIELD_NUMBER = 1; private float cvssScore_; /** @@ -2846,7 +2856,7 @@ public Builder clear() { if (detailsBuilder_ == null) { details_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { detailsBuilder_.clear(); } @@ -2878,19 +2888,17 @@ public io.grafeas.v1beta1.vulnerability.Vulnerability buildPartial() { io.grafeas.v1beta1.vulnerability.Vulnerability result = new io.grafeas.v1beta1.vulnerability.Vulnerability(this); int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; result.cvssScore_ = cvssScore_; result.severity_ = severity_; if (detailsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { + if (((bitField0_ & 0x00000001) != 0)) { details_ = java.util.Collections.unmodifiableList(details_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } result.details_ = details_; } else { result.details_ = detailsBuilder_.build(); } - result.bitField0_ = to_bitField0_; onBuilt(); return result; } @@ -2950,7 +2958,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Vulnerability other) { if (!other.details_.isEmpty()) { if (details_.isEmpty()) { details_ = other.details_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); } else { ensureDetailsIsMutable(); details_.addAll(other.details_); @@ -2963,7 +2971,7 @@ public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Vulnerability other) { detailsBuilder_.dispose(); detailsBuilder_ = null; details_ = other.details_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); detailsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetailsFieldBuilder() @@ -3128,11 +3136,11 @@ public Builder clearSeverity() { java.util.Collections.emptyList(); private void ensureDetailsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { + if (!((bitField0_ & 0x00000001) != 0)) { details_ = new java.util.ArrayList( details_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; } } @@ -3373,7 +3381,7 @@ public Builder addAllDetails( public Builder clearDetails() { if (detailsBuilder_ == null) { details_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); onChanged(); } else { detailsBuilder_.clear(); @@ -3513,7 +3521,7 @@ public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder addDetailsB io.grafeas.v1beta1.vulnerability.Vulnerability.Detail, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder, io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder>( - details_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean()); + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); details_ = null; } return detailsBuilder_; diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocation.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocation.java index 1253ee425c62..56d1412d6d5f 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocation.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocation.java @@ -27,6 +27,12 @@ private VulnerabilityLocation() { package_ = ""; } + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VulnerabilityLocation(); + } + @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; @@ -40,7 +46,6 @@ private VulnerabilityLocation( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } - int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOuterClass.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOuterClass.java index 730d31c51103..51c1905a6d23 100644 --- a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOuterClass.java +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOuterClass.java @@ -82,21 +82,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "analysis/v1beta1/vulnerability;vulnerabi" + "lity\242\002\003GRAb\006proto3" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = - new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( - descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { - io.grafeas.v1beta1.common.Common.getDescriptor(), - io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor(), - }, - assigner); + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + io.grafeas.v1beta1.common.Common.getDescriptor(), + io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor(), + }); internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor = getDescriptor().getMessageTypes().get(0); internal_static_grafeas_v1beta1_vulnerability_Vulnerability_fieldAccessorTable = diff --git a/google-cloud-clients/google-cloud-containeranalysis/pom.xml b/google-cloud-clients/google-cloud-containeranalysis/pom.xml index 0141917c4bcb..e588cca0fb2a 100644 --- a/google-cloud-clients/google-cloud-containeranalysis/pom.xml +++ b/google-cloud-clients/google-cloud-containeranalysis/pom.xml @@ -29,6 +29,10 @@ ${project.groupId} google-cloud-core-grpc + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1 + com.google.api.grpc proto-google-cloud-containeranalysis-v1beta1 @@ -52,6 +56,11 @@ junit test + + com.google.api.grpc + grpc-google-cloud-containeranalysis-v1 + test + com.google.api.grpc grpc-google-cloud-containeranalysis-v1beta1 @@ -80,11 +89,19 @@ ${project.javadoc.protobufBaseURL} - ../../../../../google-api-grpc/proto-google-cloud-container-v1/target/site/apidocs/ + ../../../../../google-api-grpc/proto-google-cloud-containeranalysis-v1/target/site/apidocs/ + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/grpc-google-cloud-containeranalysis-v1/target/site/apidocs/ + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/target/site/apidocs/ ${project.javadoc.protobufBaseURL} - ../../../../../google-api-grpc/grpc-google-cloud-container-v1/target/site/apidocs/ + ../../../../../google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/target/site/apidocs/ diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java new file mode 100644 index 000000000000..81d0a00328a9 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClient.java @@ -0,0 +1,567 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.devtools.containeranalysis.v1.stub.ContainerAnalysisStub; +import com.google.cloud.devtools.containeranalysis.v1.stub.ContainerAnalysisStubSettings; +import com.google.containeranalysis.v1.IamResourceName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Retrieves analysis results of Cloud components such as Docker container + * images. The Container Analysis API is an implementation of the [Grafeas](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: + * + *

+ * 
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+ *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+ *   Policy policy = Policy.newBuilder().build();
+ *   Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the containerAnalysisClient object to clean up resources + * such as threads. In the example above, try-with-resources is used, which automatically calls + * close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

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 ContainerAnalysisSettings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * ContainerAnalysisSettings containerAnalysisSettings =
+ *     ContainerAnalysisSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ContainerAnalysisClient containerAnalysisClient =
+ *     ContainerAnalysisClient.create(containerAnalysisSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ContainerAnalysisSettings containerAnalysisSettings =
+ *     ContainerAnalysisSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * ContainerAnalysisClient containerAnalysisClient =
+ *     ContainerAnalysisClient.create(containerAnalysisSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisClient implements BackgroundResource { + private final ContainerAnalysisSettings settings; + private final ContainerAnalysisStub stub; + + /** Constructs an instance of ContainerAnalysisClient with default settings. */ + public static final ContainerAnalysisClient create() throws IOException { + return create(ContainerAnalysisSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ContainerAnalysisClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ContainerAnalysisClient create(ContainerAnalysisSettings settings) + throws IOException { + return new ContainerAnalysisClient(settings); + } + + /** + * Constructs an instance of ContainerAnalysisClient, using the given stub for making calls. This + * is for advanced usage - prefer to use ContainerAnalysisSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ContainerAnalysisClient create(ContainerAnalysisStub stub) { + return new ContainerAnalysisClient(stub); + } + + /** + * Constructs an instance of ContainerAnalysisClient, 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. + */ + protected ContainerAnalysisClient(ContainerAnalysisSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ContainerAnalysisStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ContainerAnalysisClient(ContainerAnalysisStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ContainerAnalysisSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ContainerAnalysisStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(IamResourceName resource, Policy policy) { + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .setPolicy(policy) + .build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = containerAnalysisClient.setIamPolicy(resource.toString(), policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. See the + * operation documentation for the appropriate value for this field. + * @param 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. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(String resource, Policy policy) { + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build(); + return setIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = containerAnalysisClient.setIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = containerAnalysisClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy response = containerAnalysisClient.getIamPolicy(resource);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(IamResourceName resource) { + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   Policy response = containerAnalysisClient.getIamPolicy(resource.toString());
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. See the + * operation documentation for the appropriate value for this field. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + + GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build(); + return getIamPolicy(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   Policy response = containerAnalysisClient.getIamPolicy(request);
+   * }
+   * 
+ * + * @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 Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .build();
+   *   ApiFuture<Policy> future = containerAnalysisClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something
+   *   Policy response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + IamResourceName resource, List permissions) { + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource == null ? null : resource.toString()) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource.toString(), permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. See the + * operation documentation for the appropriate value for this field. + * @param permissions 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). + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions( + String resource, List permissions) { + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(resource) + .addAllPermissions(permissions) + .build(); + return testIamPermissions(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(request);
+   * }
+   * 
+ * + * @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 TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * 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: + * + *


+   * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+   *   ResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(resource.toString())
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = containerAnalysisClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisSettings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisSettings.java new file mode 100644 index 000000000000..8af10ba6d17c --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisSettings.java @@ -0,0 +1,202 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ContainerAnalysisClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (containeranalysis.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of setIamPolicy to 30 seconds: + * + *

+ * 
+ * ContainerAnalysisSettings.Builder containerAnalysisSettingsBuilder =
+ *     ContainerAnalysisSettings.newBuilder();
+ * containerAnalysisSettingsBuilder.setIamPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ContainerAnalysisSettings containerAnalysisSettings = containerAnalysisSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisSettings extends ClientSettings { + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ContainerAnalysisStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ContainerAnalysisStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ContainerAnalysisStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + public static final ContainerAnalysisSettings create(ContainerAnalysisStubSettings stub) + throws IOException { + return new ContainerAnalysisSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ContainerAnalysisStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ContainerAnalysisStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ContainerAnalysisStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ContainerAnalysisStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ContainerAnalysisStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ContainerAnalysisStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ContainerAnalysisStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ContainerAnalysisSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ContainerAnalysisSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ContainerAnalysisStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ContainerAnalysisStubSettings.newBuilder()); + } + + protected Builder(ContainerAnalysisSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ContainerAnalysisStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ContainerAnalysisStubSettings.Builder getStubSettingsBuilder() { + return ((ContainerAnalysisStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ContainerAnalysisSettings build() throws IOException { + return new ContainerAnalysisSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/package-info.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/package-info.java new file mode 100644 index 000000000000..d80cbc2bba3d --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/package-info.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Container Analysis API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================= ContainerAnalysisClient ======================= + * + *

Service Description: Retrieves analysis results of Cloud components such as Docker container + * images. The Container Analysis API is an implementation of the [Grafeas](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. + * + *

Sample for ContainerAnalysisClient: + * + *

+ * 
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
+ *   IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]");
+ *   Policy policy = Policy.newBuilder().build();
+ *   Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.devtools.containeranalysis.v1; diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStub.java new file mode 100644 index 000000000000..c2a6025d5402 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStub.java @@ -0,0 +1,53 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Container Analysis API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class ContainerAnalysisStub implements BackgroundResource { + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStubSettings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStubSettings.java new file mode 100644 index 000000000000..5aba99fb0244 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/ContainerAnalysisStubSettings.java @@ -0,0 +1,316 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link ContainerAnalysisStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (containeranalysis.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of setIamPolicy to 30 seconds: + * + *

+ * 
+ * ContainerAnalysisStubSettings.Builder containerAnalysisSettingsBuilder =
+ *     ContainerAnalysisStubSettings.newBuilder();
+ * containerAnalysisSettingsBuilder.setIamPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ContainerAnalysisStubSettings containerAnalysisSettings = containerAnalysisSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ContainerAnalysisStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcContainerAnalysisStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "containeranalysis.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ContainerAnalysisStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected ContainerAnalysisStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for ContainerAnalysisStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ContainerAnalysisStubSettings settings) { + super(settings); + + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + setIamPolicySettings, getIamPolicySettings, testIamPermissionsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ContainerAnalysisStubSettings build() throws IOException { + return new ContainerAnalysisStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisCallableFactory.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisCallableFactory.java new file mode 100644 index 000000000000..dc0209d10f67 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Container Analysis API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcContainerAnalysisCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisStub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisStub.java new file mode 100644 index 000000000000..aab940b9c9ca --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1/stub/GrpcContainerAnalysisStub.java @@ -0,0 +1,221 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Container Analysis API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcContainerAnalysisStub extends ContainerAnalysisStub { + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.containeranalysis.v1.ContainerAnalysis/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.devtools.containeranalysis.v1.ContainerAnalysis/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .build(); + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.containeranalysis.v1.ContainerAnalysis/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcContainerAnalysisStub create(ContainerAnalysisStubSettings settings) + throws IOException { + return new GrpcContainerAnalysisStub(settings, ClientContext.create(settings)); + } + + public static final GrpcContainerAnalysisStub create(ClientContext clientContext) + throws IOException { + return new GrpcContainerAnalysisStub( + ContainerAnalysisStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcContainerAnalysisStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcContainerAnalysisStub( + ContainerAnalysisStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcContainerAnalysisStub, 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. + */ + protected GrpcContainerAnalysisStub( + ContainerAnalysisStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcContainerAnalysisCallableFactory()); + } + + /** + * Constructs an instance of GrpcContainerAnalysisStub, 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. + */ + protected GrpcContainerAnalysisStub( + ContainerAnalysisStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(SetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetIamPolicyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(TestIamPermissionsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("resource", String.valueOf(request.getResource())); + return params.build(); + } + }) + .build(); + + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClientTest.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClientTest.java new file mode 100644 index 000000000000..ad946c0f77d5 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/ContainerAnalysisClientTest.java @@ -0,0 +1,209 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.containeranalysis.v1.IamResourceName; +import com.google.containeranalysis.v1.NoteName; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class ContainerAnalysisClientTest { + private static MockContainerAnalysis mockContainerAnalysis; + private static MockServiceHelper serviceHelper; + private ContainerAnalysisClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockContainerAnalysis = new MockContainerAnalysis(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockContainerAnalysis)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ContainerAnalysisSettings settings = + ContainerAnalysisSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ContainerAnalysisClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockContainerAnalysis.addResponse(expectedResponse); + + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(resource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(policy, actualRequest.getPolicy()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysis.addException(exception); + + try { + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(resource, policy); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyTest() { + int version = 351608024; + ByteString etag = ByteString.copyFromUtf8("21"); + Policy expectedResponse = Policy.newBuilder().setVersion(version).setEtag(etag).build(); + mockContainerAnalysis.addResponse(expectedResponse); + + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + + Policy actualResponse = client.getIamPolicy(resource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysis.addException(exception); + + try { + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + + client.getIamPolicy(resource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockContainerAnalysis.addResponse(expectedResponse); + + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(resource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysis.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(Objects.toString(resource), Objects.toString(actualRequest.getResource())); + Assert.assertEquals(permissions, actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysis.addException(exception); + + try { + IamResourceName resource = NoteName.of("[PROJECT]", "[NOTE]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(resource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysis.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysis.java new file mode 100644 index 000000000000..e348b9f0c0be --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysis.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockContainerAnalysis implements MockGrpcService { + private final MockContainerAnalysisImpl serviceImpl; + + public MockContainerAnalysis() { + serviceImpl = new MockContainerAnalysisImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysisImpl.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysisImpl.java new file mode 100644 index 000000000000..313962d591e7 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1/MockContainerAnalysisImpl.java @@ -0,0 +1,107 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.devtools.containeranalysis.v1; + +import com.google.api.core.BetaApi; +import com.google.containeranalysis.v1.ContainerAnalysisGrpc.ContainerAnalysisImplBase; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockContainerAnalysisImpl extends ContainerAnalysisImplBase { + private List requests; + private Queue responses; + + public MockContainerAnalysisImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext((Policy) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext((TestIamPermissionsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/synth.metadata b/google-cloud-clients/google-cloud-containeranalysis/synth.metadata index 3e12671be7d9..97da67e0e702 100644 --- a/google-cloud-clients/google-cloud-containeranalysis/synth.metadata +++ b/google-cloud-clients/google-cloud-containeranalysis/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-05-07T07:39:23.514320Z", + "updateTime": "2019-06-05T06:12:26.819451Z", "sources": [ { "generator": { "name": "artman", - "version": "0.19.0", - "dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e" + "version": "0.23.1", + "dockerImage": "googleapis/artman@sha256:9d5cae1454da64ac3a87028f8ef486b04889e351c83bb95e83b8fab3959faed0" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5aeb4179d0c424be6b1b228bce7ec75ec24f3d12", - "internalRef": "246901187" + "sha": "4f3516a6f96dac182973a3573ff5117e8e4f76c7", + "internalRef": "251559960" } } ], @@ -27,6 +27,16 @@ "generator": "gapic", "config": "google/devtools/containeranalysis/artman_containeranalysis_v1beta1.yaml" } + }, + { + "client": { + "source": "googleapis", + "apiName": "containeranalysis", + "apiVersion": "v1", + "language": "java", + "generator": "gapic", + "config": "google/devtools/containeranalysis/artman_containeranalysis_v1.yaml" + } } ] } \ No newline at end of file diff --git a/google-cloud-clients/google-cloud-containeranalysis/synth.py b/google-cloud-clients/google-cloud-containeranalysis/synth.py index c718465fe486..3ce1aa465851 100644 --- a/google-cloud-clients/google-cloud-containeranalysis/synth.py +++ b/google-cloud-clients/google-cloud-containeranalysis/synth.py @@ -21,7 +21,7 @@ gapic = gcp.GAPICGenerator() service = 'containeranalysis' -versions = ['v1beta1'] +versions = ['v1beta1', 'v1'] config_pattern = '/google/devtools/containeranalysis/artman_containeranalysis_{version}.yaml' for version in versions: diff --git a/versions.txt b/versions.txt index 3a3ed3a30c7f..31fb165b832e 100644 --- a/versions.txt +++ b/versions.txt @@ -76,6 +76,7 @@ grpc-google-cloud-bigquerystorage-v1beta1:0.59.0:0.59.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2:0.59.0:0.59.1-SNAPSHOT grpc-google-cloud-bigtable-v2:0.59.0:0.59.1-SNAPSHOT grpc-google-cloud-container-v1:0.59.0:0.59.1-SNAPSHOT +grpc-google-cloud-containeranalysis-v1:0.59.0:0.59.1-SNAPSHOT grpc-google-cloud-containeranalysis-v1beta1:0.59.0:0.59.1-SNAPSHOT grpc-google-cloud-datacatalog-v1beta1:0.7.0-alpha:0.7.1-alpha-SNAPSHOT grpc-google-cloud-datalabeling-v1beta1:0.59.0:0.59.1-SNAPSHOT @@ -141,6 +142,7 @@ proto-google-cloud-bigquerystorage-v1beta1:0.59.0:0.59.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2:0.59.0:0.59.1-SNAPSHOT proto-google-cloud-bigtable-v2:0.59.0:0.59.1-SNAPSHOT proto-google-cloud-container-v1:0.59.0:0.59.1-SNAPSHOT +proto-google-cloud-containeranalysis-v1:0.59.0:0.59.1-SNAPSHOT proto-google-cloud-containeranalysis-v1beta1:0.59.0:0.59.1-SNAPSHOT proto-google-cloud-datacatalog-v1beta1:0.7.0-alpha:0.7.1-alpha-SNAPSHOT proto-google-cloud-datalabeling-v1beta1:0.59.0:0.59.1-SNAPSHOT