diff --git a/.gitignore b/.gitignore index 19f0ce05fe3e..6f6fa035a9d4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ # Packages dist -build bin var sdist diff --git a/README.md b/README.md index bba10b9e3640..e1fa4c10a06d 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ This library supports the following Google Cloud Platform services with clients - [BigQuery Data Transfer](google-cloud-clients/google-cloud-bigquerydatatransfer) (Beta) - [Cloud AutoML](google-cloud-clients/google-cloud-automl) (Beta) +- [Cloud Container Analysis](google-cloud-clients/google-cloud-containeranalysis) (Beta) - [Cloud Data Loss Prevention](google-cloud-clients/google-cloud-dlp) (Beta) - [Cloud Firestore](google-cloud-clients/google-cloud-firestore) (Beta) - [Cloud IoT Core](google-cloud-clients/google-cloud-iot) (Beta) diff --git a/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/pom.xml new file mode 100644 index 000000000000..88def3db2ce9 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + grpc-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + grpc-google-cloud-containeranalysis-v1beta1 + GRPC library for grpc-google-cloud-containeranalysis-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.22.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1beta1 + compile + + + \ No newline at end of file diff --git a/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Grpc.java b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Grpc.java new file mode 100644 index 000000000000..e38df43f66d4 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Grpc.java @@ -0,0 +1,891 @@ +package com.google.containeranalysis.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +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/v1beta1/containeranalysis.proto") +public final class ContainerAnalysisV1Beta1Grpc { + + private ContainerAnalysisV1Beta1Grpc() {} + + public static final String SERVICE_NAME = "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1"; + + // 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 METHOD_SET_IAM_POLICY = getSetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getSetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getSetIamPolicyMethod() { + return getSetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor getSetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor getSetIamPolicyMethod; + if ((getSetIamPolicyMethod = ContainerAnalysisV1Beta1Grpc.getSetIamPolicyMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getSetIamPolicyMethod = ContainerAnalysisV1Beta1Grpc.getSetIamPolicyMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getSetIamPolicyMethod = getSetIamPolicyMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "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 ContainerAnalysisV1Beta1MethodDescriptorSupplier("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 METHOD_GET_IAM_POLICY = getGetIamPolicyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetIamPolicyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetIamPolicyMethod() { + return getGetIamPolicyMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetIamPolicyMethodHelper() { + io.grpc.MethodDescriptor getGetIamPolicyMethod; + if ((getGetIamPolicyMethod = ContainerAnalysisV1Beta1Grpc.getGetIamPolicyMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getGetIamPolicyMethod = ContainerAnalysisV1Beta1Grpc.getGetIamPolicyMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getGetIamPolicyMethod = getGetIamPolicyMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "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 ContainerAnalysisV1Beta1MethodDescriptorSupplier("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 METHOD_TEST_IAM_PERMISSIONS = getTestIamPermissionsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getTestIamPermissionsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getTestIamPermissionsMethod() { + return getTestIamPermissionsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getTestIamPermissionsMethodHelper() { + io.grpc.MethodDescriptor getTestIamPermissionsMethod; + if ((getTestIamPermissionsMethod = ContainerAnalysisV1Beta1Grpc.getTestIamPermissionsMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getTestIamPermissionsMethod = ContainerAnalysisV1Beta1Grpc.getTestIamPermissionsMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getTestIamPermissionsMethod = getTestIamPermissionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "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 ContainerAnalysisV1Beta1MethodDescriptorSupplier("TestIamPermissions")) + .build(); + } + } + } + return getTestIamPermissionsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetScanConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_SCAN_CONFIG = getGetScanConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetScanConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetScanConfigMethod() { + return getGetScanConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetScanConfigMethodHelper() { + io.grpc.MethodDescriptor getGetScanConfigMethod; + if ((getGetScanConfigMethod = ContainerAnalysisV1Beta1Grpc.getGetScanConfigMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getGetScanConfigMethod = ContainerAnalysisV1Beta1Grpc.getGetScanConfigMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getGetScanConfigMethod = getGetScanConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "GetScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.GetScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance())) + .setSchemaDescriptor(new ContainerAnalysisV1Beta1MethodDescriptorSupplier("GetScanConfig")) + .build(); + } + } + } + return getGetScanConfigMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListScanConfigsMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_SCAN_CONFIGS = getListScanConfigsMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListScanConfigsMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListScanConfigsMethod() { + return getListScanConfigsMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListScanConfigsMethodHelper() { + io.grpc.MethodDescriptor getListScanConfigsMethod; + if ((getListScanConfigsMethod = ContainerAnalysisV1Beta1Grpc.getListScanConfigsMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getListScanConfigsMethod = ContainerAnalysisV1Beta1Grpc.getListScanConfigsMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getListScanConfigsMethod = getListScanConfigsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "ListScanConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.ListScanConfigsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.ListScanConfigsResponse.getDefaultInstance())) + .setSchemaDescriptor(new ContainerAnalysisV1Beta1MethodDescriptorSupplier("ListScanConfigs")) + .build(); + } + } + } + return getListScanConfigsMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateScanConfigMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_SCAN_CONFIG = getUpdateScanConfigMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateScanConfigMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateScanConfigMethod() { + return getUpdateScanConfigMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateScanConfigMethodHelper() { + io.grpc.MethodDescriptor getUpdateScanConfigMethod; + if ((getUpdateScanConfigMethod = ContainerAnalysisV1Beta1Grpc.getUpdateScanConfigMethod) == null) { + synchronized (ContainerAnalysisV1Beta1Grpc.class) { + if ((getUpdateScanConfigMethod = ContainerAnalysisV1Beta1Grpc.getUpdateScanConfigMethod) == null) { + ContainerAnalysisV1Beta1Grpc.getUpdateScanConfigMethod = getUpdateScanConfigMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1", "UpdateScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance())) + .setSchemaDescriptor(new ContainerAnalysisV1Beta1MethodDescriptorSupplier("UpdateScanConfig")) + .build(); + } + } + } + return getUpdateScanConfigMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static ContainerAnalysisV1Beta1Stub newStub(io.grpc.Channel channel) { + return new ContainerAnalysisV1Beta1Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static ContainerAnalysisV1Beta1BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new ContainerAnalysisV1Beta1BlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static ContainerAnalysisV1Beta1FutureStub newFutureStub( + io.grpc.Channel channel) { + return new ContainerAnalysisV1Beta1FutureStub(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 static abstract class ContainerAnalysisV1Beta1ImplBase 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); + } + + /** + *
+     * Gets the specified scan configuration.
+     * 
+ */ + public void getScanConfig(com.google.containeranalysis.v1beta1.GetScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetScanConfigMethodHelper(), responseObserver); + } + + /** + *
+     * Lists scan configurations for the specified project.
+     * 
+ */ + public void listScanConfigs(com.google.containeranalysis.v1beta1.ListScanConfigsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListScanConfigsMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the specified scan configuration.
+     * 
+ */ + public void updateScanConfig(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateScanConfigMethodHelper(), 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))) + .addMethod( + getGetScanConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.containeranalysis.v1beta1.GetScanConfigRequest, + com.google.containeranalysis.v1beta1.ScanConfig>( + this, METHODID_GET_SCAN_CONFIG))) + .addMethod( + getListScanConfigsMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.containeranalysis.v1beta1.ListScanConfigsRequest, + com.google.containeranalysis.v1beta1.ListScanConfigsResponse>( + this, METHODID_LIST_SCAN_CONFIGS))) + .addMethod( + getUpdateScanConfigMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest, + com.google.containeranalysis.v1beta1.ScanConfig>( + this, METHODID_UPDATE_SCAN_CONFIG))) + .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 ContainerAnalysisV1Beta1Stub extends io.grpc.stub.AbstractStub { + private ContainerAnalysisV1Beta1Stub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisV1Beta1Stub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisV1Beta1Stub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ContainerAnalysisV1Beta1Stub(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); + } + + /** + *
+     * Gets the specified scan configuration.
+     * 
+ */ + public void getScanConfig(com.google.containeranalysis.v1beta1.GetScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetScanConfigMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists scan configurations for the specified project.
+     * 
+ */ + public void listScanConfigs(com.google.containeranalysis.v1beta1.ListScanConfigsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListScanConfigsMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates the specified scan configuration.
+     * 
+ */ + public void updateScanConfig(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateScanConfigMethodHelper(), 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 ContainerAnalysisV1Beta1BlockingStub extends io.grpc.stub.AbstractStub { + private ContainerAnalysisV1Beta1BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisV1Beta1BlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisV1Beta1BlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ContainerAnalysisV1Beta1BlockingStub(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); + } + + /** + *
+     * Gets the specified scan configuration.
+     * 
+ */ + public com.google.containeranalysis.v1beta1.ScanConfig getScanConfig(com.google.containeranalysis.v1beta1.GetScanConfigRequest request) { + return blockingUnaryCall( + getChannel(), getGetScanConfigMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists scan configurations for the specified project.
+     * 
+ */ + public com.google.containeranalysis.v1beta1.ListScanConfigsResponse listScanConfigs(com.google.containeranalysis.v1beta1.ListScanConfigsRequest request) { + return blockingUnaryCall( + getChannel(), getListScanConfigsMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the specified scan configuration.
+     * 
+ */ + public com.google.containeranalysis.v1beta1.ScanConfig updateScanConfig(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateScanConfigMethodHelper(), 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 ContainerAnalysisV1Beta1FutureStub extends io.grpc.stub.AbstractStub { + private ContainerAnalysisV1Beta1FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private ContainerAnalysisV1Beta1FutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ContainerAnalysisV1Beta1FutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new ContainerAnalysisV1Beta1FutureStub(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 testIamPermissions( + com.google.iam.v1.TestIamPermissionsRequest request) { + return futureUnaryCall( + getChannel().newCall(getTestIamPermissionsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets the specified scan configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getScanConfig( + com.google.containeranalysis.v1beta1.GetScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetScanConfigMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists scan configurations for the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listScanConfigs( + com.google.containeranalysis.v1beta1.ListScanConfigsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListScanConfigsMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the specified scan configuration.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateScanConfig( + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateScanConfigMethodHelper(), 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 int METHODID_GET_SCAN_CONFIG = 3; + private static final int METHODID_LIST_SCAN_CONFIGS = 4; + private static final int METHODID_UPDATE_SCAN_CONFIG = 5; + + 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 ContainerAnalysisV1Beta1ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(ContainerAnalysisV1Beta1ImplBase 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; + case METHODID_GET_SCAN_CONFIG: + serviceImpl.getScanConfig((com.google.containeranalysis.v1beta1.GetScanConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_SCAN_CONFIGS: + serviceImpl.listScanConfigs((com.google.containeranalysis.v1beta1.ListScanConfigsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_SCAN_CONFIG: + serviceImpl.updateScanConfig((com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) 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 static abstract class ContainerAnalysisV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + ContainerAnalysisV1Beta1BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("ContainerAnalysisV1Beta1"); + } + } + + private static final class ContainerAnalysisV1Beta1FileDescriptorSupplier + extends ContainerAnalysisV1Beta1BaseDescriptorSupplier { + ContainerAnalysisV1Beta1FileDescriptorSupplier() {} + } + + private static final class ContainerAnalysisV1Beta1MethodDescriptorSupplier + extends ContainerAnalysisV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + ContainerAnalysisV1Beta1MethodDescriptorSupplier(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 (ContainerAnalysisV1Beta1Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new ContainerAnalysisV1Beta1FileDescriptorSupplier()) + .addMethod(getSetIamPolicyMethodHelper()) + .addMethod(getGetIamPolicyMethodHelper()) + .addMethod(getTestIamPermissionsMethodHelper()) + .addMethod(getGetScanConfigMethodHelper()) + .addMethod(getListScanConfigsMethodHelper()) + .addMethod(getUpdateScanConfigMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GrafeasV1Beta1Grpc.java b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GrafeasV1Beta1Grpc.java new file mode 100644 index 000000000000..659ad73276bf --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GrafeasV1Beta1Grpc.java @@ -0,0 +1,1671 @@ +package io.grafeas.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * [Grafeas](grafeas.io) API.
+ * Retrieves analysis results of Cloud components such as Docker container
+ * images.
+ * 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/v1beta1/grafeas/grafeas.proto") +public final class GrafeasV1Beta1Grpc { + + private GrafeasV1Beta1Grpc() {} + + public static final String SERVICE_NAME = "grafeas.v1beta1.GrafeasV1Beta1"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetOccurrenceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_OCCURRENCE = getGetOccurrenceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetOccurrenceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetOccurrenceMethod() { + return getGetOccurrenceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetOccurrenceMethodHelper() { + io.grpc.MethodDescriptor getGetOccurrenceMethod; + if ((getGetOccurrenceMethod = GrafeasV1Beta1Grpc.getGetOccurrenceMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getGetOccurrenceMethod = GrafeasV1Beta1Grpc.getGetOccurrenceMethod) == null) { + GrafeasV1Beta1Grpc.getGetOccurrenceMethod = getGetOccurrenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "GetOccurrence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.GetOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Occurrence.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("GetOccurrence")) + .build(); + } + } + } + return getGetOccurrenceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListOccurrencesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_OCCURRENCES = getListOccurrencesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListOccurrencesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListOccurrencesMethod() { + return getListOccurrencesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListOccurrencesMethodHelper() { + io.grpc.MethodDescriptor getListOccurrencesMethod; + if ((getListOccurrencesMethod = GrafeasV1Beta1Grpc.getListOccurrencesMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getListOccurrencesMethod = GrafeasV1Beta1Grpc.getListOccurrencesMethod) == null) { + GrafeasV1Beta1Grpc.getListOccurrencesMethod = getListOccurrencesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "ListOccurrences")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListOccurrencesResponse.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("ListOccurrences")) + .build(); + } + } + } + return getListOccurrencesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteOccurrenceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_OCCURRENCE = getDeleteOccurrenceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteOccurrenceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteOccurrenceMethod() { + return getDeleteOccurrenceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteOccurrenceMethodHelper() { + io.grpc.MethodDescriptor getDeleteOccurrenceMethod; + if ((getDeleteOccurrenceMethod = GrafeasV1Beta1Grpc.getDeleteOccurrenceMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getDeleteOccurrenceMethod = GrafeasV1Beta1Grpc.getDeleteOccurrenceMethod) == null) { + GrafeasV1Beta1Grpc.getDeleteOccurrenceMethod = getDeleteOccurrenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "DeleteOccurrence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.DeleteOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("DeleteOccurrence")) + .build(); + } + } + } + return getDeleteOccurrenceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateOccurrenceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_OCCURRENCE = getCreateOccurrenceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateOccurrenceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateOccurrenceMethod() { + return getCreateOccurrenceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateOccurrenceMethodHelper() { + io.grpc.MethodDescriptor getCreateOccurrenceMethod; + if ((getCreateOccurrenceMethod = GrafeasV1Beta1Grpc.getCreateOccurrenceMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getCreateOccurrenceMethod = GrafeasV1Beta1Grpc.getCreateOccurrenceMethod) == null) { + GrafeasV1Beta1Grpc.getCreateOccurrenceMethod = getCreateOccurrenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "CreateOccurrence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.CreateOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Occurrence.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("CreateOccurrence")) + .build(); + } + } + } + return getCreateOccurrenceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBatchCreateOccurrencesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_BATCH_CREATE_OCCURRENCES = getBatchCreateOccurrencesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getBatchCreateOccurrencesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getBatchCreateOccurrencesMethod() { + return getBatchCreateOccurrencesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getBatchCreateOccurrencesMethodHelper() { + io.grpc.MethodDescriptor getBatchCreateOccurrencesMethod; + if ((getBatchCreateOccurrencesMethod = GrafeasV1Beta1Grpc.getBatchCreateOccurrencesMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getBatchCreateOccurrencesMethod = GrafeasV1Beta1Grpc.getBatchCreateOccurrencesMethod) == null) { + GrafeasV1Beta1Grpc.getBatchCreateOccurrencesMethod = getBatchCreateOccurrencesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "BatchCreateOccurrences")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.BatchCreateOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.BatchCreateOccurrencesResponse.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("BatchCreateOccurrences")) + .build(); + } + } + } + return getBatchCreateOccurrencesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateOccurrenceMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_OCCURRENCE = getUpdateOccurrenceMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateOccurrenceMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateOccurrenceMethod() { + return getUpdateOccurrenceMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateOccurrenceMethodHelper() { + io.grpc.MethodDescriptor getUpdateOccurrenceMethod; + if ((getUpdateOccurrenceMethod = GrafeasV1Beta1Grpc.getUpdateOccurrenceMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getUpdateOccurrenceMethod = GrafeasV1Beta1Grpc.getUpdateOccurrenceMethod) == null) { + GrafeasV1Beta1Grpc.getUpdateOccurrenceMethod = getUpdateOccurrenceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "UpdateOccurrence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Occurrence.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("UpdateOccurrence")) + .build(); + } + } + } + return getUpdateOccurrenceMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetOccurrenceNoteMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_OCCURRENCE_NOTE = getGetOccurrenceNoteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetOccurrenceNoteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetOccurrenceNoteMethod() { + return getGetOccurrenceNoteMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetOccurrenceNoteMethodHelper() { + io.grpc.MethodDescriptor getGetOccurrenceNoteMethod; + if ((getGetOccurrenceNoteMethod = GrafeasV1Beta1Grpc.getGetOccurrenceNoteMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getGetOccurrenceNoteMethod = GrafeasV1Beta1Grpc.getGetOccurrenceNoteMethod) == null) { + GrafeasV1Beta1Grpc.getGetOccurrenceNoteMethod = getGetOccurrenceNoteMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "GetOccurrenceNote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.GetOccurrenceNoteRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Note.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("GetOccurrenceNote")) + .build(); + } + } + } + return getGetOccurrenceNoteMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetNoteMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_NOTE = getGetNoteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetNoteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetNoteMethod() { + return getGetNoteMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetNoteMethodHelper() { + io.grpc.MethodDescriptor getGetNoteMethod; + if ((getGetNoteMethod = GrafeasV1Beta1Grpc.getGetNoteMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getGetNoteMethod = GrafeasV1Beta1Grpc.getGetNoteMethod) == null) { + GrafeasV1Beta1Grpc.getGetNoteMethod = getGetNoteMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "GetNote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Note.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("GetNote")) + .build(); + } + } + } + return getGetNoteMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListNotesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_NOTES = getListNotesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListNotesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListNotesMethod() { + return getListNotesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListNotesMethodHelper() { + io.grpc.MethodDescriptor getListNotesMethod; + if ((getListNotesMethod = GrafeasV1Beta1Grpc.getListNotesMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getListNotesMethod = GrafeasV1Beta1Grpc.getListNotesMethod) == null) { + GrafeasV1Beta1Grpc.getListNotesMethod = getListNotesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "ListNotes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListNotesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListNotesResponse.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("ListNotes")) + .build(); + } + } + } + return getListNotesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteNoteMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_NOTE = getDeleteNoteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteNoteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteNoteMethod() { + return getDeleteNoteMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteNoteMethodHelper() { + io.grpc.MethodDescriptor getDeleteNoteMethod; + if ((getDeleteNoteMethod = GrafeasV1Beta1Grpc.getDeleteNoteMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getDeleteNoteMethod = GrafeasV1Beta1Grpc.getDeleteNoteMethod) == null) { + GrafeasV1Beta1Grpc.getDeleteNoteMethod = getDeleteNoteMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "DeleteNote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("DeleteNote")) + .build(); + } + } + } + return getDeleteNoteMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateNoteMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_NOTE = getCreateNoteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateNoteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateNoteMethod() { + return getCreateNoteMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateNoteMethodHelper() { + io.grpc.MethodDescriptor getCreateNoteMethod; + if ((getCreateNoteMethod = GrafeasV1Beta1Grpc.getCreateNoteMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getCreateNoteMethod = GrafeasV1Beta1Grpc.getCreateNoteMethod) == null) { + GrafeasV1Beta1Grpc.getCreateNoteMethod = getCreateNoteMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "CreateNote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.CreateNoteRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Note.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("CreateNote")) + .build(); + } + } + } + return getCreateNoteMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getBatchCreateNotesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_BATCH_CREATE_NOTES = getBatchCreateNotesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getBatchCreateNotesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getBatchCreateNotesMethod() { + return getBatchCreateNotesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getBatchCreateNotesMethodHelper() { + io.grpc.MethodDescriptor getBatchCreateNotesMethod; + if ((getBatchCreateNotesMethod = GrafeasV1Beta1Grpc.getBatchCreateNotesMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getBatchCreateNotesMethod = GrafeasV1Beta1Grpc.getBatchCreateNotesMethod) == null) { + GrafeasV1Beta1Grpc.getBatchCreateNotesMethod = getBatchCreateNotesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "BatchCreateNotes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.BatchCreateNotesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.BatchCreateNotesResponse.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("BatchCreateNotes")) + .build(); + } + } + } + return getBatchCreateNotesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateNoteMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_NOTE = getUpdateNoteMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateNoteMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateNoteMethod() { + return getUpdateNoteMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateNoteMethodHelper() { + io.grpc.MethodDescriptor getUpdateNoteMethod; + if ((getUpdateNoteMethod = GrafeasV1Beta1Grpc.getUpdateNoteMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getUpdateNoteMethod = GrafeasV1Beta1Grpc.getUpdateNoteMethod) == null) { + GrafeasV1Beta1Grpc.getUpdateNoteMethod = getUpdateNoteMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "UpdateNote")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.Note.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("UpdateNote")) + .build(); + } + } + } + return getUpdateNoteMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListNoteOccurrencesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_NOTE_OCCURRENCES = getListNoteOccurrencesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListNoteOccurrencesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListNoteOccurrencesMethod() { + return getListNoteOccurrencesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListNoteOccurrencesMethodHelper() { + io.grpc.MethodDescriptor getListNoteOccurrencesMethod; + if ((getListNoteOccurrencesMethod = GrafeasV1Beta1Grpc.getListNoteOccurrencesMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getListNoteOccurrencesMethod = GrafeasV1Beta1Grpc.getListNoteOccurrencesMethod) == null) { + GrafeasV1Beta1Grpc.getListNoteOccurrencesMethod = getListNoteOccurrencesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "ListNoteOccurrences")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListNoteOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.ListNoteOccurrencesResponse.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("ListNoteOccurrences")) + .build(); + } + } + } + return getListNoteOccurrencesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetVulnerabilityOccurrencesSummaryMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_VULNERABILITY_OCCURRENCES_SUMMARY = getGetVulnerabilityOccurrencesSummaryMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetVulnerabilityOccurrencesSummaryMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetVulnerabilityOccurrencesSummaryMethod() { + return getGetVulnerabilityOccurrencesSummaryMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetVulnerabilityOccurrencesSummaryMethodHelper() { + io.grpc.MethodDescriptor getGetVulnerabilityOccurrencesSummaryMethod; + if ((getGetVulnerabilityOccurrencesSummaryMethod = GrafeasV1Beta1Grpc.getGetVulnerabilityOccurrencesSummaryMethod) == null) { + synchronized (GrafeasV1Beta1Grpc.class) { + if ((getGetVulnerabilityOccurrencesSummaryMethod = GrafeasV1Beta1Grpc.getGetVulnerabilityOccurrencesSummaryMethod) == null) { + GrafeasV1Beta1Grpc.getGetVulnerabilityOccurrencesSummaryMethod = getGetVulnerabilityOccurrencesSummaryMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1", "GetVulnerabilityOccurrencesSummary")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.getDefaultInstance())) + .setSchemaDescriptor(new GrafeasV1Beta1MethodDescriptorSupplier("GetVulnerabilityOccurrencesSummary")) + .build(); + } + } + } + return getGetVulnerabilityOccurrencesSummaryMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static GrafeasV1Beta1Stub newStub(io.grpc.Channel channel) { + return new GrafeasV1Beta1Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static GrafeasV1Beta1BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new GrafeasV1Beta1BlockingStub(channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static GrafeasV1Beta1FutureStub newFutureStub( + io.grpc.Channel channel) { + return new GrafeasV1Beta1FutureStub(channel); + } + + /** + *
+   * [Grafeas](grafeas.io) API.
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images.
+   * 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 abstract class GrafeasV1Beta1ImplBase implements io.grpc.BindableService { + + /** + *
+     * Gets the specified occurrence.
+     * 
+ */ + public void getOccurrence(io.grafeas.v1beta1.GetOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetOccurrenceMethodHelper(), responseObserver); + } + + /** + *
+     * Lists occurrences for the specified project.
+     * 
+ */ + public void listOccurrences(io.grafeas.v1beta1.ListOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListOccurrencesMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes the specified occurrence. For example, use this method to delete an
+     * occurrence when the occurrence is no longer applicable for the given
+     * resource.
+     * 
+ */ + public void deleteOccurrence(io.grafeas.v1beta1.DeleteOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteOccurrenceMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a new occurrence.
+     * 
+ */ + public void createOccurrence(io.grafeas.v1beta1.CreateOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateOccurrenceMethodHelper(), responseObserver); + } + + /** + *
+     * Creates new occurrences in batch.
+     * 
+ */ + public void batchCreateOccurrences(io.grafeas.v1beta1.BatchCreateOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBatchCreateOccurrencesMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the specified occurrence.
+     * 
+ */ + public void updateOccurrence(io.grafeas.v1beta1.UpdateOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateOccurrenceMethodHelper(), responseObserver); + } + + /** + *
+     * Gets the note attached to the specified occurrence. Consumer projects can
+     * use this method to get a note that belongs to a provider project.
+     * 
+ */ + public void getOccurrenceNote(io.grafeas.v1beta1.GetOccurrenceNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetOccurrenceNoteMethodHelper(), responseObserver); + } + + /** + *
+     * Gets the specified note.
+     * 
+ */ + public void getNote(io.grafeas.v1beta1.GetNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetNoteMethodHelper(), responseObserver); + } + + /** + *
+     * Lists notes for the specified project.
+     * 
+ */ + public void listNotes(io.grafeas.v1beta1.ListNotesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListNotesMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes the specified note.
+     * 
+ */ + public void deleteNote(io.grafeas.v1beta1.DeleteNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteNoteMethodHelper(), responseObserver); + } + + /** + *
+     * Creates a new note.
+     * 
+ */ + public void createNote(io.grafeas.v1beta1.CreateNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateNoteMethodHelper(), responseObserver); + } + + /** + *
+     * Creates new notes in batch.
+     * 
+ */ + public void batchCreateNotes(io.grafeas.v1beta1.BatchCreateNotesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getBatchCreateNotesMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the specified note.
+     * 
+ */ + public void updateNote(io.grafeas.v1beta1.UpdateNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateNoteMethodHelper(), responseObserver); + } + + /** + *
+     * Lists occurrences referencing the specified note. Provider projects can use
+     * this method to get all occurrences across consumer projects referencing the
+     * specified note.
+     * 
+ */ + public void listNoteOccurrences(io.grafeas.v1beta1.ListNoteOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListNoteOccurrencesMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a summary of the number and severity of occurrences.
+     * 
+ */ + public void getVulnerabilityOccurrencesSummary(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetVulnerabilityOccurrencesSummaryMethodHelper(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetOccurrenceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.GetOccurrenceRequest, + io.grafeas.v1beta1.Occurrence>( + this, METHODID_GET_OCCURRENCE))) + .addMethod( + getListOccurrencesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.ListOccurrencesRequest, + io.grafeas.v1beta1.ListOccurrencesResponse>( + this, METHODID_LIST_OCCURRENCES))) + .addMethod( + getDeleteOccurrenceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.DeleteOccurrenceRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_OCCURRENCE))) + .addMethod( + getCreateOccurrenceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.CreateOccurrenceRequest, + io.grafeas.v1beta1.Occurrence>( + this, METHODID_CREATE_OCCURRENCE))) + .addMethod( + getBatchCreateOccurrencesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.BatchCreateOccurrencesRequest, + io.grafeas.v1beta1.BatchCreateOccurrencesResponse>( + this, METHODID_BATCH_CREATE_OCCURRENCES))) + .addMethod( + getUpdateOccurrenceMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.UpdateOccurrenceRequest, + io.grafeas.v1beta1.Occurrence>( + this, METHODID_UPDATE_OCCURRENCE))) + .addMethod( + getGetOccurrenceNoteMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.GetOccurrenceNoteRequest, + io.grafeas.v1beta1.Note>( + this, METHODID_GET_OCCURRENCE_NOTE))) + .addMethod( + getGetNoteMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.GetNoteRequest, + io.grafeas.v1beta1.Note>( + this, METHODID_GET_NOTE))) + .addMethod( + getListNotesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.ListNotesRequest, + io.grafeas.v1beta1.ListNotesResponse>( + this, METHODID_LIST_NOTES))) + .addMethod( + getDeleteNoteMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.DeleteNoteRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_NOTE))) + .addMethod( + getCreateNoteMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.CreateNoteRequest, + io.grafeas.v1beta1.Note>( + this, METHODID_CREATE_NOTE))) + .addMethod( + getBatchCreateNotesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.BatchCreateNotesRequest, + io.grafeas.v1beta1.BatchCreateNotesResponse>( + this, METHODID_BATCH_CREATE_NOTES))) + .addMethod( + getUpdateNoteMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.UpdateNoteRequest, + io.grafeas.v1beta1.Note>( + this, METHODID_UPDATE_NOTE))) + .addMethod( + getListNoteOccurrencesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.ListNoteOccurrencesRequest, + io.grafeas.v1beta1.ListNoteOccurrencesResponse>( + this, METHODID_LIST_NOTE_OCCURRENCES))) + .addMethod( + getGetVulnerabilityOccurrencesSummaryMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest, + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary>( + this, METHODID_GET_VULNERABILITY_OCCURRENCES_SUMMARY))) + .build(); + } + } + + /** + *
+   * [Grafeas](grafeas.io) API.
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images.
+   * 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 GrafeasV1Beta1Stub extends io.grpc.stub.AbstractStub { + private GrafeasV1Beta1Stub(io.grpc.Channel channel) { + super(channel); + } + + private GrafeasV1Beta1Stub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GrafeasV1Beta1Stub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new GrafeasV1Beta1Stub(channel, callOptions); + } + + /** + *
+     * Gets the specified occurrence.
+     * 
+ */ + public void getOccurrence(io.grafeas.v1beta1.GetOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetOccurrenceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists occurrences for the specified project.
+     * 
+ */ + public void listOccurrences(io.grafeas.v1beta1.ListOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListOccurrencesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes the specified occurrence. For example, use this method to delete an
+     * occurrence when the occurrence is no longer applicable for the given
+     * resource.
+     * 
+ */ + public void deleteOccurrence(io.grafeas.v1beta1.DeleteOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteOccurrenceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a new occurrence.
+     * 
+ */ + public void createOccurrence(io.grafeas.v1beta1.CreateOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateOccurrenceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates new occurrences in batch.
+     * 
+ */ + public void batchCreateOccurrences(io.grafeas.v1beta1.BatchCreateOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchCreateOccurrencesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates the specified occurrence.
+     * 
+ */ + public void updateOccurrence(io.grafeas.v1beta1.UpdateOccurrenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateOccurrenceMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the note attached to the specified occurrence. Consumer projects can
+     * use this method to get a note that belongs to a provider project.
+     * 
+ */ + public void getOccurrenceNote(io.grafeas.v1beta1.GetOccurrenceNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetOccurrenceNoteMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the specified note.
+     * 
+ */ + public void getNote(io.grafeas.v1beta1.GetNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetNoteMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists notes for the specified project.
+     * 
+ */ + public void listNotes(io.grafeas.v1beta1.ListNotesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListNotesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes the specified note.
+     * 
+ */ + public void deleteNote(io.grafeas.v1beta1.DeleteNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteNoteMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates a new note.
+     * 
+ */ + public void createNote(io.grafeas.v1beta1.CreateNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateNoteMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Creates new notes in batch.
+     * 
+ */ + public void batchCreateNotes(io.grafeas.v1beta1.BatchCreateNotesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getBatchCreateNotesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates the specified note.
+     * 
+ */ + public void updateNote(io.grafeas.v1beta1.UpdateNoteRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateNoteMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists occurrences referencing the specified note. Provider projects can use
+     * this method to get all occurrences across consumer projects referencing the
+     * specified note.
+     * 
+ */ + public void listNoteOccurrences(io.grafeas.v1beta1.ListNoteOccurrencesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListNoteOccurrencesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a summary of the number and severity of occurrences.
+     * 
+ */ + public void getVulnerabilityOccurrencesSummary(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetVulnerabilityOccurrencesSummaryMethodHelper(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * [Grafeas](grafeas.io) API.
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images.
+   * 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 GrafeasV1Beta1BlockingStub extends io.grpc.stub.AbstractStub { + private GrafeasV1Beta1BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private GrafeasV1Beta1BlockingStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GrafeasV1Beta1BlockingStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new GrafeasV1Beta1BlockingStub(channel, callOptions); + } + + /** + *
+     * Gets the specified occurrence.
+     * 
+ */ + public io.grafeas.v1beta1.Occurrence getOccurrence(io.grafeas.v1beta1.GetOccurrenceRequest request) { + return blockingUnaryCall( + getChannel(), getGetOccurrenceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists occurrences for the specified project.
+     * 
+ */ + public io.grafeas.v1beta1.ListOccurrencesResponse listOccurrences(io.grafeas.v1beta1.ListOccurrencesRequest request) { + return blockingUnaryCall( + getChannel(), getListOccurrencesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes the specified occurrence. For example, use this method to delete an
+     * occurrence when the occurrence is no longer applicable for the given
+     * resource.
+     * 
+ */ + public com.google.protobuf.Empty deleteOccurrence(io.grafeas.v1beta1.DeleteOccurrenceRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteOccurrenceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a new occurrence.
+     * 
+ */ + public io.grafeas.v1beta1.Occurrence createOccurrence(io.grafeas.v1beta1.CreateOccurrenceRequest request) { + return blockingUnaryCall( + getChannel(), getCreateOccurrenceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates new occurrences in batch.
+     * 
+ */ + public io.grafeas.v1beta1.BatchCreateOccurrencesResponse batchCreateOccurrences(io.grafeas.v1beta1.BatchCreateOccurrencesRequest request) { + return blockingUnaryCall( + getChannel(), getBatchCreateOccurrencesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the specified occurrence.
+     * 
+ */ + public io.grafeas.v1beta1.Occurrence updateOccurrence(io.grafeas.v1beta1.UpdateOccurrenceRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateOccurrenceMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets the note attached to the specified occurrence. Consumer projects can
+     * use this method to get a note that belongs to a provider project.
+     * 
+ */ + public io.grafeas.v1beta1.Note getOccurrenceNote(io.grafeas.v1beta1.GetOccurrenceNoteRequest request) { + return blockingUnaryCall( + getChannel(), getGetOccurrenceNoteMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets the specified note.
+     * 
+ */ + public io.grafeas.v1beta1.Note getNote(io.grafeas.v1beta1.GetNoteRequest request) { + return blockingUnaryCall( + getChannel(), getGetNoteMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists notes for the specified project.
+     * 
+ */ + public io.grafeas.v1beta1.ListNotesResponse listNotes(io.grafeas.v1beta1.ListNotesRequest request) { + return blockingUnaryCall( + getChannel(), getListNotesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes the specified note.
+     * 
+ */ + public com.google.protobuf.Empty deleteNote(io.grafeas.v1beta1.DeleteNoteRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteNoteMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates a new note.
+     * 
+ */ + public io.grafeas.v1beta1.Note createNote(io.grafeas.v1beta1.CreateNoteRequest request) { + return blockingUnaryCall( + getChannel(), getCreateNoteMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Creates new notes in batch.
+     * 
+ */ + public io.grafeas.v1beta1.BatchCreateNotesResponse batchCreateNotes(io.grafeas.v1beta1.BatchCreateNotesRequest request) { + return blockingUnaryCall( + getChannel(), getBatchCreateNotesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the specified note.
+     * 
+ */ + public io.grafeas.v1beta1.Note updateNote(io.grafeas.v1beta1.UpdateNoteRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateNoteMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists occurrences referencing the specified note. Provider projects can use
+     * this method to get all occurrences across consumer projects referencing the
+     * specified note.
+     * 
+ */ + public io.grafeas.v1beta1.ListNoteOccurrencesResponse listNoteOccurrences(io.grafeas.v1beta1.ListNoteOccurrencesRequest request) { + return blockingUnaryCall( + getChannel(), getListNoteOccurrencesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a summary of the number and severity of occurrences.
+     * 
+ */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request) { + return blockingUnaryCall( + getChannel(), getGetVulnerabilityOccurrencesSummaryMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+   * [Grafeas](grafeas.io) API.
+   * Retrieves analysis results of Cloud components such as Docker container
+   * images.
+   * 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 GrafeasV1Beta1FutureStub extends io.grpc.stub.AbstractStub { + private GrafeasV1Beta1FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private GrafeasV1Beta1FutureStub(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected GrafeasV1Beta1FutureStub build(io.grpc.Channel channel, + io.grpc.CallOptions callOptions) { + return new GrafeasV1Beta1FutureStub(channel, callOptions); + } + + /** + *
+     * Gets the specified occurrence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOccurrence( + io.grafeas.v1beta1.GetOccurrenceRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetOccurrenceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists occurrences for the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listOccurrences( + io.grafeas.v1beta1.ListOccurrencesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListOccurrencesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes the specified occurrence. For example, use this method to delete an
+     * occurrence when the occurrence is no longer applicable for the given
+     * resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteOccurrence( + io.grafeas.v1beta1.DeleteOccurrenceRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteOccurrenceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a new occurrence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createOccurrence( + io.grafeas.v1beta1.CreateOccurrenceRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateOccurrenceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates new occurrences in batch.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture batchCreateOccurrences( + io.grafeas.v1beta1.BatchCreateOccurrencesRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchCreateOccurrencesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the specified occurrence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateOccurrence( + io.grafeas.v1beta1.UpdateOccurrenceRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateOccurrenceMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets the note attached to the specified occurrence. Consumer projects can
+     * use this method to get a note that belongs to a provider project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getOccurrenceNote( + io.grafeas.v1beta1.GetOccurrenceNoteRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetOccurrenceNoteMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets the specified note.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getNote( + io.grafeas.v1beta1.GetNoteRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetNoteMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists notes for the specified project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listNotes( + io.grafeas.v1beta1.ListNotesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListNotesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes the specified note.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteNote( + io.grafeas.v1beta1.DeleteNoteRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteNoteMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates a new note.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture createNote( + io.grafeas.v1beta1.CreateNoteRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateNoteMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Creates new notes in batch.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture batchCreateNotes( + io.grafeas.v1beta1.BatchCreateNotesRequest request) { + return futureUnaryCall( + getChannel().newCall(getBatchCreateNotesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the specified note.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateNote( + io.grafeas.v1beta1.UpdateNoteRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateNoteMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists occurrences referencing the specified note. Provider projects can use
+     * this method to get all occurrences across consumer projects referencing the
+     * specified note.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listNoteOccurrences( + io.grafeas.v1beta1.ListNoteOccurrencesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListNoteOccurrencesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a summary of the number and severity of occurrences.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getVulnerabilityOccurrencesSummary( + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetVulnerabilityOccurrencesSummaryMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_OCCURRENCE = 0; + private static final int METHODID_LIST_OCCURRENCES = 1; + private static final int METHODID_DELETE_OCCURRENCE = 2; + private static final int METHODID_CREATE_OCCURRENCE = 3; + private static final int METHODID_BATCH_CREATE_OCCURRENCES = 4; + private static final int METHODID_UPDATE_OCCURRENCE = 5; + private static final int METHODID_GET_OCCURRENCE_NOTE = 6; + private static final int METHODID_GET_NOTE = 7; + private static final int METHODID_LIST_NOTES = 8; + private static final int METHODID_DELETE_NOTE = 9; + private static final int METHODID_CREATE_NOTE = 10; + private static final int METHODID_BATCH_CREATE_NOTES = 11; + private static final int METHODID_UPDATE_NOTE = 12; + private static final int METHODID_LIST_NOTE_OCCURRENCES = 13; + private static final int METHODID_GET_VULNERABILITY_OCCURRENCES_SUMMARY = 14; + + 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 GrafeasV1Beta1ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(GrafeasV1Beta1ImplBase 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_GET_OCCURRENCE: + serviceImpl.getOccurrence((io.grafeas.v1beta1.GetOccurrenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_OCCURRENCES: + serviceImpl.listOccurrences((io.grafeas.v1beta1.ListOccurrencesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_OCCURRENCE: + serviceImpl.deleteOccurrence((io.grafeas.v1beta1.DeleteOccurrenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_OCCURRENCE: + serviceImpl.createOccurrence((io.grafeas.v1beta1.CreateOccurrenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_OCCURRENCES: + serviceImpl.batchCreateOccurrences((io.grafeas.v1beta1.BatchCreateOccurrencesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_OCCURRENCE: + serviceImpl.updateOccurrence((io.grafeas.v1beta1.UpdateOccurrenceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_OCCURRENCE_NOTE: + serviceImpl.getOccurrenceNote((io.grafeas.v1beta1.GetOccurrenceNoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_NOTE: + serviceImpl.getNote((io.grafeas.v1beta1.GetNoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_NOTES: + serviceImpl.listNotes((io.grafeas.v1beta1.ListNotesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_NOTE: + serviceImpl.deleteNote((io.grafeas.v1beta1.DeleteNoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_NOTE: + serviceImpl.createNote((io.grafeas.v1beta1.CreateNoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_BATCH_CREATE_NOTES: + serviceImpl.batchCreateNotes((io.grafeas.v1beta1.BatchCreateNotesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_NOTE: + serviceImpl.updateNote((io.grafeas.v1beta1.UpdateNoteRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_NOTE_OCCURRENCES: + serviceImpl.listNoteOccurrences((io.grafeas.v1beta1.ListNoteOccurrencesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_VULNERABILITY_OCCURRENCES_SUMMARY: + serviceImpl.getVulnerabilityOccurrencesSummary((io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) 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 static abstract class GrafeasV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + GrafeasV1Beta1BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return io.grafeas.v1beta1.Grafeas.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("GrafeasV1Beta1"); + } + } + + private static final class GrafeasV1Beta1FileDescriptorSupplier + extends GrafeasV1Beta1BaseDescriptorSupplier { + GrafeasV1Beta1FileDescriptorSupplier() {} + } + + private static final class GrafeasV1Beta1MethodDescriptorSupplier + extends GrafeasV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + GrafeasV1Beta1MethodDescriptorSupplier(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 (GrafeasV1Beta1Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new GrafeasV1Beta1FileDescriptorSupplier()) + .addMethod(getGetOccurrenceMethodHelper()) + .addMethod(getListOccurrencesMethodHelper()) + .addMethod(getDeleteOccurrenceMethodHelper()) + .addMethod(getCreateOccurrenceMethodHelper()) + .addMethod(getBatchCreateOccurrencesMethodHelper()) + .addMethod(getUpdateOccurrenceMethodHelper()) + .addMethod(getGetOccurrenceNoteMethodHelper()) + .addMethod(getGetNoteMethodHelper()) + .addMethod(getListNotesMethodHelper()) + .addMethod(getDeleteNoteMethodHelper()) + .addMethod(getCreateNoteMethodHelper()) + .addMethod(getBatchCreateNotesMethodHelper()) + .addMethod(getUpdateNoteMethodHelper()) + .addMethod(getListNoteOccurrencesMethodHelper()) + .addMethod(getGetVulnerabilityOccurrencesSummaryMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/grpc-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpServiceGrpc.java b/google-api-grpc/grpc-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpServiceGrpc.java index 563aa1ce9b87..e168aac89a10 100644 --- a/google-api-grpc/grpc-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpServiceGrpc.java +++ b/google-api-grpc/grpc-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpServiceGrpc.java @@ -962,6 +962,191 @@ com.google.protobuf.Empty> getCancelDlpJobMethodHelper() { } return getCancelDlpJobMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateStoredInfoTypeMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_CREATE_STORED_INFO_TYPE = getCreateStoredInfoTypeMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getCreateStoredInfoTypeMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getCreateStoredInfoTypeMethod() { + return getCreateStoredInfoTypeMethodHelper(); + } + + private static io.grpc.MethodDescriptor getCreateStoredInfoTypeMethodHelper() { + io.grpc.MethodDescriptor getCreateStoredInfoTypeMethod; + if ((getCreateStoredInfoTypeMethod = DlpServiceGrpc.getCreateStoredInfoTypeMethod) == null) { + synchronized (DlpServiceGrpc.class) { + if ((getCreateStoredInfoTypeMethod = DlpServiceGrpc.getCreateStoredInfoTypeMethod) == null) { + DlpServiceGrpc.getCreateStoredInfoTypeMethod = getCreateStoredInfoTypeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.privacy.dlp.v2.DlpService", "CreateStoredInfoType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance())) + .setSchemaDescriptor(new DlpServiceMethodDescriptorSupplier("CreateStoredInfoType")) + .build(); + } + } + } + return getCreateStoredInfoTypeMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateStoredInfoTypeMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_UPDATE_STORED_INFO_TYPE = getUpdateStoredInfoTypeMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getUpdateStoredInfoTypeMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getUpdateStoredInfoTypeMethod() { + return getUpdateStoredInfoTypeMethodHelper(); + } + + private static io.grpc.MethodDescriptor getUpdateStoredInfoTypeMethodHelper() { + io.grpc.MethodDescriptor getUpdateStoredInfoTypeMethod; + if ((getUpdateStoredInfoTypeMethod = DlpServiceGrpc.getUpdateStoredInfoTypeMethod) == null) { + synchronized (DlpServiceGrpc.class) { + if ((getUpdateStoredInfoTypeMethod = DlpServiceGrpc.getUpdateStoredInfoTypeMethod) == null) { + DlpServiceGrpc.getUpdateStoredInfoTypeMethod = getUpdateStoredInfoTypeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.privacy.dlp.v2.DlpService", "UpdateStoredInfoType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance())) + .setSchemaDescriptor(new DlpServiceMethodDescriptorSupplier("UpdateStoredInfoType")) + .build(); + } + } + } + return getUpdateStoredInfoTypeMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetStoredInfoTypeMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_GET_STORED_INFO_TYPE = getGetStoredInfoTypeMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getGetStoredInfoTypeMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getGetStoredInfoTypeMethod() { + return getGetStoredInfoTypeMethodHelper(); + } + + private static io.grpc.MethodDescriptor getGetStoredInfoTypeMethodHelper() { + io.grpc.MethodDescriptor getGetStoredInfoTypeMethod; + if ((getGetStoredInfoTypeMethod = DlpServiceGrpc.getGetStoredInfoTypeMethod) == null) { + synchronized (DlpServiceGrpc.class) { + if ((getGetStoredInfoTypeMethod = DlpServiceGrpc.getGetStoredInfoTypeMethod) == null) { + DlpServiceGrpc.getGetStoredInfoTypeMethod = getGetStoredInfoTypeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.privacy.dlp.v2.DlpService", "GetStoredInfoType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance())) + .setSchemaDescriptor(new DlpServiceMethodDescriptorSupplier("GetStoredInfoType")) + .build(); + } + } + } + return getGetStoredInfoTypeMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListStoredInfoTypesMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_LIST_STORED_INFO_TYPES = getListStoredInfoTypesMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getListStoredInfoTypesMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getListStoredInfoTypesMethod() { + return getListStoredInfoTypesMethodHelper(); + } + + private static io.grpc.MethodDescriptor getListStoredInfoTypesMethodHelper() { + io.grpc.MethodDescriptor getListStoredInfoTypesMethod; + if ((getListStoredInfoTypesMethod = DlpServiceGrpc.getListStoredInfoTypesMethod) == null) { + synchronized (DlpServiceGrpc.class) { + if ((getListStoredInfoTypesMethod = DlpServiceGrpc.getListStoredInfoTypesMethod) == null) { + DlpServiceGrpc.getListStoredInfoTypesMethod = getListStoredInfoTypesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.privacy.dlp.v2.DlpService", "ListStoredInfoTypes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.getDefaultInstance())) + .setSchemaDescriptor(new DlpServiceMethodDescriptorSupplier("ListStoredInfoTypes")) + .build(); + } + } + } + return getListStoredInfoTypesMethod; + } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteStoredInfoTypeMethod()} instead. + public static final io.grpc.MethodDescriptor METHOD_DELETE_STORED_INFO_TYPE = getDeleteStoredInfoTypeMethodHelper(); + + private static volatile io.grpc.MethodDescriptor getDeleteStoredInfoTypeMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor getDeleteStoredInfoTypeMethod() { + return getDeleteStoredInfoTypeMethodHelper(); + } + + private static io.grpc.MethodDescriptor getDeleteStoredInfoTypeMethodHelper() { + io.grpc.MethodDescriptor getDeleteStoredInfoTypeMethod; + if ((getDeleteStoredInfoTypeMethod = DlpServiceGrpc.getDeleteStoredInfoTypeMethod) == null) { + synchronized (DlpServiceGrpc.class) { + if ((getDeleteStoredInfoTypeMethod = DlpServiceGrpc.getDeleteStoredInfoTypeMethod) == null) { + DlpServiceGrpc.getDeleteStoredInfoTypeMethod = getDeleteStoredInfoTypeMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "google.privacy.dlp.v2.DlpService", "DeleteStoredInfoType")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new DlpServiceMethodDescriptorSupplier("DeleteStoredInfoType")) + .build(); + } + } + } + return getDeleteStoredInfoTypeMethod; + } /** * Creates a new async stub that supports all call types for the service @@ -1313,6 +1498,67 @@ public void cancelDlpJob(com.google.privacy.dlp.v2.CancelDlpJobRequest request, asyncUnimplementedUnaryCall(getCancelDlpJobMethodHelper(), responseObserver); } + /** + *
+     * Creates a pre-built stored infoType to be used for inspection.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void createStoredInfoType(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateStoredInfoTypeMethodHelper(), responseObserver); + } + + /** + *
+     * Updates the stored infoType by creating a new version. The existing version
+     * will continue to be used until the new version is ready.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void updateStoredInfoType(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateStoredInfoTypeMethodHelper(), responseObserver); + } + + /** + *
+     * Gets a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void getStoredInfoType(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetStoredInfoTypeMethodHelper(), responseObserver); + } + + /** + *
+     * Lists stored infoTypes.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void listStoredInfoTypes(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListStoredInfoTypesMethodHelper(), responseObserver); + } + + /** + *
+     * Deletes a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void deleteStoredInfoType(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteStoredInfoTypeMethodHelper(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( @@ -1490,6 +1736,41 @@ public void cancelDlpJob(com.google.privacy.dlp.v2.CancelDlpJobRequest request, com.google.privacy.dlp.v2.CancelDlpJobRequest, com.google.protobuf.Empty>( this, METHODID_CANCEL_DLP_JOB))) + .addMethod( + getCreateStoredInfoTypeMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest, + com.google.privacy.dlp.v2.StoredInfoType>( + this, METHODID_CREATE_STORED_INFO_TYPE))) + .addMethod( + getUpdateStoredInfoTypeMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest, + com.google.privacy.dlp.v2.StoredInfoType>( + this, METHODID_UPDATE_STORED_INFO_TYPE))) + .addMethod( + getGetStoredInfoTypeMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest, + com.google.privacy.dlp.v2.StoredInfoType>( + this, METHODID_GET_STORED_INFO_TYPE))) + .addMethod( + getListStoredInfoTypesMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest, + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse>( + this, METHODID_LIST_STORED_INFO_TYPES))) + .addMethod( + getDeleteStoredInfoTypeMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_STORED_INFO_TYPE))) .build(); } } @@ -1859,6 +2140,72 @@ public void cancelDlpJob(com.google.privacy.dlp.v2.CancelDlpJobRequest request, asyncUnaryCall( getChannel().newCall(getCancelDlpJobMethodHelper(), getCallOptions()), request, responseObserver); } + + /** + *
+     * Creates a pre-built stored infoType to be used for inspection.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void createStoredInfoType(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateStoredInfoTypeMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Updates the stored infoType by creating a new version. The existing version
+     * will continue to be used until the new version is ready.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void updateStoredInfoType(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateStoredInfoTypeMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void getStoredInfoType(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetStoredInfoTypeMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Lists stored infoTypes.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void listStoredInfoTypes(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListStoredInfoTypesMethodHelper(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public void deleteStoredInfoType(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteStoredInfoTypeMethodHelper(), getCallOptions()), request, responseObserver); + } } /** @@ -2201,6 +2548,67 @@ public com.google.protobuf.Empty cancelDlpJob(com.google.privacy.dlp.v2.CancelDl return blockingUnaryCall( getChannel(), getCancelDlpJobMethodHelper(), getCallOptions(), request); } + + /** + *
+     * Creates a pre-built stored infoType to be used for inspection.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.privacy.dlp.v2.StoredInfoType createStoredInfoType(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request) { + return blockingUnaryCall( + getChannel(), getCreateStoredInfoTypeMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Updates the stored infoType by creating a new version. The existing version
+     * will continue to be used until the new version is ready.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.privacy.dlp.v2.StoredInfoType updateStoredInfoType(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateStoredInfoTypeMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Gets a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.privacy.dlp.v2.StoredInfoType getStoredInfoType(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request) { + return blockingUnaryCall( + getChannel(), getGetStoredInfoTypeMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Lists stored infoTypes.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.privacy.dlp.v2.ListStoredInfoTypesResponse listStoredInfoTypes(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request) { + return blockingUnaryCall( + getChannel(), getListStoredInfoTypesMethodHelper(), getCallOptions(), request); + } + + /** + *
+     * Deletes a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.protobuf.Empty deleteStoredInfoType(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteStoredInfoTypeMethodHelper(), getCallOptions(), request); + } } /** @@ -2568,6 +2976,72 @@ public com.google.common.util.concurrent.ListenableFuture + * Creates a pre-built stored infoType to be used for inspection. + * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + * learn more. + * + */ + public com.google.common.util.concurrent.ListenableFuture createStoredInfoType( + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateStoredInfoTypeMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Updates the stored infoType by creating a new version. The existing version
+     * will continue to be used until the new version is ready.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture updateStoredInfoType( + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateStoredInfoTypeMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Gets a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getStoredInfoType( + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetStoredInfoTypeMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Lists stored infoTypes.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listStoredInfoTypes( + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest request) { + return futureUnaryCall( + getChannel().newCall(getListStoredInfoTypesMethodHelper(), getCallOptions()), request); + } + + /** + *
+     * Deletes a stored infoType.
+     * See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
+     * learn more.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteStoredInfoType( + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteStoredInfoTypeMethodHelper(), getCallOptions()), request); + } } private static final int METHODID_INSPECT_CONTENT = 0; @@ -2595,6 +3069,11 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -2713,6 +3192,26 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.cancelDlpJob((com.google.privacy.dlp.v2.CancelDlpJobRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_CREATE_STORED_INFO_TYPE: + serviceImpl.createStoredInfoType((com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UPDATE_STORED_INFO_TYPE: + serviceImpl.updateStoredInfoType((com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_STORED_INFO_TYPE: + serviceImpl.getStoredInfoType((com.google.privacy.dlp.v2.GetStoredInfoTypeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_STORED_INFO_TYPES: + serviceImpl.listStoredInfoTypes((com.google.privacy.dlp.v2.ListStoredInfoTypesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_STORED_INFO_TYPE: + serviceImpl.deleteStoredInfoType((com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -2799,6 +3298,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getGetDlpJobMethodHelper()) .addMethod(getDeleteDlpJobMethodHelper()) .addMethod(getCancelDlpJobMethodHelper()) + .addMethod(getCreateStoredInfoTypeMethodHelper()) + .addMethod(getUpdateStoredInfoTypeMethodHelper()) + .addMethod(getGetStoredInfoTypeMethodHelper()) + .addMethod(getListStoredInfoTypesMethodHelper()) + .addMethod(getDeleteStoredInfoTypeMethodHelper()) .build(); } } diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 4dc075681c58..b193eb5313ce 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -181,6 +181,16 @@ grpc-google-cloud-container-v1 0.22.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-dataproc-v1 @@ -555,6 +565,7 @@ grpc-google-cloud-bigtable-admin-v2 grpc-google-cloud-bigtable-v2 grpc-google-cloud-container-v1 + grpc-google-cloud-containeranalysis-v1beta1 grpc-google-cloud-dataproc-v1 grpc-google-cloud-dataproc-v1beta2 grpc-google-cloud-dialogflow-v2 @@ -597,6 +608,7 @@ proto-google-cloud-bigtable-admin-v2 proto-google-cloud-bigtable-v2 proto-google-cloud-container-v1 + proto-google-cloud-containeranalysis-v1beta1 proto-google-cloud-dataproc-v1 proto-google-cloud-dataproc-v1beta2 proto-google-cloud-datastore-v1 diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/pom.xml new file mode 100644 index 000000000000..1bf170b8d449 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + proto-google-cloud-containeranalysis-v1beta1 + PROTO library for proto-google-cloud-containeranalysis-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.22.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-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 new file mode 100644 index 000000000000..b846ab032009 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/Containeranalysis.java @@ -0,0 +1,166 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +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); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nAgoogle/devtools/containeranalysis/v1be" + + "ta1/containeranalysis.proto\022)google.devt" + + "ools.containeranalysis.v1beta1\032\034google/a" + + "pi/annotations.proto\032\036google/iam/v1/iam_" + + "policy.proto\032\032google/iam/v1/policy.proto" + + "\032\037google/protobuf/timestamp.proto\"\242\001\n\nSc" + + "anConfig\022\014\n\004name\030\001 \001(\t\022\023\n\013description\030\002 " + + "\001(\t\022\017\n\007enabled\030\003 \001(\010\022/\n\013create_time\030\004 \001(" + + "\0132\032.google.protobuf.Timestamp\022/\n\013update_" + + "time\030\005 \001(\0132\032.google.protobuf.Timestamp\"$" + + "\n\024GetScanConfigRequest\022\014\n\004name\030\001 \001(\t\"_\n\026" + + "ListScanConfigsRequest\022\016\n\006parent\030\001 \001(\t\022\016" + + "\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npag" + + "e_token\030\004 \001(\t\"\177\n\027ListScanConfigsResponse" + + "\022K\n\014scan_configs\030\001 \003(\01325.google.devtools" + + ".containeranalysis.v1beta1.ScanConfig\022\027\n" + + "\017next_page_token\030\002 \001(\t\"s\n\027UpdateScanConf" + + "igRequest\022\014\n\004name\030\001 \001(\t\022J\n\013scan_config\030\002" + + " \001(\01325.google.devtools.containeranalysis" + + ".v1beta1.ScanConfig2\204\n\n\030ContainerAnalysi" + + "sV1Beta1\022\311\001\n\014SetIamPolicy\022\".google.iam.v" + + "1.SetIamPolicyRequest\032\025.google.iam.v1.Po" + + "licy\"~\202\323\344\223\002x\"3/v1beta1/{resource=project" + + "s/*/notes/*}:setIamPolicy:\001*Z>\"9/v1beta1" + + "/{resource=projects/*/occurrences/*}:set" + + "IamPolicy:\001*\022\311\001\n\014GetIamPolicy\022\".google.i" + + "am.v1.GetIamPolicyRequest\032\025.google.iam.v" + + "1.Policy\"~\202\323\344\223\002x\"3/v1beta1/{resource=pro" + + "jects/*/notes/*}:getIamPolicy:\001*Z>\"9/v1b" + + "eta1/{resource=projects/*/occurrences/*}" + + ":getIamPolicy:\001*\022\367\001\n\022TestIamPermissions\022" + + "(.google.iam.v1.TestIamPermissionsReques" + + "t\032).google.iam.v1.TestIamPermissionsResp" + + "onse\"\213\001\202\323\344\223\002\204\001\"9/v1beta1/{resource=proje" + + "cts/*/notes/*}:testIamPermissions:\001*ZD\"?" + + "/v1beta1/{resource=projects/*/occurrence" + + "s/*}:testIamPermissions:\001*\022\271\001\n\rGetScanCo" + + "nfig\022?.google.devtools.containeranalysis" + + ".v1beta1.GetScanConfigRequest\0325.google.d" + + "evtools.containeranalysis.v1beta1.ScanCo" + + "nfig\"0\202\323\344\223\002*\022(/v1beta1/{name=projects/*/" + + "scanConfigs/*}\022\312\001\n\017ListScanConfigs\022A.goo" + + "gle.devtools.containeranalysis.v1beta1.L" + + "istScanConfigsRequest\032B.google.devtools." + + "containeranalysis.v1beta1.ListScanConfig" + + "sResponse\"0\202\323\344\223\002*\022(/v1beta1/{parent=proj" + + "ects/*}/scanConfigs\022\314\001\n\020UpdateScanConfig" + + "\022B.google.devtools.containeranalysis.v1b" + + "eta1.UpdateScanConfigRequest\0325.google.de" + + "vtools.containeranalysis.v1beta1.ScanCon" + + "fig\"=\202\323\344\223\0027\032(/v1beta1/{name=projects/*/s" + + "canConfigs/*}:\013scan_configB\212\001\n$com.googl" + + "e.containeranalysis.v1beta1P\001ZZgoogle.go" + + "lang.org/genproto/googleapis/devtools/co" + + "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); + internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor, + new java.lang.String[] { "Name", "Description", "Enabled", "CreateTime", "UpdateTime", }); + internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor, + new java.lang.String[] { "ScanConfigs", "NextPageToken", }); + internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor, + new java.lang.String[] { "Name", "ScanConfig", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.iam.v1.IamPolicyProto.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..b6cfbf7d4b2c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +/** + *
+ * Request to get a scan configuration.
+ * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.GetScanConfigRequest} + */ +public final class GetScanConfigRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.devtools.containeranalysis.v1beta1.GetScanConfigRequest) + GetScanConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetScanConfigRequest.newBuilder() to construct. + private GetScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetScanConfigRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.GetScanConfigRequest.class, com.google.containeranalysis.v1beta1.GetScanConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.containeranalysis.v1beta1.GetScanConfigRequest)) { + return super.equals(obj); + } + com.google.containeranalysis.v1beta1.GetScanConfigRequest other = (com.google.containeranalysis.v1beta1.GetScanConfigRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.containeranalysis.v1beta1.GetScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to get a scan configuration.
+   * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.GetScanConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.devtools.containeranalysis.v1beta1.GetScanConfigRequest) + com.google.containeranalysis.v1beta1.GetScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.GetScanConfigRequest.class, com.google.containeranalysis.v1beta1.GetScanConfigRequest.Builder.class); + } + + // Construct using com.google.containeranalysis.v1beta1.GetScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.GetScanConfigRequest getDefaultInstanceForType() { + return com.google.containeranalysis.v1beta1.GetScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.GetScanConfigRequest build() { + com.google.containeranalysis.v1beta1.GetScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.GetScanConfigRequest buildPartial() { + com.google.containeranalysis.v1beta1.GetScanConfigRequest result = new com.google.containeranalysis.v1beta1.GetScanConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.containeranalysis.v1beta1.GetScanConfigRequest) { + return mergeFrom((com.google.containeranalysis.v1beta1.GetScanConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.containeranalysis.v1beta1.GetScanConfigRequest other) { + if (other == com.google.containeranalysis.v1beta1.GetScanConfigRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.containeranalysis.v1beta1.GetScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.containeranalysis.v1beta1.GetScanConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.devtools.containeranalysis.v1beta1.GetScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.containeranalysis.v1beta1.GetScanConfigRequest) + private static final com.google.containeranalysis.v1beta1.GetScanConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.containeranalysis.v1beta1.GetScanConfigRequest(); + } + + public static com.google.containeranalysis.v1beta1.GetScanConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.GetScanConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequestOrBuilder.java new file mode 100644 index 000000000000..a09469c1b64f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/GetScanConfigRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +public interface GetScanConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.devtools.containeranalysis.v1beta1.GetScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..1ee9c87698f1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequest.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +/** + *
+ * Request to list scan configurations.
+ * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest} + */ +public final class ListScanConfigsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest) + ListScanConfigsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListScanConfigsRequest.newBuilder() to construct. + private ListScanConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListScanConfigsRequest() { + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListScanConfigsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ListScanConfigsRequest.class, com.google.containeranalysis.v1beta1.ListScanConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project to list scan configurations for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project to list scan configurations for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * The number of scan configs to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.containeranalysis.v1beta1.ListScanConfigsRequest)) { + return super.equals(obj); + } + com.google.containeranalysis.v1beta1.ListScanConfigsRequest other = (com.google.containeranalysis.v1beta1.ListScanConfigsRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.containeranalysis.v1beta1.ListScanConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to list scan configurations.
+   * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest) + com.google.containeranalysis.v1beta1.ListScanConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ListScanConfigsRequest.class, com.google.containeranalysis.v1beta1.ListScanConfigsRequest.Builder.class); + } + + // Construct using com.google.containeranalysis.v1beta1.ListScanConfigsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsRequest getDefaultInstanceForType() { + return com.google.containeranalysis.v1beta1.ListScanConfigsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsRequest build() { + com.google.containeranalysis.v1beta1.ListScanConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsRequest buildPartial() { + com.google.containeranalysis.v1beta1.ListScanConfigsRequest result = new com.google.containeranalysis.v1beta1.ListScanConfigsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.containeranalysis.v1beta1.ListScanConfigsRequest) { + return mergeFrom((com.google.containeranalysis.v1beta1.ListScanConfigsRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.containeranalysis.v1beta1.ListScanConfigsRequest other) { + if (other == com.google.containeranalysis.v1beta1.ListScanConfigsRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.containeranalysis.v1beta1.ListScanConfigsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.containeranalysis.v1beta1.ListScanConfigsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project to list scan configurations for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project to list scan configurations for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project to list scan configurations for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project to list scan configurations for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project to list scan configurations for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * The number of scan configs to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * The number of scan configs to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * The number of scan configs to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest) + private static final com.google.containeranalysis.v1beta1.ListScanConfigsRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.containeranalysis.v1beta1.ListScanConfigsRequest(); + } + + public static com.google.containeranalysis.v1beta1.ListScanConfigsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanConfigsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequestOrBuilder.java new file mode 100644 index 000000000000..4bacb4f2d2a9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +public interface ListScanConfigsRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.devtools.containeranalysis.v1beta1.ListScanConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project to list scan configurations for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project to list scan configurations for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * The number of scan configs to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..6b0b5b294984 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponse.java @@ -0,0 +1,1031 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +/** + *
+ * Response for listing scan configurations.
+ * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse} + */ +public final class ListScanConfigsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse) + ListScanConfigsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListScanConfigsResponse.newBuilder() to construct. + private ListScanConfigsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListScanConfigsResponse() { + scanConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListScanConfigsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + scanConfigs_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scanConfigs_.add( + input.readMessage(com.google.containeranalysis.v1beta1.ScanConfig.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + scanConfigs_ = java.util.Collections.unmodifiableList(scanConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ListScanConfigsResponse.class, com.google.containeranalysis.v1beta1.ListScanConfigsResponse.Builder.class); + } + + private int bitField0_; + public static final int SCAN_CONFIGS_FIELD_NUMBER = 1; + private java.util.List scanConfigs_; + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public java.util.List getScanConfigsList() { + return scanConfigs_; + } + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public java.util.List + getScanConfigsOrBuilderList() { + return scanConfigs_; + } + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public int getScanConfigsCount() { + return scanConfigs_.size(); + } + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfig getScanConfigs(int index) { + return scanConfigs_.get(index); + } + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigsOrBuilder( + int index) { + return scanConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < scanConfigs_.size(); i++) { + output.writeMessage(1, scanConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < scanConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, scanConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.containeranalysis.v1beta1.ListScanConfigsResponse)) { + return super.equals(obj); + } + com.google.containeranalysis.v1beta1.ListScanConfigsResponse other = (com.google.containeranalysis.v1beta1.ListScanConfigsResponse) obj; + + boolean result = true; + result = result && getScanConfigsList() + .equals(other.getScanConfigsList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getScanConfigsCount() > 0) { + hash = (37 * hash) + SCAN_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getScanConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.containeranalysis.v1beta1.ListScanConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for listing scan configurations.
+   * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse) + com.google.containeranalysis.v1beta1.ListScanConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ListScanConfigsResponse.class, com.google.containeranalysis.v1beta1.ListScanConfigsResponse.Builder.class); + } + + // Construct using com.google.containeranalysis.v1beta1.ListScanConfigsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getScanConfigsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (scanConfigsBuilder_ == null) { + scanConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + scanConfigsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsResponse getDefaultInstanceForType() { + return com.google.containeranalysis.v1beta1.ListScanConfigsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsResponse build() { + com.google.containeranalysis.v1beta1.ListScanConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000001)) { + scanConfigs_ = java.util.Collections.unmodifiableList(scanConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scanConfigs_ = scanConfigs_; + } else { + result.scanConfigs_ = scanConfigsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.containeranalysis.v1beta1.ListScanConfigsResponse) { + return mergeFrom((com.google.containeranalysis.v1beta1.ListScanConfigsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.containeranalysis.v1beta1.ListScanConfigsResponse other) { + if (other == com.google.containeranalysis.v1beta1.ListScanConfigsResponse.getDefaultInstance()) return this; + if (scanConfigsBuilder_ == null) { + if (!other.scanConfigs_.isEmpty()) { + if (scanConfigs_.isEmpty()) { + scanConfigs_ = other.scanConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScanConfigsIsMutable(); + scanConfigs_.addAll(other.scanConfigs_); + } + onChanged(); + } + } else { + if (!other.scanConfigs_.isEmpty()) { + if (scanConfigsBuilder_.isEmpty()) { + scanConfigsBuilder_.dispose(); + scanConfigsBuilder_ = null; + scanConfigs_ = other.scanConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + scanConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getScanConfigsFieldBuilder() : null; + } else { + scanConfigsBuilder_.addAllMessages(other.scanConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.containeranalysis.v1beta1.ListScanConfigsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.containeranalysis.v1beta1.ListScanConfigsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List scanConfigs_ = + java.util.Collections.emptyList(); + private void ensureScanConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + scanConfigs_ = new java.util.ArrayList(scanConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder> scanConfigsBuilder_; + + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public java.util.List getScanConfigsList() { + if (scanConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(scanConfigs_); + } else { + return scanConfigsBuilder_.getMessageList(); + } + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public int getScanConfigsCount() { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.size(); + } else { + return scanConfigsBuilder_.getCount(); + } + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfig getScanConfigs(int index) { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.get(index); + } else { + return scanConfigsBuilder_.getMessage(index); + } + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder setScanConfigs( + int index, com.google.containeranalysis.v1beta1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.set(index, value); + onChanged(); + } else { + scanConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder setScanConfigs( + int index, com.google.containeranalysis.v1beta1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs(com.google.containeranalysis.v1beta1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.add(value); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + int index, com.google.containeranalysis.v1beta1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.add(index, value); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + com.google.containeranalysis.v1beta1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.add(builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + int index, com.google.containeranalysis.v1beta1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder addAllScanConfigs( + java.lang.Iterable values) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, scanConfigs_); + onChanged(); + } else { + scanConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder clearScanConfigs() { + if (scanConfigsBuilder_ == null) { + scanConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + scanConfigsBuilder_.clear(); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public Builder removeScanConfigs(int index) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.remove(index); + onChanged(); + } else { + scanConfigsBuilder_.remove(index); + } + return this; + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfig.Builder getScanConfigsBuilder( + int index) { + return getScanConfigsFieldBuilder().getBuilder(index); + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigsOrBuilder( + int index) { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.get(index); } else { + return scanConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public java.util.List + getScanConfigsOrBuilderList() { + if (scanConfigsBuilder_ != null) { + return scanConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scanConfigs_); + } + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfig.Builder addScanConfigsBuilder() { + return getScanConfigsFieldBuilder().addBuilder( + com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance()); + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public com.google.containeranalysis.v1beta1.ScanConfig.Builder addScanConfigsBuilder( + int index) { + return getScanConfigsFieldBuilder().addBuilder( + index, com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance()); + } + /** + *
+     * The scan configurations requested.
+     * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + public java.util.List + getScanConfigsBuilderList() { + return getScanConfigsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder> + getScanConfigsFieldBuilder() { + if (scanConfigsBuilder_ == null) { + scanConfigsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder>( + scanConfigs_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + scanConfigs_ = null; + } + return scanConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse) + private static final com.google.containeranalysis.v1beta1.ListScanConfigsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.containeranalysis.v1beta1.ListScanConfigsResponse(); + } + + public static com.google.containeranalysis.v1beta1.ListScanConfigsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanConfigsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ListScanConfigsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponseOrBuilder.java new file mode 100644 index 000000000000..4dc6cdbb9031 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ListScanConfigsResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +public interface ListScanConfigsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.devtools.containeranalysis.v1beta1.ListScanConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + java.util.List + getScanConfigsList(); + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + com.google.containeranalysis.v1beta1.ScanConfig getScanConfigs(int index); + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + int getScanConfigsCount(); + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + java.util.List + getScanConfigsOrBuilderList(); + /** + *
+   * The scan configurations requested.
+   * 
+ * + * repeated .google.devtools.containeranalysis.v1beta1.ScanConfig scan_configs = 1; + */ + com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigsOrBuilder( + int index); + + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/NoteName.java new file mode 100644 index 000000000000..105199e7c536 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/OccurrenceName.java new file mode 100644 index 000000000000..74b1215c7bf1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ProjectName.java new file mode 100644 index 000000000000..fd1abfbc5da7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-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 new file mode 100644 index 000000000000..c1487a26376d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfig.java @@ -0,0 +1,1283 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +/** + *
+ * A scan configuration specifies whether Cloud components in a project have a
+ * particular type of analysis being run. For example, it can configure whether
+ * vulnerability scanning is being done on Docker images or not.
+ * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ScanConfig} + */ +public final class ScanConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.devtools.containeranalysis.v1beta1.ScanConfig) + ScanConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use ScanConfig.newBuilder() to construct. + private ScanConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ScanConfig() { + name_ = ""; + description_ = ""; + enabled_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ScanConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 24: { + + enabled_ = input.readBool(); + break; + } + case 34: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ScanConfig.class, com.google.containeranalysis.v1beta1.ScanConfig.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Output only. The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Output only. The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * Output only. A human-readable description of what the scan configuration
+   * does.
+   * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * Output only. A human-readable description of what the scan configuration
+   * does.
+   * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENABLED_FIELD_NUMBER = 3; + private boolean enabled_; + /** + *
+   * Whether the scan is enabled.
+   * 
+ * + * bool enabled = 3; + */ + public boolean getEnabled() { + return enabled_; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (enabled_ != false) { + output.writeBool(3, enabled_); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (enabled_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, enabled_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getUpdateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.containeranalysis.v1beta1.ScanConfig)) { + return super.equals(obj); + } + com.google.containeranalysis.v1beta1.ScanConfig other = (com.google.containeranalysis.v1beta1.ScanConfig) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && (getEnabled() + == other.getEnabled()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getEnabled()); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.ScanConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.containeranalysis.v1beta1.ScanConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A scan configuration specifies whether Cloud components in a project have a
+   * particular type of analysis being run. For example, it can configure whether
+   * vulnerability scanning is being done on Docker images or not.
+   * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.ScanConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.devtools.containeranalysis.v1beta1.ScanConfig) + com.google.containeranalysis.v1beta1.ScanConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.ScanConfig.class, com.google.containeranalysis.v1beta1.ScanConfig.Builder.class); + } + + // Construct using com.google.containeranalysis.v1beta1.ScanConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + description_ = ""; + + enabled_ = false; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_ScanConfig_descriptor; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ScanConfig getDefaultInstanceForType() { + return com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ScanConfig build() { + com.google.containeranalysis.v1beta1.ScanConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ScanConfig buildPartial() { + com.google.containeranalysis.v1beta1.ScanConfig result = new com.google.containeranalysis.v1beta1.ScanConfig(this); + result.name_ = name_; + result.description_ = description_; + result.enabled_ = enabled_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.containeranalysis.v1beta1.ScanConfig) { + return mergeFrom((com.google.containeranalysis.v1beta1.ScanConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.containeranalysis.v1beta1.ScanConfig other) { + if (other == com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.getEnabled() != false) { + setEnabled(other.getEnabled()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.containeranalysis.v1beta1.ScanConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.containeranalysis.v1beta1.ScanConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Output only. A human-readable description of what the scan configuration
+     * does.
+     * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. A human-readable description of what the scan configuration
+     * does.
+     * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. A human-readable description of what the scan configuration
+     * does.
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. A human-readable description of what the scan configuration
+     * does.
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Output only. A human-readable description of what the scan configuration
+     * does.
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private boolean enabled_ ; + /** + *
+     * Whether the scan is enabled.
+     * 
+ * + * bool enabled = 3; + */ + public boolean getEnabled() { + return enabled_; + } + /** + *
+     * Whether the scan is enabled.
+     * 
+ * + * bool enabled = 3; + */ + public Builder setEnabled(boolean value) { + + enabled_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the scan is enabled.
+     * 
+ * + * bool enabled = 3; + */ + public Builder clearEnabled() { + + enabled_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only. The time this scan config was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + } + /** + *
+     * Output only. The time this scan config was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), + getParentForChildren(), + isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.devtools.containeranalysis.v1beta1.ScanConfig) + } + + // @@protoc_insertion_point(class_scope:google.devtools.containeranalysis.v1beta1.ScanConfig) + private static final com.google.containeranalysis.v1beta1.ScanConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.containeranalysis.v1beta1.ScanConfig(); + } + + public static com.google.containeranalysis.v1beta1.ScanConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.ScanConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigName.java new file mode 100644 index 000000000000..bce639a31f2b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigOrBuilder.java new file mode 100644 index 000000000000..72a602436135 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/ScanConfigOrBuilder.java @@ -0,0 +1,108 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +public interface ScanConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.devtools.containeranalysis.v1beta1.ScanConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Output only. The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Output only. A human-readable description of what the scan configuration
+   * does.
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * Output only. A human-readable description of what the scan configuration
+   * does.
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * Whether the scan is enabled.
+   * 
+ * + * bool enabled = 3; + */ + boolean getEnabled(); + + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + boolean hasCreateTime(); + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only. The time this scan config was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + boolean hasUpdateTime(); + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * Output only. The time this scan config was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} 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 new file mode 100644 index 000000000000..7d907b4651b9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequest.java @@ -0,0 +1,813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +/** + *
+ * A request to update a scan configuration.
+ * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest} + */ +public final class UpdateScanConfigRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest) + UpdateScanConfigRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateScanConfigRequest.newBuilder() to construct. + private UpdateScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateScanConfigRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.containeranalysis.v1beta1.ScanConfig.Builder subBuilder = null; + if (scanConfig_ != null) { + subBuilder = scanConfig_.toBuilder(); + } + scanConfig_ = input.readMessage(com.google.containeranalysis.v1beta1.ScanConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scanConfig_); + scanConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.class, com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCAN_CONFIG_FIELD_NUMBER = 2; + private com.google.containeranalysis.v1beta1.ScanConfig scanConfig_; + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public boolean hasScanConfig() { + return scanConfig_ != null; + } + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public com.google.containeranalysis.v1beta1.ScanConfig getScanConfig() { + return scanConfig_ == null ? com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance() : scanConfig_; + } + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigOrBuilder() { + return getScanConfig(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (scanConfig_ != null) { + output.writeMessage(2, getScanConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (scanConfig_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getScanConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.containeranalysis.v1beta1.UpdateScanConfigRequest)) { + return super.equals(obj); + } + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other = (com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasScanConfig() == other.hasScanConfig()); + if (hasScanConfig()) { + result = result && getScanConfig() + .equals(other.getScanConfig()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasScanConfig()) { + hash = (37 * hash) + SCAN_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getScanConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A request to update a scan configuration.
+   * 
+ * + * Protobuf type {@code google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest) + com.google.containeranalysis.v1beta1.UpdateScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.class, com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.Builder.class); + } + + // Construct using com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.containeranalysis.v1beta1.Containeranalysis.internal_static_google_devtools_containeranalysis_v1beta1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.UpdateScanConfigRequest getDefaultInstanceForType() { + return com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.UpdateScanConfigRequest build() { + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.UpdateScanConfigRequest buildPartial() { + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest result = new com.google.containeranalysis.v1beta1.UpdateScanConfigRequest(this); + result.name_ = name_; + if (scanConfigBuilder_ == null) { + result.scanConfig_ = scanConfig_; + } else { + result.scanConfig_ = scanConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) { + return mergeFrom((com.google.containeranalysis.v1beta1.UpdateScanConfigRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.containeranalysis.v1beta1.UpdateScanConfigRequest other) { + if (other == com.google.containeranalysis.v1beta1.UpdateScanConfigRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasScanConfig()) { + mergeScanConfig(other.getScanConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.containeranalysis.v1beta1.UpdateScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.containeranalysis.v1beta1.UpdateScanConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the scan configuration in the form of
+     * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.containeranalysis.v1beta1.ScanConfig scanConfig_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder> scanConfigBuilder_; + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public boolean hasScanConfig() { + return scanConfigBuilder_ != null || scanConfig_ != null; + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public com.google.containeranalysis.v1beta1.ScanConfig getScanConfig() { + if (scanConfigBuilder_ == null) { + return scanConfig_ == null ? com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance() : scanConfig_; + } else { + return scanConfigBuilder_.getMessage(); + } + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig(com.google.containeranalysis.v1beta1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scanConfig_ = value; + onChanged(); + } else { + scanConfigBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig( + com.google.containeranalysis.v1beta1.ScanConfig.Builder builderForValue) { + if (scanConfigBuilder_ == null) { + scanConfig_ = builderForValue.build(); + onChanged(); + } else { + scanConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public Builder mergeScanConfig(com.google.containeranalysis.v1beta1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (scanConfig_ != null) { + scanConfig_ = + com.google.containeranalysis.v1beta1.ScanConfig.newBuilder(scanConfig_).mergeFrom(value).buildPartial(); + } else { + scanConfig_ = value; + } + onChanged(); + } else { + scanConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public Builder clearScanConfig() { + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + onChanged(); + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + + return this; + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public com.google.containeranalysis.v1beta1.ScanConfig.Builder getScanConfigBuilder() { + + onChanged(); + return getScanConfigFieldBuilder().getBuilder(); + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + public com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigOrBuilder() { + if (scanConfigBuilder_ != null) { + return scanConfigBuilder_.getMessageOrBuilder(); + } else { + return scanConfig_ == null ? + com.google.containeranalysis.v1beta1.ScanConfig.getDefaultInstance() : scanConfig_; + } + } + /** + *
+     * The updated scan configuration.
+     * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder> + getScanConfigFieldBuilder() { + if (scanConfigBuilder_ == null) { + scanConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.containeranalysis.v1beta1.ScanConfig, com.google.containeranalysis.v1beta1.ScanConfig.Builder, com.google.containeranalysis.v1beta1.ScanConfigOrBuilder>( + getScanConfig(), + getParentForChildren(), + isClean()); + scanConfig_ = null; + } + return scanConfigBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest) + private static final com.google.containeranalysis.v1beta1.UpdateScanConfigRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.containeranalysis.v1beta1.UpdateScanConfigRequest(); + } + + public static com.google.containeranalysis.v1beta1.UpdateScanConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.containeranalysis.v1beta1.UpdateScanConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequestOrBuilder.java new file mode 100644 index 000000000000..46906291bc2e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/com/google/containeranalysis/v1beta1/UpdateScanConfigRequestOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/containeranalysis.proto + +package com.google.containeranalysis.v1beta1; + +public interface UpdateScanConfigRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.devtools.containeranalysis.v1beta1.UpdateScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the scan configuration in the form of
+   * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + boolean hasScanConfig(); + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + com.google.containeranalysis.v1beta1.ScanConfig getScanConfig(); + /** + *
+   * The updated scan configuration.
+   * 
+ * + * .google.devtools.containeranalysis.v1beta1.ScanConfig scan_config = 2; + */ + com.google.containeranalysis.v1beta1.ScanConfigOrBuilder getScanConfigOrBuilder(); +} 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 new file mode 100644 index 000000000000..232c65f42623 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequest.java @@ -0,0 +1,906 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to create notes in batch.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateNotesRequest} + */ +public final class BatchCreateNotesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.BatchCreateNotesRequest) + BatchCreateNotesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchCreateNotesRequest.newBuilder() to construct. + private BatchCreateNotesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchCreateNotesRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchCreateNotesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + notes_ = com.google.protobuf.MapField.newMapField( + NotesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + notes__ = input.readMessage( + NotesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + notes_.getMutableMap().put( + notes__.getKey(), notes__.getValue()); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetNotes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateNotesRequest.class, io.grafeas.v1beta1.BatchCreateNotesRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the notes are to be created.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the notes are to be created.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTES_FIELD_NUMBER = 2; + private static final class NotesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.grafeas.v1beta1.Note> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.grafeas.v1beta1.Note.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.String, io.grafeas.v1beta1.Note> notes_; + private com.google.protobuf.MapField + internalGetNotes() { + if (notes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NotesDefaultEntryHolder.defaultEntry); + } + return notes_; + } + + public int getNotesCount() { + return internalGetNotes().getMap().size(); + } + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public boolean containsNotes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetNotes().getMap().containsKey(key); + } + /** + * Use {@link #getNotesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getNotes() { + return getNotesMap(); + } + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public java.util.Map getNotesMap() { + return internalGetNotes().getMap(); + } + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public io.grafeas.v1beta1.Note getNotesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.Note defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetNotes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public io.grafeas.v1beta1.Note getNotesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetNotes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetNotes(), + NotesDefaultEntryHolder.defaultEntry, + 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + for (java.util.Map.Entry entry + : internalGetNotes().getMap().entrySet()) { + com.google.protobuf.MapEntry + notes__ = NotesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, notes__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.BatchCreateNotesRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.BatchCreateNotesRequest other = (io.grafeas.v1beta1.BatchCreateNotesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && internalGetNotes().equals( + other.internalGetNotes()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (!internalGetNotes().getMap().isEmpty()) { + hash = (37 * hash) + NOTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetNotes().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.BatchCreateNotesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to create notes in batch.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateNotesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.BatchCreateNotesRequest) + io.grafeas.v1beta1.BatchCreateNotesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetNotes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutableNotes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateNotesRequest.class, io.grafeas.v1beta1.BatchCreateNotesRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.BatchCreateNotesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + internalGetMutableNotes().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.BatchCreateNotesRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesRequest build() { + io.grafeas.v1beta1.BatchCreateNotesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.BatchCreateNotesRequest) { + return mergeFrom((io.grafeas.v1beta1.BatchCreateNotesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateNotesRequest other) { + if (other == io.grafeas.v1beta1.BatchCreateNotesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + internalGetMutableNotes().mergeFrom( + other.internalGetNotes()); + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.BatchCreateNotesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.BatchCreateNotesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the notes are to be created.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the notes are to be created.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the notes are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the notes are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the notes are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, io.grafeas.v1beta1.Note> notes_; + private com.google.protobuf.MapField + internalGetNotes() { + if (notes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + NotesDefaultEntryHolder.defaultEntry); + } + return notes_; + } + private com.google.protobuf.MapField + internalGetMutableNotes() { + onChanged();; + if (notes_ == null) { + notes_ = com.google.protobuf.MapField.newMapField( + NotesDefaultEntryHolder.defaultEntry); + } + if (!notes_.isMutable()) { + notes_ = notes_.copy(); + } + return notes_; + } + + public int getNotesCount() { + return internalGetNotes().getMap().size(); + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public boolean containsNotes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetNotes().getMap().containsKey(key); + } + /** + * Use {@link #getNotesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getNotes() { + return getNotesMap(); + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public java.util.Map getNotesMap() { + return internalGetNotes().getMap(); + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public io.grafeas.v1beta1.Note getNotesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.Note defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetNotes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public io.grafeas.v1beta1.Note getNotesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetNotes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearNotes() { + internalGetMutableNotes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public Builder removeNotes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableNotes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableNotes() { + return internalGetMutableNotes().getMutableMap(); + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + public Builder putNotes( + java.lang.String key, + io.grafeas.v1beta1.Note value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableNotes().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * The notes to create.
+     * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + public Builder putAllNotes( + java.util.Map values) { + internalGetMutableNotes().getMutableMap() + .putAll(values); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.BatchCreateNotesRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.BatchCreateNotesRequest) + private static final io.grafeas.v1beta1.BatchCreateNotesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.BatchCreateNotesRequest(); + } + + public static io.grafeas.v1beta1.BatchCreateNotesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateNotesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchCreateNotesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequestOrBuilder.java new file mode 100644 index 000000000000..e7abf025aebf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesRequestOrBuilder.java @@ -0,0 +1,83 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface BatchCreateNotesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.BatchCreateNotesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the notes are to be created.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the notes are to be created.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + int getNotesCount(); + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + boolean containsNotes( + java.lang.String key); + /** + * Use {@link #getNotesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getNotes(); + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + java.util.Map + getNotesMap(); + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + io.grafeas.v1beta1.Note getNotesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.Note defaultValue); + /** + *
+   * The notes to create.
+   * 
+ * + * map<string, .grafeas.v1beta1.Note> notes = 2; + */ + + io.grafeas.v1beta1.Note getNotesOrThrow( + java.lang.String key); +} 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 new file mode 100644 index 000000000000..04577b37f008 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponse.java @@ -0,0 +1,859 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Response for creating notes in batch.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateNotesResponse} + */ +public final class BatchCreateNotesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.BatchCreateNotesResponse) + BatchCreateNotesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchCreateNotesResponse.newBuilder() to construct. + private BatchCreateNotesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchCreateNotesResponse() { + notes_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchCreateNotesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + notes_.add( + input.readMessage(io.grafeas.v1beta1.Note.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = java.util.Collections.unmodifiableList(notes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateNotesResponse.class, io.grafeas.v1beta1.BatchCreateNotesResponse.Builder.class); + } + + public static final int NOTES_FIELD_NUMBER = 1; + private java.util.List notes_; + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List getNotesList() { + return notes_; + } + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesOrBuilderList() { + return notes_; + } + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public int getNotesCount() { + return notes_.size(); + } + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note getNotes(int index) { + return notes_.get(index); + } + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index) { + return notes_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < notes_.size(); i++) { + output.writeMessage(1, notes_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < notes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, notes_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.BatchCreateNotesResponse)) { + return super.equals(obj); + } + io.grafeas.v1beta1.BatchCreateNotesResponse other = (io.grafeas.v1beta1.BatchCreateNotesResponse) obj; + + boolean result = true; + result = result && getNotesList() + .equals(other.getNotesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNotesCount() > 0) { + hash = (37 * hash) + NOTES_FIELD_NUMBER; + hash = (53 * hash) + getNotesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateNotesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.BatchCreateNotesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for creating notes in batch.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateNotesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.BatchCreateNotesResponse) + io.grafeas.v1beta1.BatchCreateNotesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateNotesResponse.class, io.grafeas.v1beta1.BatchCreateNotesResponse.Builder.class); + } + + // Construct using io.grafeas.v1beta1.BatchCreateNotesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNotesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (notesBuilder_ == null) { + notes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + notesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesResponse getDefaultInstanceForType() { + return io.grafeas.v1beta1.BatchCreateNotesResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesResponse build() { + io.grafeas.v1beta1.BatchCreateNotesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesResponse buildPartial() { + io.grafeas.v1beta1.BatchCreateNotesResponse result = new io.grafeas.v1beta1.BatchCreateNotesResponse(this); + int from_bitField0_ = bitField0_; + if (notesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = java.util.Collections.unmodifiableList(notes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.notes_ = notes_; + } else { + result.notes_ = notesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.BatchCreateNotesResponse) { + return mergeFrom((io.grafeas.v1beta1.BatchCreateNotesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateNotesResponse other) { + if (other == io.grafeas.v1beta1.BatchCreateNotesResponse.getDefaultInstance()) return this; + if (notesBuilder_ == null) { + if (!other.notes_.isEmpty()) { + if (notes_.isEmpty()) { + notes_ = other.notes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNotesIsMutable(); + notes_.addAll(other.notes_); + } + onChanged(); + } + } else { + if (!other.notes_.isEmpty()) { + if (notesBuilder_.isEmpty()) { + notesBuilder_.dispose(); + notesBuilder_ = null; + notes_ = other.notes_; + bitField0_ = (bitField0_ & ~0x00000001); + notesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNotesFieldBuilder() : null; + } else { + notesBuilder_.addAllMessages(other.notes_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.BatchCreateNotesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.BatchCreateNotesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List notes_ = + java.util.Collections.emptyList(); + private void ensureNotesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = new java.util.ArrayList(notes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> notesBuilder_; + + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List getNotesList() { + if (notesBuilder_ == null) { + return java.util.Collections.unmodifiableList(notes_); + } else { + return notesBuilder_.getMessageList(); + } + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public int getNotesCount() { + if (notesBuilder_ == null) { + return notes_.size(); + } else { + return notesBuilder_.getCount(); + } + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note getNotes(int index) { + if (notesBuilder_ == null) { + return notes_.get(index); + } else { + return notesBuilder_.getMessage(index); + } + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder setNotes( + int index, io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.set(index, value); + onChanged(); + } else { + notesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder setNotes( + int index, io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.set(index, builderForValue.build()); + onChanged(); + } else { + notesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes(io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.add(value); + onChanged(); + } else { + notesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + int index, io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.add(index, value); + onChanged(); + } else { + notesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.add(builderForValue.build()); + onChanged(); + } else { + notesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + int index, io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.add(index, builderForValue.build()); + onChanged(); + } else { + notesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addAllNotes( + java.lang.Iterable values) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, notes_); + onChanged(); + } else { + notesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder clearNotes() { + if (notesBuilder_ == null) { + notes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + notesBuilder_.clear(); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder removeNotes(int index) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.remove(index); + onChanged(); + } else { + notesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder getNotesBuilder( + int index) { + return getNotesFieldBuilder().getBuilder(index); + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index) { + if (notesBuilder_ == null) { + return notes_.get(index); } else { + return notesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesOrBuilderList() { + if (notesBuilder_ != null) { + return notesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notes_); + } + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder addNotesBuilder() { + return getNotesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Note.getDefaultInstance()); + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder addNotesBuilder( + int index) { + return getNotesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Note.getDefaultInstance()); + } + /** + *
+     * The notes that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesBuilderList() { + return getNotesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> + getNotesFieldBuilder() { + if (notesBuilder_ == null) { + notesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder>( + notes_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + notes_ = null; + } + return notesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.BatchCreateNotesResponse) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.BatchCreateNotesResponse) + private static final io.grafeas.v1beta1.BatchCreateNotesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.BatchCreateNotesResponse(); + } + + public static io.grafeas.v1beta1.BatchCreateNotesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateNotesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchCreateNotesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateNotesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponseOrBuilder.java new file mode 100644 index 000000000000..9c413e0081f6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateNotesResponseOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface BatchCreateNotesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.BatchCreateNotesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + java.util.List + getNotesList(); + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + io.grafeas.v1beta1.Note getNotes(int index); + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + int getNotesCount(); + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + java.util.List + getNotesOrBuilderList(); + /** + *
+   * The notes that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..436f56d69be2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequest.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to create occurrences in batch.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateOccurrencesRequest} + */ +public final class BatchCreateOccurrencesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.BatchCreateOccurrencesRequest) + BatchCreateOccurrencesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchCreateOccurrencesRequest.newBuilder() to construct. + private BatchCreateOccurrencesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchCreateOccurrencesRequest() { + parent_ = ""; + occurrences_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchCreateOccurrencesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + occurrences_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + occurrences_.add( + input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateOccurrencesRequest.class, io.grafeas.v1beta1.BatchCreateOccurrencesRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrences are to be created.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrences are to be created.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OCCURRENCES_FIELD_NUMBER = 2; + private java.util.List occurrences_; + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public java.util.List getOccurrencesList() { + return occurrences_; + } + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public java.util.List + getOccurrencesOrBuilderList() { + return occurrences_; + } + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public int getOccurrencesCount() { + return occurrences_.size(); + } + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + return occurrences_.get(index); + } + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + return occurrences_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + for (int i = 0; i < occurrences_.size(); i++) { + output.writeMessage(2, occurrences_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + for (int i = 0; i < occurrences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, occurrences_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.BatchCreateOccurrencesRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.BatchCreateOccurrencesRequest other = (io.grafeas.v1beta1.BatchCreateOccurrencesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getOccurrencesList() + .equals(other.getOccurrencesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (getOccurrencesCount() > 0) { + hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; + hash = (53 * hash) + getOccurrencesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.BatchCreateOccurrencesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to create occurrences in batch.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateOccurrencesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.BatchCreateOccurrencesRequest) + io.grafeas.v1beta1.BatchCreateOccurrencesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateOccurrencesRequest.class, io.grafeas.v1beta1.BatchCreateOccurrencesRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.BatchCreateOccurrencesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOccurrencesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.BatchCreateOccurrencesRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesRequest build() { + io.grafeas.v1beta1.BatchCreateOccurrencesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000002)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.occurrences_ = occurrences_; + } else { + result.occurrences_ = occurrencesBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.BatchCreateOccurrencesRequest) { + return mergeFrom((io.grafeas.v1beta1.BatchCreateOccurrencesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateOccurrencesRequest other) { + if (other == io.grafeas.v1beta1.BatchCreateOccurrencesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (occurrencesBuilder_ == null) { + if (!other.occurrences_.isEmpty()) { + if (occurrences_.isEmpty()) { + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureOccurrencesIsMutable(); + occurrences_.addAll(other.occurrences_); + } + onChanged(); + } + } else { + if (!other.occurrences_.isEmpty()) { + if (occurrencesBuilder_.isEmpty()) { + occurrencesBuilder_.dispose(); + occurrencesBuilder_ = null; + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000002); + occurrencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOccurrencesFieldBuilder() : null; + } else { + occurrencesBuilder_.addAllMessages(other.occurrences_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.BatchCreateOccurrencesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.BatchCreateOccurrencesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrences are to be created.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrences are to be created.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrences are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrences are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrences are to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.util.List occurrences_ = + java.util.Collections.emptyList(); + private void ensureOccurrencesIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + occurrences_ = new java.util.ArrayList(occurrences_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrencesBuilder_; + + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public java.util.List getOccurrencesList() { + if (occurrencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(occurrences_); + } else { + return occurrencesBuilder_.getMessageList(); + } + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public int getOccurrencesCount() { + if (occurrencesBuilder_ == null) { + return occurrences_.size(); + } else { + return occurrencesBuilder_.getCount(); + } + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); + } else { + return occurrencesBuilder_.getMessage(index); + } + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.set(index, value); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.set(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder addOccurrences(io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(index, value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder addOccurrences( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder addAllOccurrences( + java.lang.Iterable values) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, occurrences_); + onChanged(); + } else { + occurrencesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder clearOccurrences() { + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public Builder removeOccurrences(int index) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.remove(index); + onChanged(); + } else { + occurrencesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().getBuilder(index); + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); } else { + return occurrencesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public java.util.List + getOccurrencesOrBuilderList() { + if (occurrencesBuilder_ != null) { + return occurrencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(occurrences_); + } + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder() { + return getOccurrencesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences to create.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + public java.util.List + getOccurrencesBuilderList() { + return getOccurrencesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrencesFieldBuilder() { + if (occurrencesBuilder_ == null) { + occurrencesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + occurrences_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + occurrences_ = null; + } + return occurrencesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.BatchCreateOccurrencesRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.BatchCreateOccurrencesRequest) + private static final io.grafeas.v1beta1.BatchCreateOccurrencesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.BatchCreateOccurrencesRequest(); + } + + public static io.grafeas.v1beta1.BatchCreateOccurrencesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateOccurrencesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchCreateOccurrencesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequestOrBuilder.java new file mode 100644 index 000000000000..5a21d7d6928a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesRequestOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface BatchCreateOccurrencesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.BatchCreateOccurrencesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrences are to be created.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrences are to be created.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + java.util.List + getOccurrencesList(); + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + io.grafeas.v1beta1.Occurrence getOccurrences(int index); + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + int getOccurrencesCount(); + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + java.util.List + getOccurrencesOrBuilderList(); + /** + *
+   * The occurrences to create.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 2; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..ee9475f11951 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponse.java @@ -0,0 +1,859 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Response for creating occurrences in batch.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateOccurrencesResponse} + */ +public final class BatchCreateOccurrencesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.BatchCreateOccurrencesResponse) + BatchCreateOccurrencesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchCreateOccurrencesResponse.newBuilder() to construct. + private BatchCreateOccurrencesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BatchCreateOccurrencesResponse() { + occurrences_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchCreateOccurrencesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + occurrences_.add( + input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateOccurrencesResponse.class, io.grafeas.v1beta1.BatchCreateOccurrencesResponse.Builder.class); + } + + public static final int OCCURRENCES_FIELD_NUMBER = 1; + private java.util.List occurrences_; + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + return occurrences_; + } + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + return occurrences_; + } + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + return occurrences_.size(); + } + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + return occurrences_.get(index); + } + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + return occurrences_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < occurrences_.size(); i++) { + output.writeMessage(1, occurrences_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < occurrences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, occurrences_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.BatchCreateOccurrencesResponse)) { + return super.equals(obj); + } + io.grafeas.v1beta1.BatchCreateOccurrencesResponse other = (io.grafeas.v1beta1.BatchCreateOccurrencesResponse) obj; + + boolean result = true; + result = result && getOccurrencesList() + .equals(other.getOccurrencesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOccurrencesCount() > 0) { + hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; + hash = (53 * hash) + getOccurrencesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.BatchCreateOccurrencesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for creating occurrences in batch.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.BatchCreateOccurrencesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.BatchCreateOccurrencesResponse) + io.grafeas.v1beta1.BatchCreateOccurrencesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.BatchCreateOccurrencesResponse.class, io.grafeas.v1beta1.BatchCreateOccurrencesResponse.Builder.class); + } + + // Construct using io.grafeas.v1beta1.BatchCreateOccurrencesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOccurrencesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesResponse getDefaultInstanceForType() { + return io.grafeas.v1beta1.BatchCreateOccurrencesResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesResponse build() { + io.grafeas.v1beta1.BatchCreateOccurrencesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesResponse buildPartial() { + io.grafeas.v1beta1.BatchCreateOccurrencesResponse result = new io.grafeas.v1beta1.BatchCreateOccurrencesResponse(this); + int from_bitField0_ = bitField0_; + if (occurrencesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.occurrences_ = occurrences_; + } else { + result.occurrences_ = occurrencesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.BatchCreateOccurrencesResponse) { + return mergeFrom((io.grafeas.v1beta1.BatchCreateOccurrencesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.BatchCreateOccurrencesResponse other) { + if (other == io.grafeas.v1beta1.BatchCreateOccurrencesResponse.getDefaultInstance()) return this; + if (occurrencesBuilder_ == null) { + if (!other.occurrences_.isEmpty()) { + if (occurrences_.isEmpty()) { + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOccurrencesIsMutable(); + occurrences_.addAll(other.occurrences_); + } + onChanged(); + } + } else { + if (!other.occurrences_.isEmpty()) { + if (occurrencesBuilder_.isEmpty()) { + occurrencesBuilder_.dispose(); + occurrencesBuilder_ = null; + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + occurrencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOccurrencesFieldBuilder() : null; + } else { + occurrencesBuilder_.addAllMessages(other.occurrences_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.BatchCreateOccurrencesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.BatchCreateOccurrencesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List occurrences_ = + java.util.Collections.emptyList(); + private void ensureOccurrencesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(occurrences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrencesBuilder_; + + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + if (occurrencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(occurrences_); + } else { + return occurrencesBuilder_.getMessageList(); + } + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + if (occurrencesBuilder_ == null) { + return occurrences_.size(); + } else { + return occurrencesBuilder_.getCount(); + } + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); + } else { + return occurrencesBuilder_.getMessage(index); + } + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.set(index, value); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.set(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences(io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(index, value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addAllOccurrences( + java.lang.Iterable values) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, occurrences_); + onChanged(); + } else { + occurrencesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder clearOccurrences() { + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder removeOccurrences(int index) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.remove(index); + onChanged(); + } else { + occurrencesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().getBuilder(index); + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); } else { + return occurrencesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + if (occurrencesBuilder_ != null) { + return occurrencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(occurrences_); + } + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder() { + return getOccurrencesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences that were created.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesBuilderList() { + return getOccurrencesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrencesFieldBuilder() { + if (occurrencesBuilder_ == null) { + occurrencesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + occurrences_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + occurrences_ = null; + } + return occurrencesBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.BatchCreateOccurrencesResponse) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.BatchCreateOccurrencesResponse) + private static final io.grafeas.v1beta1.BatchCreateOccurrencesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.BatchCreateOccurrencesResponse(); + } + + public static io.grafeas.v1beta1.BatchCreateOccurrencesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BatchCreateOccurrencesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BatchCreateOccurrencesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.BatchCreateOccurrencesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponseOrBuilder.java new file mode 100644 index 000000000000..93e7eb66cb51 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/BatchCreateOccurrencesResponseOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface BatchCreateOccurrencesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.BatchCreateOccurrencesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesList(); + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.Occurrence getOccurrences(int index); + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + int getOccurrencesCount(); + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesOrBuilderList(); + /** + *
+   * The occurrences that were created.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..d4d73f5da2e1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequest.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to create a new note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.CreateNoteRequest} + */ +public final class CreateNoteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.CreateNoteRequest) + CreateNoteRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateNoteRequest.newBuilder() to construct. + private CreateNoteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateNoteRequest() { + parent_ = ""; + noteId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateNoteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + noteId_ = s; + break; + } + case 26: { + io.grafeas.v1beta1.Note.Builder subBuilder = null; + if (note_ != null) { + subBuilder = note_.toBuilder(); + } + note_ = input.readMessage(io.grafeas.v1beta1.Note.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(note_); + note_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.CreateNoteRequest.class, io.grafeas.v1beta1.CreateNoteRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the note is to be created.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the note is to be created.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object noteId_; + /** + *
+   * The ID to use for this note.
+   * 
+ * + * string note_id = 2; + */ + public java.lang.String getNoteId() { + java.lang.Object ref = noteId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + noteId_ = s; + return s; + } + } + /** + *
+   * The ID to use for this note.
+   * 
+ * + * string note_id = 2; + */ + public com.google.protobuf.ByteString + getNoteIdBytes() { + java.lang.Object ref = noteId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + noteId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.Note note_; + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public boolean hasNote() { + return note_ != null; + } + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public io.grafeas.v1beta1.Note getNote() { + return note_ == null ? io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { + return getNote(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getNoteIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, noteId_); + } + if (note_ != null) { + output.writeMessage(3, getNote()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getNoteIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, noteId_); + } + if (note_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getNote()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.CreateNoteRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.CreateNoteRequest other = (io.grafeas.v1beta1.CreateNoteRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getNoteId() + .equals(other.getNoteId()); + result = result && (hasNote() == other.hasNote()); + if (hasNote()) { + result = result && getNote() + .equals(other.getNote()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + NOTE_ID_FIELD_NUMBER; + hash = (53 * hash) + getNoteId().hashCode(); + if (hasNote()) { + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.CreateNoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to create a new note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.CreateNoteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.CreateNoteRequest) + io.grafeas.v1beta1.CreateNoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.CreateNoteRequest.class, io.grafeas.v1beta1.CreateNoteRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.CreateNoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + noteId_ = ""; + + if (noteBuilder_ == null) { + note_ = null; + } else { + note_ = null; + noteBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateNoteRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.CreateNoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateNoteRequest build() { + io.grafeas.v1beta1.CreateNoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateNoteRequest buildPartial() { + io.grafeas.v1beta1.CreateNoteRequest result = new io.grafeas.v1beta1.CreateNoteRequest(this); + result.parent_ = parent_; + result.noteId_ = noteId_; + if (noteBuilder_ == null) { + result.note_ = note_; + } else { + result.note_ = noteBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.CreateNoteRequest) { + return mergeFrom((io.grafeas.v1beta1.CreateNoteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.CreateNoteRequest other) { + if (other == io.grafeas.v1beta1.CreateNoteRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getNoteId().isEmpty()) { + noteId_ = other.noteId_; + onChanged(); + } + if (other.hasNote()) { + mergeNote(other.getNote()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.CreateNoteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.CreateNoteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the note is to be created.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the note is to be created.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the note is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the note is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the note is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object noteId_ = ""; + /** + *
+     * The ID to use for this note.
+     * 
+ * + * string note_id = 2; + */ + public java.lang.String getNoteId() { + java.lang.Object ref = noteId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + noteId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The ID to use for this note.
+     * 
+ * + * string note_id = 2; + */ + public com.google.protobuf.ByteString + getNoteIdBytes() { + java.lang.Object ref = noteId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + noteId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The ID to use for this note.
+     * 
+ * + * string note_id = 2; + */ + public Builder setNoteId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + noteId_ = value; + onChanged(); + return this; + } + /** + *
+     * The ID to use for this note.
+     * 
+ * + * string note_id = 2; + */ + public Builder clearNoteId() { + + noteId_ = getDefaultInstance().getNoteId(); + onChanged(); + return this; + } + /** + *
+     * The ID to use for this note.
+     * 
+ * + * string note_id = 2; + */ + public Builder setNoteIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + noteId_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.Note note_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> noteBuilder_; + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public boolean hasNote() { + return noteBuilder_ != null || note_ != null; + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public io.grafeas.v1beta1.Note getNote() { + if (noteBuilder_ == null) { + return note_ == null ? io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } else { + return noteBuilder_.getMessage(); + } + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public Builder setNote(io.grafeas.v1beta1.Note value) { + if (noteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + note_ = value; + onChanged(); + } else { + noteBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public Builder setNote( + io.grafeas.v1beta1.Note.Builder builderForValue) { + if (noteBuilder_ == null) { + note_ = builderForValue.build(); + onChanged(); + } else { + noteBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public Builder mergeNote(io.grafeas.v1beta1.Note value) { + if (noteBuilder_ == null) { + if (note_ != null) { + note_ = + io.grafeas.v1beta1.Note.newBuilder(note_).mergeFrom(value).buildPartial(); + } else { + note_ = value; + } + onChanged(); + } else { + noteBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public Builder clearNote() { + if (noteBuilder_ == null) { + note_ = null; + onChanged(); + } else { + note_ = null; + noteBuilder_ = null; + } + + return this; + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public io.grafeas.v1beta1.Note.Builder getNoteBuilder() { + + onChanged(); + return getNoteFieldBuilder().getBuilder(); + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { + if (noteBuilder_ != null) { + return noteBuilder_.getMessageOrBuilder(); + } else { + return note_ == null ? + io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } + } + /** + *
+     * The note to create.
+     * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> + getNoteFieldBuilder() { + if (noteBuilder_ == null) { + noteBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder>( + getNote(), + getParentForChildren(), + isClean()); + note_ = null; + } + return noteBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.CreateNoteRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.CreateNoteRequest) + private static final io.grafeas.v1beta1.CreateNoteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.CreateNoteRequest(); + } + + public static io.grafeas.v1beta1.CreateNoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateNoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateNoteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateNoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequestOrBuilder.java new file mode 100644 index 000000000000..4ee262741db9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateNoteRequestOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface CreateNoteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.CreateNoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the note is to be created.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the note is to be created.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The ID to use for this note.
+   * 
+ * + * string note_id = 2; + */ + java.lang.String getNoteId(); + /** + *
+   * The ID to use for this note.
+   * 
+ * + * string note_id = 2; + */ + com.google.protobuf.ByteString + getNoteIdBytes(); + + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + boolean hasNote(); + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + io.grafeas.v1beta1.Note getNote(); + /** + *
+   * The note to create.
+   * 
+ * + * .grafeas.v1beta1.Note note = 3; + */ + io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder(); +} 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 new file mode 100644 index 000000000000..988a5be97482 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequest.java @@ -0,0 +1,813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to create a new occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.CreateOccurrenceRequest} + */ +public final class CreateOccurrenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.CreateOccurrenceRequest) + CreateOccurrenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateOccurrenceRequest.newBuilder() to construct. + private CreateOccurrenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateOccurrenceRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateOccurrenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.Occurrence.Builder subBuilder = null; + if (occurrence_ != null) { + subBuilder = occurrence_.toBuilder(); + } + occurrence_ = input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(occurrence_); + occurrence_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.CreateOccurrenceRequest.class, io.grafeas.v1beta1.CreateOccurrenceRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrence is to be created.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrence is to be created.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OCCURRENCE_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.Occurrence occurrence_; + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public boolean hasOccurrence() { + return occurrence_ != null; + } + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrence() { + return occurrence_ == null ? io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { + return getOccurrence(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (occurrence_ != null) { + output.writeMessage(2, getOccurrence()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (occurrence_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getOccurrence()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.CreateOccurrenceRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.CreateOccurrenceRequest other = (io.grafeas.v1beta1.CreateOccurrenceRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasOccurrence() == other.hasOccurrence()); + if (hasOccurrence()) { + result = result && getOccurrence() + .equals(other.getOccurrence()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasOccurrence()) { + hash = (37 * hash) + OCCURRENCE_FIELD_NUMBER; + hash = (53 * hash) + getOccurrence().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.CreateOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.CreateOccurrenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to create a new occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.CreateOccurrenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.CreateOccurrenceRequest) + io.grafeas.v1beta1.CreateOccurrenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.CreateOccurrenceRequest.class, io.grafeas.v1beta1.CreateOccurrenceRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.CreateOccurrenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (occurrenceBuilder_ == null) { + occurrence_ = null; + } else { + occurrence_ = null; + occurrenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateOccurrenceRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.CreateOccurrenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateOccurrenceRequest build() { + io.grafeas.v1beta1.CreateOccurrenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateOccurrenceRequest buildPartial() { + io.grafeas.v1beta1.CreateOccurrenceRequest result = new io.grafeas.v1beta1.CreateOccurrenceRequest(this); + result.parent_ = parent_; + if (occurrenceBuilder_ == null) { + result.occurrence_ = occurrence_; + } else { + result.occurrence_ = occurrenceBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.CreateOccurrenceRequest) { + return mergeFrom((io.grafeas.v1beta1.CreateOccurrenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.CreateOccurrenceRequest other) { + if (other == io.grafeas.v1beta1.CreateOccurrenceRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasOccurrence()) { + mergeOccurrence(other.getOccurrence()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.CreateOccurrenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.CreateOccurrenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrence is to be created.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrence is to be created.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrence is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrence is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+     * the occurrence is to be created.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.Occurrence occurrence_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrenceBuilder_; + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public boolean hasOccurrence() { + return occurrenceBuilder_ != null || occurrence_ != null; + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrence() { + if (occurrenceBuilder_ == null) { + return occurrence_ == null ? io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } else { + return occurrenceBuilder_.getMessage(); + } + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder setOccurrence(io.grafeas.v1beta1.Occurrence value) { + if (occurrenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + occurrence_ = value; + onChanged(); + } else { + occurrenceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder setOccurrence( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrenceBuilder_ == null) { + occurrence_ = builderForValue.build(); + onChanged(); + } else { + occurrenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder mergeOccurrence(io.grafeas.v1beta1.Occurrence value) { + if (occurrenceBuilder_ == null) { + if (occurrence_ != null) { + occurrence_ = + io.grafeas.v1beta1.Occurrence.newBuilder(occurrence_).mergeFrom(value).buildPartial(); + } else { + occurrence_ = value; + } + onChanged(); + } else { + occurrenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder clearOccurrence() { + if (occurrenceBuilder_ == null) { + occurrence_ = null; + onChanged(); + } else { + occurrence_ = null; + occurrenceBuilder_ = null; + } + + return this; + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrenceBuilder() { + + onChanged(); + return getOccurrenceFieldBuilder().getBuilder(); + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { + if (occurrenceBuilder_ != null) { + return occurrenceBuilder_.getMessageOrBuilder(); + } else { + return occurrence_ == null ? + io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } + } + /** + *
+     * The occurrence to create.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrenceFieldBuilder() { + if (occurrenceBuilder_ == null) { + occurrenceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + getOccurrence(), + getParentForChildren(), + isClean()); + occurrence_ = null; + } + return occurrenceBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.CreateOccurrenceRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.CreateOccurrenceRequest) + private static final io.grafeas.v1beta1.CreateOccurrenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.CreateOccurrenceRequest(); + } + + public static io.grafeas.v1beta1.CreateOccurrenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateOccurrenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateOccurrenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.CreateOccurrenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequestOrBuilder.java new file mode 100644 index 000000000000..3deb7b45aa57 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/CreateOccurrenceRequestOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface CreateOccurrenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.CreateOccurrenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrence is to be created.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project in the form of `projects/[PROJECT_ID]`, under which
+   * the occurrence is to be created.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + boolean hasOccurrence(); + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + io.grafeas.v1beta1.Occurrence getOccurrence(); + /** + *
+   * The occurrence to create.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder(); +} 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 new file mode 100644 index 000000000000..e574be1a2de0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to delete a note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.DeleteNoteRequest} + */ +public final class DeleteNoteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.DeleteNoteRequest) + DeleteNoteRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteNoteRequest.newBuilder() to construct. + private DeleteNoteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteNoteRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteNoteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.DeleteNoteRequest.class, io.grafeas.v1beta1.DeleteNoteRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.DeleteNoteRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.DeleteNoteRequest other = (io.grafeas.v1beta1.DeleteNoteRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.DeleteNoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to delete a note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.DeleteNoteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.DeleteNoteRequest) + io.grafeas.v1beta1.DeleteNoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.DeleteNoteRequest.class, io.grafeas.v1beta1.DeleteNoteRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.DeleteNoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteNoteRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteNoteRequest build() { + io.grafeas.v1beta1.DeleteNoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteNoteRequest buildPartial() { + io.grafeas.v1beta1.DeleteNoteRequest result = new io.grafeas.v1beta1.DeleteNoteRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.DeleteNoteRequest) { + return mergeFrom((io.grafeas.v1beta1.DeleteNoteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.DeleteNoteRequest other) { + if (other == io.grafeas.v1beta1.DeleteNoteRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.DeleteNoteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.DeleteNoteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.DeleteNoteRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.DeleteNoteRequest) + private static final io.grafeas.v1beta1.DeleteNoteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.DeleteNoteRequest(); + } + + public static io.grafeas.v1beta1.DeleteNoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteNoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteNoteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteNoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequestOrBuilder.java new file mode 100644 index 000000000000..887aef4eb1a8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteNoteRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface DeleteNoteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.DeleteNoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..f2897f51f191 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to delete a occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.DeleteOccurrenceRequest} + */ +public final class DeleteOccurrenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.DeleteOccurrenceRequest) + DeleteOccurrenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteOccurrenceRequest.newBuilder() to construct. + private DeleteOccurrenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteOccurrenceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteOccurrenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.DeleteOccurrenceRequest.class, io.grafeas.v1beta1.DeleteOccurrenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.DeleteOccurrenceRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.DeleteOccurrenceRequest other = (io.grafeas.v1beta1.DeleteOccurrenceRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.DeleteOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.DeleteOccurrenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to delete a occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.DeleteOccurrenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.DeleteOccurrenceRequest) + io.grafeas.v1beta1.DeleteOccurrenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.DeleteOccurrenceRequest.class, io.grafeas.v1beta1.DeleteOccurrenceRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.DeleteOccurrenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteOccurrenceRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.DeleteOccurrenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteOccurrenceRequest build() { + io.grafeas.v1beta1.DeleteOccurrenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteOccurrenceRequest buildPartial() { + io.grafeas.v1beta1.DeleteOccurrenceRequest result = new io.grafeas.v1beta1.DeleteOccurrenceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.DeleteOccurrenceRequest) { + return mergeFrom((io.grafeas.v1beta1.DeleteOccurrenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.DeleteOccurrenceRequest other) { + if (other == io.grafeas.v1beta1.DeleteOccurrenceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.DeleteOccurrenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.DeleteOccurrenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.DeleteOccurrenceRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.DeleteOccurrenceRequest) + private static final io.grafeas.v1beta1.DeleteOccurrenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.DeleteOccurrenceRequest(); + } + + public static io.grafeas.v1beta1.DeleteOccurrenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteOccurrenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteOccurrenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.DeleteOccurrenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequestOrBuilder.java new file mode 100644 index 000000000000..268ab8cb41a3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/DeleteOccurrenceRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface DeleteOccurrenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.DeleteOccurrenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..6e5ab75e376c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to get a note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetNoteRequest} + */ +public final class GetNoteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.GetNoteRequest) + GetNoteRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetNoteRequest.newBuilder() to construct. + private GetNoteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetNoteRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetNoteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetNoteRequest.class, io.grafeas.v1beta1.GetNoteRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.GetNoteRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.GetNoteRequest other = (io.grafeas.v1beta1.GetNoteRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetNoteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetNoteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.GetNoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to get a note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetNoteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.GetNoteRequest) + io.grafeas.v1beta1.GetNoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetNoteRequest.class, io.grafeas.v1beta1.GetNoteRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.GetNoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetNoteRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetNoteRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.GetNoteRequest build() { + io.grafeas.v1beta1.GetNoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetNoteRequest buildPartial() { + io.grafeas.v1beta1.GetNoteRequest result = new io.grafeas.v1beta1.GetNoteRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.GetNoteRequest) { + return mergeFrom((io.grafeas.v1beta1.GetNoteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.GetNoteRequest other) { + if (other == io.grafeas.v1beta1.GetNoteRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.GetNoteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.GetNoteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.GetNoteRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.GetNoteRequest) + private static final io.grafeas.v1beta1.GetNoteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.GetNoteRequest(); + } + + public static io.grafeas.v1beta1.GetNoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNoteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetNoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequestOrBuilder.java new file mode 100644 index 000000000000..e3b2db85ef2d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetNoteRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface GetNoteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.GetNoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..bfbdbec373ac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to get the note to which the specified occurrence is attached.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetOccurrenceNoteRequest} + */ +public final class GetOccurrenceNoteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.GetOccurrenceNoteRequest) + GetOccurrenceNoteRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetOccurrenceNoteRequest.newBuilder() to construct. + private GetOccurrenceNoteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetOccurrenceNoteRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetOccurrenceNoteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetOccurrenceNoteRequest.class, io.grafeas.v1beta1.GetOccurrenceNoteRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.GetOccurrenceNoteRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.GetOccurrenceNoteRequest other = (io.grafeas.v1beta1.GetOccurrenceNoteRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.GetOccurrenceNoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to get the note to which the specified occurrence is attached.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetOccurrenceNoteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.GetOccurrenceNoteRequest) + io.grafeas.v1beta1.GetOccurrenceNoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetOccurrenceNoteRequest.class, io.grafeas.v1beta1.GetOccurrenceNoteRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.GetOccurrenceNoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceNoteRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.GetOccurrenceNoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceNoteRequest build() { + io.grafeas.v1beta1.GetOccurrenceNoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceNoteRequest buildPartial() { + io.grafeas.v1beta1.GetOccurrenceNoteRequest result = new io.grafeas.v1beta1.GetOccurrenceNoteRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.GetOccurrenceNoteRequest) { + return mergeFrom((io.grafeas.v1beta1.GetOccurrenceNoteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.GetOccurrenceNoteRequest other) { + if (other == io.grafeas.v1beta1.GetOccurrenceNoteRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.GetOccurrenceNoteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.GetOccurrenceNoteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.GetOccurrenceNoteRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.GetOccurrenceNoteRequest) + private static final io.grafeas.v1beta1.GetOccurrenceNoteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.GetOccurrenceNoteRequest(); + } + + public static io.grafeas.v1beta1.GetOccurrenceNoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOccurrenceNoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOccurrenceNoteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceNoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequestOrBuilder.java new file mode 100644 index 000000000000..4780d761ca84 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceNoteRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface GetOccurrenceNoteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.GetOccurrenceNoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..097c9569c8ca --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequest.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to get an occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetOccurrenceRequest} + */ +public final class GetOccurrenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.GetOccurrenceRequest) + GetOccurrenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetOccurrenceRequest.newBuilder() to construct. + private GetOccurrenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetOccurrenceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetOccurrenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetOccurrenceRequest.class, io.grafeas.v1beta1.GetOccurrenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.GetOccurrenceRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.GetOccurrenceRequest other = (io.grafeas.v1beta1.GetOccurrenceRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.GetOccurrenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to get an occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetOccurrenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.GetOccurrenceRequest) + io.grafeas.v1beta1.GetOccurrenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetOccurrenceRequest.class, io.grafeas.v1beta1.GetOccurrenceRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.GetOccurrenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.GetOccurrenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceRequest build() { + io.grafeas.v1beta1.GetOccurrenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceRequest buildPartial() { + io.grafeas.v1beta1.GetOccurrenceRequest result = new io.grafeas.v1beta1.GetOccurrenceRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.GetOccurrenceRequest) { + return mergeFrom((io.grafeas.v1beta1.GetOccurrenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.GetOccurrenceRequest other) { + if (other == io.grafeas.v1beta1.GetOccurrenceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.GetOccurrenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.GetOccurrenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.GetOccurrenceRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.GetOccurrenceRequest) + private static final io.grafeas.v1beta1.GetOccurrenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.GetOccurrenceRequest(); + } + + public static io.grafeas.v1beta1.GetOccurrenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetOccurrenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetOccurrenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetOccurrenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequestOrBuilder.java new file mode 100644 index 000000000000..3c85ed1bf78f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetOccurrenceRequestOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface GetOccurrenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.GetOccurrenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..524cf238af8f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequest.java @@ -0,0 +1,739 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to get a vulnerability summary for some set of occurrences.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest} + */ +public final class GetVulnerabilityOccurrencesSummaryRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) + GetVulnerabilityOccurrencesSummaryRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetVulnerabilityOccurrencesSummaryRequest.newBuilder() to construct. + private GetVulnerabilityOccurrencesSummaryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetVulnerabilityOccurrencesSummaryRequest() { + parent_ = ""; + filter_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetVulnerabilityOccurrencesSummaryRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.class, io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project to get a vulnerability summary for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project to get a vulnerability summary for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest other = (io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to get a vulnerability summary for some set of occurrences.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.class, io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest build() { + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest buildPartial() { + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest result = new io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) { + return mergeFrom((io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest other) { + if (other == io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project to get a vulnerability summary for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project to get a vulnerability summary for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project to get a vulnerability summary for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project to get a vulnerability summary for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project to get a vulnerability summary for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) + private static final io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest(); + } + + public static io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetVulnerabilityOccurrencesSummaryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetVulnerabilityOccurrencesSummaryRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequestOrBuilder.java new file mode 100644 index 000000000000..1f563e03b38a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/GetVulnerabilityOccurrencesSummaryRequestOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface GetVulnerabilityOccurrencesSummaryRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project to get a vulnerability summary for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project to get a vulnerability summary for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); +} 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 new file mode 100644 index 000000000000..9d3408ae88a7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Grafeas.java @@ -0,0 +1,528 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public final class Grafeas { + private Grafeas() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_Occurrence_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_Occurrence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_Resource_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_Resource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_Note_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_Note_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_GetOccurrenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListOccurrencesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListOccurrencesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_CreateOccurrenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_GetNoteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_GetNoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListNotesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListNotesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListNotesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListNotesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_DeleteNoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_CreateNoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_UpdateNoteRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_BatchCreateNotesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n?google/devtools/containeranalysis/v1be" + + "ta1/grafeas/grafeas.proto\022\017grafeas.v1bet" + + "a1\032\034google/api/annotations.proto\032Ggoogle" + + "/devtools/containeranalysis/v1beta1/atte" + + "station/attestation.proto\032;google/devtoo" + + "ls/containeranalysis/v1beta1/build/build" + + ".proto\032=google/devtools/containeranalysi" + + "s/v1beta1/common/common.proto\032Egoogle/de" + + "vtools/containeranalysis/v1beta1/deploym" + + "ent/deployment.proto\032Cgoogle/devtools/co" + + "ntaineranalysis/v1beta1/discovery/discov" + + "ery.proto\032;google/devtools/containeranal" + + "ysis/v1beta1/image/image.proto\032?google/d" + + "evtools/containeranalysis/v1beta1/packag" + + "e/package.proto\032Egoogle/devtools/contain" + + "eranalysis/v1beta1/provenance/provenance" + + ".proto\032Kgoogle/devtools/containeranalysi" + + "s/v1beta1/vulnerability/vulnerability.pr" + + "oto\032\033google/protobuf/empty.proto\032 google" + + "/protobuf/field_mask.proto\032\037google/proto" + + "buf/timestamp.proto\"\234\005\n\nOccurrence\022\014\n\004na" + + "me\030\001 \001(\t\022+\n\010resource\030\002 \001(\0132\031.grafeas.v1b" + + "eta1.Resource\022\021\n\tnote_name\030\003 \001(\t\022\'\n\004kind" + + "\030\004 \001(\0162\031.grafeas.v1beta1.NoteKind\022\023\n\013rem" + + "ediation\030\005 \001(\t\022/\n\013create_time\030\006 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022/\n\013update_time\030\007" + + " \001(\0132\032.google.protobuf.Timestamp\022?\n\rvuln" + + "erability\030\010 \001(\0132&.grafeas.v1beta1.vulner" + + "ability.DetailsH\000\022/\n\005build\030\t \001(\0132\036.grafe" + + "as.v1beta1.build.DetailsH\000\0227\n\rderived_im" + + "age\030\n \001(\0132\036.grafeas.v1beta1.image.Detail" + + "sH\000\0228\n\014installation\030\013 \001(\0132 .grafeas.v1be" + + "ta1.package.DetailsH\000\0229\n\ndeployment\030\014 \001(" + + "\0132#.grafeas.v1beta1.deployment.DetailsH\000" + + "\0228\n\ndiscovered\030\r \001(\0132\".grafeas.v1beta1.d" + + "iscovery.DetailsH\000\022;\n\013attestation\030\016 \001(\0132" + + "$.grafeas.v1beta1.attestation.DetailsH\000B" + + "\t\n\007details\"]\n\010Resource\022\014\n\004name\030\001 \001(\t\022\013\n\003" + + "uri\030\002 \001(\t\0226\n\014content_hash\030\003 \001(\0132 .grafea" + + "s.v1beta1.provenance.Hash\"\200\006\n\004Note\022\014\n\004na" + + "me\030\001 \001(\t\022\031\n\021short_description\030\002 \001(\t\022\030\n\020l" + + "ong_description\030\003 \001(\t\022\'\n\004kind\030\004 \001(\0162\031.gr" + + "afeas.v1beta1.NoteKind\0220\n\013related_url\030\005 " + + "\003(\0132\033.grafeas.v1beta1.RelatedUrl\0223\n\017expi" + + "ration_time\030\006 \001(\0132\032.google.protobuf.Time" + + "stamp\022/\n\013create_time\030\007 \001(\0132\032.google.prot" + + "obuf.Timestamp\022/\n\013update_time\030\010 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022\032\n\022related_note_" + + "names\030\t \003(\t\022E\n\rvulnerability\030\n \001(\0132,.gra" + + "feas.v1beta1.vulnerability.Vulnerability" + + "H\000\022-\n\005build\030\013 \001(\0132\034.grafeas.v1beta1.buil" + + "d.BuildH\000\0222\n\nbase_image\030\014 \001(\0132\034.grafeas." + + "v1beta1.image.BasisH\000\0223\n\007package\030\r \001(\0132 " + + ".grafeas.v1beta1.package.PackageH\000\022<\n\nde" + + "ployable\030\016 \001(\0132&.grafeas.v1beta1.deploym" + + "ent.DeployableH\000\0229\n\tdiscovery\030\017 \001(\0132$.gr" + + "afeas.v1beta1.discovery.DiscoveryH\000\022G\n\025a" + + "ttestation_authority\030\020 \001(\0132&.grafeas.v1b" + + "eta1.attestation.AuthorityH\000B\006\n\004type\"$\n\024" + + "GetOccurrenceRequest\022\014\n\004name\030\001 \001(\t\"_\n\026Li" + + "stOccurrencesRequest\022\016\n\006parent\030\001 \001(\t\022\016\n\006" + + "filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_" + + "token\030\004 \001(\t\"d\n\027ListOccurrencesResponse\0220" + + "\n\013occurrences\030\001 \003(\0132\033.grafeas.v1beta1.Oc" + + "currence\022\027\n\017next_page_token\030\002 \001(\t\"\'\n\027Del" + + "eteOccurrenceRequest\022\014\n\004name\030\001 \001(\t\"Z\n\027Cr" + + "eateOccurrenceRequest\022\016\n\006parent\030\001 \001(\t\022/\n" + + "\noccurrence\030\002 \001(\0132\033.grafeas.v1beta1.Occu" + + "rrence\"\211\001\n\027UpdateOccurrenceRequest\022\014\n\004na" + + "me\030\001 \001(\t\022/\n\noccurrence\030\002 \001(\0132\033.grafeas.v" + + "1beta1.Occurrence\022/\n\013update_mask\030\003 \001(\0132\032" + + ".google.protobuf.FieldMask\"\036\n\016GetNoteReq" + + "uest\022\014\n\004name\030\001 \001(\t\"(\n\030GetOccurrenceNoteR" + + "equest\022\014\n\004name\030\001 \001(\t\"Y\n\020ListNotesRequest" + + "\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage" + + "_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"R\n\021ListN" + + "otesResponse\022$\n\005notes\030\001 \003(\0132\025.grafeas.v1" + + "beta1.Note\022\027\n\017next_page_token\030\002 \001(\t\"!\n\021D" + + "eleteNoteRequest\022\014\n\004name\030\001 \001(\t\"Y\n\021Create" + + "NoteRequest\022\016\n\006parent\030\001 \001(\t\022\017\n\007note_id\030\002" + + " \001(\t\022#\n\004note\030\003 \001(\0132\025.grafeas.v1beta1.Not" + + "e\"w\n\021UpdateNoteRequest\022\014\n\004name\030\001 \001(\t\022#\n\004" + + "note\030\002 \001(\0132\025.grafeas.v1beta1.Note\022/\n\013upd" + + "ate_mask\030\003 \001(\0132\032.google.protobuf.FieldMa" + + "sk\"a\n\032ListNoteOccurrencesRequest\022\014\n\004name" + + "\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(" + + "\005\022\022\n\npage_token\030\004 \001(\t\"h\n\033ListNoteOccurre" + + "ncesResponse\0220\n\013occurrences\030\001 \003(\0132\033.graf" + + "eas.v1beta1.Occurrence\022\027\n\017next_page_toke" + + "n\030\002 \001(\t\"\262\001\n\027BatchCreateNotesRequest\022\016\n\006p" + + "arent\030\001 \001(\t\022B\n\005notes\030\002 \003(\01323.grafeas.v1b" + + "eta1.BatchCreateNotesRequest.NotesEntry\032" + + "C\n\nNotesEntry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(" + + "\0132\025.grafeas.v1beta1.Note:\0028\001\"@\n\030BatchCre" + + "ateNotesResponse\022$\n\005notes\030\001 \003(\0132\025.grafea" + + "s.v1beta1.Note\"a\n\035BatchCreateOccurrences" + + "Request\022\016\n\006parent\030\001 \001(\t\0220\n\013occurrences\030\002" + + " \003(\0132\033.grafeas.v1beta1.Occurrence\"R\n\036Bat" + + "chCreateOccurrencesResponse\0220\n\013occurrenc" + + "es\030\001 \003(\0132\033.grafeas.v1beta1.Occurrence\"K\n" + + ")GetVulnerabilityOccurrencesSummaryReque" + + "st\022\016\n\006parent\030\001 \001(\t\022\016\n\006filter\030\002 \001(\t\"\245\002\n\037V" + + "ulnerabilityOccurrencesSummary\022U\n\006counts" + + "\030\001 \003(\0132E.grafeas.v1beta1.VulnerabilityOc" + + "currencesSummary.FixableTotalByDigest\032\252\001" + + "\n\024FixableTotalByDigest\022+\n\010resource\030\001 \001(\013" + + "2\031.grafeas.v1beta1.Resource\0229\n\010severity\030" + + "\002 \001(\0162\'.grafeas.v1beta1.vulnerability.Se" + + "verity\022\025\n\rfixable_count\030\003 \001(\003\022\023\n\013total_c" + + "ount\030\004 \001(\0032\302\021\n\016GrafeasV1Beta1\022\205\001\n\rGetOcc" + + "urrence\022%.grafeas.v1beta1.GetOccurrenceR" + + "equest\032\033.grafeas.v1beta1.Occurrence\"0\202\323\344" + + "\223\002*\022(/v1beta1/{name=projects/*/occurrenc" + + "es/*}\022\226\001\n\017ListOccurrences\022\'.grafeas.v1be" + + "ta1.ListOccurrencesRequest\032(.grafeas.v1b" + + "eta1.ListOccurrencesResponse\"0\202\323\344\223\002*\022(/v" + + "1beta1/{parent=projects/*}/occurrences\022\206" + + "\001\n\020DeleteOccurrence\022(.grafeas.v1beta1.De" + + "leteOccurrenceRequest\032\026.google.protobuf." + + "Empty\"0\202\323\344\223\002**(/v1beta1/{name=projects/*" + + "/occurrences/*}\022\227\001\n\020CreateOccurrence\022(.g" + + "rafeas.v1beta1.CreateOccurrenceRequest\032\033" + + ".grafeas.v1beta1.Occurrence\"<\202\323\344\223\0026\"(/v1" + + "beta1/{parent=projects/*}/occurrences:\no" + + "ccurrence\022\272\001\n\026BatchCreateOccurrences\022..g" + + "rafeas.v1beta1.BatchCreateOccurrencesReq" + + "uest\032/.grafeas.v1beta1.BatchCreateOccurr" + + "encesResponse\"?\202\323\344\223\0029\"4/v1beta1/{parent=" + + "projects/*}/occurrences:batchCreate:\001*\022\227" + + "\001\n\020UpdateOccurrence\022(.grafeas.v1beta1.Up" + + "dateOccurrenceRequest\032\033.grafeas.v1beta1." + + "Occurrence\"<\202\323\344\223\00262(/v1beta1/{name=proje" + + "cts/*/occurrences/*}:\noccurrence\022\215\001\n\021Get" + + "OccurrenceNote\022).grafeas.v1beta1.GetOccu" + + "rrenceNoteRequest\032\025.grafeas.v1beta1.Note" + + "\"6\202\323\344\223\0020\022./v1beta1/{name=projects/*/occu" + + "rrences/*}/notes\022m\n\007GetNote\022\037.grafeas.v1" + + "beta1.GetNoteRequest\032\025.grafeas.v1beta1.N" + + "ote\"*\202\323\344\223\002$\022\"/v1beta1/{name=projects/*/n" + + "otes/*}\022~\n\tListNotes\022!.grafeas.v1beta1.L" + + "istNotesRequest\032\".grafeas.v1beta1.ListNo" + + "tesResponse\"*\202\323\344\223\002$\022\"/v1beta1/{parent=pr" + + "ojects/*}/notes\022t\n\nDeleteNote\022\".grafeas." + + "v1beta1.DeleteNoteRequest\032\026.google.proto" + + "buf.Empty\"*\202\323\344\223\002$*\"/v1beta1/{name=projec" + + "ts/*/notes/*}\022y\n\nCreateNote\022\".grafeas.v1" + + "beta1.CreateNoteRequest\032\025.grafeas.v1beta" + + "1.Note\"0\202\323\344\223\002*\"\"/v1beta1/{parent=project" + + "s/*}/notes:\004note\022\242\001\n\020BatchCreateNotes\022(." + + "grafeas.v1beta1.BatchCreateNotesRequest\032" + + ").grafeas.v1beta1.BatchCreateNotesRespon" + + "se\"9\202\323\344\223\0023\"./v1beta1/{parent=projects/*}" + + "/notes:batchCreate:\001*\022y\n\nUpdateNote\022\".gr" + + "afeas.v1beta1.UpdateNoteRequest\032\025.grafea" + + "s.v1beta1.Note\"0\202\323\344\223\002*2\"/v1beta1/{name=p" + + "rojects/*/notes/*}:\004note\022\250\001\n\023ListNoteOcc" + + "urrences\022+.grafeas.v1beta1.ListNoteOccur" + + "rencesRequest\032,.grafeas.v1beta1.ListNote" + + "OccurrencesResponse\"6\202\323\344\223\0020\022./v1beta1/{n" + + "ame=projects/*/notes/*}/occurrences\022\331\001\n\"" + + "GetVulnerabilityOccurrencesSummary\022:.gra" + + "feas.v1beta1.GetVulnerabilityOccurrences" + + "SummaryRequest\0320.grafeas.v1beta1.Vulnera" + + "bilityOccurrencesSummary\"E\202\323\344\223\002?\022=/v1bet" + + "a1/{parent=projects/*}/occurrences:vulne" + + "rabilitySummaryBv\n\022io.grafeas.v1beta1P\001Z" + + "Xgoogle.golang.org/genproto/googleapis/d" + + "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); + internal_static_grafeas_v1beta1_Occurrence_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_Occurrence_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_Occurrence_descriptor, + new java.lang.String[] { "Name", "Resource", "NoteName", "Kind", "Remediation", "CreateTime", "UpdateTime", "Vulnerability", "Build", "DerivedImage", "Installation", "Deployment", "Discovered", "Attestation", "Details", }); + internal_static_grafeas_v1beta1_Resource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_Resource_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_Resource_descriptor, + new java.lang.String[] { "Name", "Uri", "ContentHash", }); + internal_static_grafeas_v1beta1_Note_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_Note_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_Note_descriptor, + new java.lang.String[] { "Name", "ShortDescription", "LongDescription", "Kind", "RelatedUrl", "ExpirationTime", "CreateTime", "UpdateTime", "RelatedNoteNames", "Vulnerability", "Build", "BaseImage", "Package", "Deployable", "Discovery", "AttestationAuthority", "Type", }); + internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_GetOccurrenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_GetOccurrenceRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1beta1_ListOccurrencesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_grafeas_v1beta1_ListOccurrencesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor, + new java.lang.String[] { "Occurrences", "NextPageToken", }); + internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_DeleteOccurrenceRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_grafeas_v1beta1_CreateOccurrenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_CreateOccurrenceRequest_descriptor, + new java.lang.String[] { "Parent", "Occurrence", }); + internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor, + new java.lang.String[] { "Name", "Occurrence", "UpdateMask", }); + internal_static_grafeas_v1beta1_GetNoteRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_grafeas_v1beta1_GetNoteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_GetNoteRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_GetOccurrenceNoteRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_grafeas_v1beta1_ListNotesRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_grafeas_v1beta1_ListNotesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListNotesRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", "PageSize", "PageToken", }); + internal_static_grafeas_v1beta1_ListNotesResponse_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_grafeas_v1beta1_ListNotesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListNotesResponse_descriptor, + new java.lang.String[] { "Notes", "NextPageToken", }); + internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_grafeas_v1beta1_DeleteNoteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_DeleteNoteRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_grafeas_v1beta1_CreateNoteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_CreateNoteRequest_descriptor, + new java.lang.String[] { "Parent", "NoteId", "Note", }); + internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_grafeas_v1beta1_UpdateNoteRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor, + new java.lang.String[] { "Name", "Note", "UpdateMask", }); + internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor, + new java.lang.String[] { "Name", "Filter", "PageSize", "PageToken", }); + internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor, + new java.lang.String[] { "Occurrences", "NextPageToken", }); + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor, + new java.lang.String[] { "Parent", "Notes", }); + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_descriptor = + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_BatchCreateNotesRequest_NotesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_grafeas_v1beta1_BatchCreateNotesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_BatchCreateNotesResponse_descriptor, + new java.lang.String[] { "Notes", }); + internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_BatchCreateOccurrencesRequest_descriptor, + new java.lang.String[] { "Parent", "Occurrences", }); + internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_BatchCreateOccurrencesResponse_descriptor, + new java.lang.String[] { "Occurrences", }); + internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_GetVulnerabilityOccurrencesSummaryRequest_descriptor, + new java.lang.String[] { "Parent", "Filter", }); + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor, + new java.lang.String[] { "Counts", }); + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor = + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor, + new java.lang.String[] { "Resource", "Severity", "FixableCount", "TotalCount", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + 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(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..a3fc1e16b403 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequest.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to list occurrences for a note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNoteOccurrencesRequest} + */ +public final class ListNoteOccurrencesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListNoteOccurrencesRequest) + ListNoteOccurrencesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNoteOccurrencesRequest.newBuilder() to construct. + private ListNoteOccurrencesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNoteOccurrencesRequest() { + name_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNoteOccurrencesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNoteOccurrencesRequest.class, io.grafeas.v1beta1.ListNoteOccurrencesRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the note to list occurrences for in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the note to list occurrences for in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Number of occurrences to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListNoteOccurrencesRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListNoteOccurrencesRequest other = (io.grafeas.v1beta1.ListNoteOccurrencesRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListNoteOccurrencesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to list occurrences for a note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNoteOccurrencesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListNoteOccurrencesRequest) + io.grafeas.v1beta1.ListNoteOccurrencesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNoteOccurrencesRequest.class, io.grafeas.v1beta1.ListNoteOccurrencesRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListNoteOccurrencesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListNoteOccurrencesRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesRequest build() { + io.grafeas.v1beta1.ListNoteOccurrencesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesRequest buildPartial() { + io.grafeas.v1beta1.ListNoteOccurrencesRequest result = new io.grafeas.v1beta1.ListNoteOccurrencesRequest(this); + result.name_ = name_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListNoteOccurrencesRequest) { + return mergeFrom((io.grafeas.v1beta1.ListNoteOccurrencesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListNoteOccurrencesRequest other) { + if (other == io.grafeas.v1beta1.ListNoteOccurrencesRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListNoteOccurrencesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListNoteOccurrencesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the note to list occurrences for in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the note to list occurrences for in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the note to list occurrences for in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the note to list occurrences for in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the note to list occurrences for in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListNoteOccurrencesRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListNoteOccurrencesRequest) + private static final io.grafeas.v1beta1.ListNoteOccurrencesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListNoteOccurrencesRequest(); + } + + public static io.grafeas.v1beta1.ListNoteOccurrencesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNoteOccurrencesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNoteOccurrencesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequestOrBuilder.java new file mode 100644 index 000000000000..1a1aa3012044 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListNoteOccurrencesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListNoteOccurrencesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the note to list occurrences for in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the note to list occurrences for in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Number of occurrences to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..064bb30eec9c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponse.java @@ -0,0 +1,1017 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Response for listing occurrences for a note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNoteOccurrencesResponse} + */ +public final class ListNoteOccurrencesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListNoteOccurrencesResponse) + ListNoteOccurrencesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNoteOccurrencesResponse.newBuilder() to construct. + private ListNoteOccurrencesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNoteOccurrencesResponse() { + occurrences_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNoteOccurrencesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + occurrences_.add( + input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNoteOccurrencesResponse.class, io.grafeas.v1beta1.ListNoteOccurrencesResponse.Builder.class); + } + + private int bitField0_; + public static final int OCCURRENCES_FIELD_NUMBER = 1; + private java.util.List occurrences_; + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + return occurrences_; + } + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + return occurrences_; + } + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + return occurrences_.size(); + } + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + return occurrences_.get(index); + } + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + return occurrences_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < occurrences_.size(); i++) { + output.writeMessage(1, occurrences_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < occurrences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, occurrences_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListNoteOccurrencesResponse)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListNoteOccurrencesResponse other = (io.grafeas.v1beta1.ListNoteOccurrencesResponse) obj; + + boolean result = true; + result = result && getOccurrencesList() + .equals(other.getOccurrencesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOccurrencesCount() > 0) { + hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; + hash = (53 * hash) + getOccurrencesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListNoteOccurrencesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for listing occurrences for a note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNoteOccurrencesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListNoteOccurrencesResponse) + io.grafeas.v1beta1.ListNoteOccurrencesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNoteOccurrencesResponse.class, io.grafeas.v1beta1.ListNoteOccurrencesResponse.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListNoteOccurrencesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOccurrencesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + occurrencesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNoteOccurrencesResponse_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesResponse getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListNoteOccurrencesResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesResponse build() { + io.grafeas.v1beta1.ListNoteOccurrencesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.occurrences_ = occurrences_; + } else { + result.occurrences_ = occurrencesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListNoteOccurrencesResponse) { + return mergeFrom((io.grafeas.v1beta1.ListNoteOccurrencesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListNoteOccurrencesResponse other) { + if (other == io.grafeas.v1beta1.ListNoteOccurrencesResponse.getDefaultInstance()) return this; + if (occurrencesBuilder_ == null) { + if (!other.occurrences_.isEmpty()) { + if (occurrences_.isEmpty()) { + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOccurrencesIsMutable(); + occurrences_.addAll(other.occurrences_); + } + onChanged(); + } + } else { + if (!other.occurrences_.isEmpty()) { + if (occurrencesBuilder_.isEmpty()) { + occurrencesBuilder_.dispose(); + occurrencesBuilder_ = null; + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + occurrencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOccurrencesFieldBuilder() : null; + } else { + occurrencesBuilder_.addAllMessages(other.occurrences_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListNoteOccurrencesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListNoteOccurrencesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List occurrences_ = + java.util.Collections.emptyList(); + private void ensureOccurrencesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(occurrences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrencesBuilder_; + + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + if (occurrencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(occurrences_); + } else { + return occurrencesBuilder_.getMessageList(); + } + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + if (occurrencesBuilder_ == null) { + return occurrences_.size(); + } else { + return occurrencesBuilder_.getCount(); + } + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); + } else { + return occurrencesBuilder_.getMessage(index); + } + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.set(index, value); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.set(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences(io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(index, value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addAllOccurrences( + java.lang.Iterable values) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, occurrences_); + onChanged(); + } else { + occurrencesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder clearOccurrences() { + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder removeOccurrences(int index) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.remove(index); + onChanged(); + } else { + occurrencesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().getBuilder(index); + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); } else { + return occurrencesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + if (occurrencesBuilder_ != null) { + return occurrencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(occurrences_); + } + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder() { + return getOccurrencesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences attached to the specified note.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesBuilderList() { + return getOccurrencesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrencesFieldBuilder() { + if (occurrencesBuilder_ == null) { + occurrencesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + occurrences_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + occurrences_ = null; + } + return occurrencesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListNoteOccurrencesResponse) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListNoteOccurrencesResponse) + private static final io.grafeas.v1beta1.ListNoteOccurrencesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListNoteOccurrencesResponse(); + } + + public static io.grafeas.v1beta1.ListNoteOccurrencesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNoteOccurrencesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNoteOccurrencesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNoteOccurrencesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponseOrBuilder.java new file mode 100644 index 000000000000..685baceeea74 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNoteOccurrencesResponseOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListNoteOccurrencesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListNoteOccurrencesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesList(); + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.Occurrence getOccurrences(int index); + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + int getOccurrencesCount(); + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesOrBuilderList(); + /** + *
+   * The occurrences attached to the specified note.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index); + + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..8d89e7528bc7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequest.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to list notes.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNotesRequest} + */ +public final class ListNotesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListNotesRequest) + ListNotesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNotesRequest.newBuilder() to construct. + private ListNotesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNotesRequest() { + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNotesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNotesRequest.class, io.grafeas.v1beta1.ListNotesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project to list notes for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project to list notes for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Number of notes to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListNotesRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListNotesRequest other = (io.grafeas.v1beta1.ListNotesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListNotesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to list notes.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNotesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListNotesRequest) + io.grafeas.v1beta1.ListNotesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNotesRequest.class, io.grafeas.v1beta1.ListNotesRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListNotesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListNotesRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesRequest build() { + io.grafeas.v1beta1.ListNotesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesRequest buildPartial() { + io.grafeas.v1beta1.ListNotesRequest result = new io.grafeas.v1beta1.ListNotesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListNotesRequest) { + return mergeFrom((io.grafeas.v1beta1.ListNotesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListNotesRequest other) { + if (other == io.grafeas.v1beta1.ListNotesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListNotesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListNotesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project to list notes for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project to list notes for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project to list notes for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project to list notes for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project to list notes for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Number of notes to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Number of notes to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Number of notes to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListNotesRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListNotesRequest) + private static final io.grafeas.v1beta1.ListNotesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListNotesRequest(); + } + + public static io.grafeas.v1beta1.ListNotesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNotesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequestOrBuilder.java new file mode 100644 index 000000000000..728b598a1bc4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListNotesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListNotesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project to list notes for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project to list notes for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Number of notes to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..d9be1e04f3ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponse.java @@ -0,0 +1,1031 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Response for listing notes.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNotesResponse} + */ +public final class ListNotesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListNotesResponse) + ListNotesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListNotesResponse.newBuilder() to construct. + private ListNotesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListNotesResponse() { + notes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListNotesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + notes_.add( + input.readMessage(io.grafeas.v1beta1.Note.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = java.util.Collections.unmodifiableList(notes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNotesResponse.class, io.grafeas.v1beta1.ListNotesResponse.Builder.class); + } + + private int bitField0_; + public static final int NOTES_FIELD_NUMBER = 1; + private java.util.List notes_; + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List getNotesList() { + return notes_; + } + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesOrBuilderList() { + return notes_; + } + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public int getNotesCount() { + return notes_.size(); + } + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note getNotes(int index) { + return notes_.get(index); + } + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index) { + return notes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < notes_.size(); i++) { + output.writeMessage(1, notes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < notes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, notes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListNotesResponse)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListNotesResponse other = (io.grafeas.v1beta1.ListNotesResponse) obj; + + boolean result = true; + result = result && getNotesList() + .equals(other.getNotesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getNotesCount() > 0) { + hash = (37 * hash) + NOTES_FIELD_NUMBER; + hash = (53 * hash) + getNotesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListNotesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListNotesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for listing notes.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListNotesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListNotesResponse) + io.grafeas.v1beta1.ListNotesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListNotesResponse.class, io.grafeas.v1beta1.ListNotesResponse.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListNotesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getNotesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (notesBuilder_ == null) { + notes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + notesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListNotesResponse_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesResponse getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListNotesResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesResponse build() { + io.grafeas.v1beta1.ListNotesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000001)) { + notes_ = java.util.Collections.unmodifiableList(notes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.notes_ = notes_; + } else { + result.notes_ = notesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListNotesResponse) { + return mergeFrom((io.grafeas.v1beta1.ListNotesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListNotesResponse other) { + if (other == io.grafeas.v1beta1.ListNotesResponse.getDefaultInstance()) return this; + if (notesBuilder_ == null) { + if (!other.notes_.isEmpty()) { + if (notes_.isEmpty()) { + notes_ = other.notes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureNotesIsMutable(); + notes_.addAll(other.notes_); + } + onChanged(); + } + } else { + if (!other.notes_.isEmpty()) { + if (notesBuilder_.isEmpty()) { + notesBuilder_.dispose(); + notesBuilder_ = null; + notes_ = other.notes_; + bitField0_ = (bitField0_ & ~0x00000001); + notesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getNotesFieldBuilder() : null; + } else { + notesBuilder_.addAllMessages(other.notes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListNotesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListNotesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List notes_ = + java.util.Collections.emptyList(); + private void ensureNotesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + notes_ = new java.util.ArrayList(notes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> notesBuilder_; + + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List getNotesList() { + if (notesBuilder_ == null) { + return java.util.Collections.unmodifiableList(notes_); + } else { + return notesBuilder_.getMessageList(); + } + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public int getNotesCount() { + if (notesBuilder_ == null) { + return notes_.size(); + } else { + return notesBuilder_.getCount(); + } + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note getNotes(int index) { + if (notesBuilder_ == null) { + return notes_.get(index); + } else { + return notesBuilder_.getMessage(index); + } + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder setNotes( + int index, io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.set(index, value); + onChanged(); + } else { + notesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder setNotes( + int index, io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.set(index, builderForValue.build()); + onChanged(); + } else { + notesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes(io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.add(value); + onChanged(); + } else { + notesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + int index, io.grafeas.v1beta1.Note value) { + if (notesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureNotesIsMutable(); + notes_.add(index, value); + onChanged(); + } else { + notesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.add(builderForValue.build()); + onChanged(); + } else { + notesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addNotes( + int index, io.grafeas.v1beta1.Note.Builder builderForValue) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.add(index, builderForValue.build()); + onChanged(); + } else { + notesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder addAllNotes( + java.lang.Iterable values) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, notes_); + onChanged(); + } else { + notesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder clearNotes() { + if (notesBuilder_ == null) { + notes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + notesBuilder_.clear(); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public Builder removeNotes(int index) { + if (notesBuilder_ == null) { + ensureNotesIsMutable(); + notes_.remove(index); + onChanged(); + } else { + notesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder getNotesBuilder( + int index) { + return getNotesFieldBuilder().getBuilder(index); + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index) { + if (notesBuilder_ == null) { + return notes_.get(index); } else { + return notesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesOrBuilderList() { + if (notesBuilder_ != null) { + return notesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(notes_); + } + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder addNotesBuilder() { + return getNotesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Note.getDefaultInstance()); + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public io.grafeas.v1beta1.Note.Builder addNotesBuilder( + int index) { + return getNotesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Note.getDefaultInstance()); + } + /** + *
+     * The notes requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + public java.util.List + getNotesBuilderList() { + return getNotesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> + getNotesFieldBuilder() { + if (notesBuilder_ == null) { + notesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder>( + notes_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + notes_ = null; + } + return notesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListNotesResponse) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListNotesResponse) + private static final io.grafeas.v1beta1.ListNotesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListNotesResponse(); + } + + public static io.grafeas.v1beta1.ListNotesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListNotesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListNotesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListNotesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponseOrBuilder.java new file mode 100644 index 000000000000..d7e334ce8c44 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListNotesResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListNotesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListNotesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + java.util.List + getNotesList(); + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + io.grafeas.v1beta1.Note getNotes(int index); + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + int getNotesCount(); + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + java.util.List + getNotesOrBuilderList(); + /** + *
+   * The notes requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Note notes = 1; + */ + io.grafeas.v1beta1.NoteOrBuilder getNotesOrBuilder( + int index); + + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..3b331a4b24ff --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequest.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to list occurrences.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListOccurrencesRequest} + */ +public final class ListOccurrencesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListOccurrencesRequest) + ListOccurrencesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListOccurrencesRequest.newBuilder() to construct. + private ListOccurrencesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListOccurrencesRequest() { + parent_ = ""; + filter_ = ""; + pageSize_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListOccurrencesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListOccurrencesRequest.class, io.grafeas.v1beta1.ListOccurrencesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The name of the project to list occurrences for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The name of the project to list occurrences for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Number of occurrences to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListOccurrencesRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListOccurrencesRequest other = (io.grafeas.v1beta1.ListOccurrencesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getFilter() + .equals(other.getFilter()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListOccurrencesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to list occurrences.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListOccurrencesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListOccurrencesRequest) + io.grafeas.v1beta1.ListOccurrencesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListOccurrencesRequest.class, io.grafeas.v1beta1.ListOccurrencesRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListOccurrencesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListOccurrencesRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesRequest build() { + io.grafeas.v1beta1.ListOccurrencesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesRequest buildPartial() { + io.grafeas.v1beta1.ListOccurrencesRequest result = new io.grafeas.v1beta1.ListOccurrencesRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListOccurrencesRequest) { + return mergeFrom((io.grafeas.v1beta1.ListOccurrencesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListOccurrencesRequest other) { + if (other == io.grafeas.v1beta1.ListOccurrencesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListOccurrencesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListOccurrencesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The name of the project to list occurrences for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the project to list occurrences for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the project to list occurrences for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the project to list occurrences for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The name of the project to list occurrences for in the form of
+     * `projects/[PROJECT_ID]`.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public com.google.protobuf.ByteString + getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilter( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + *
+     * The filter expression.
+     * 
+ * + * string filter = 2; + */ + public Builder setFilterBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Number of occurrences to return in the list.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Token to provide to skip to a particular spot in the list.
+     * 
+ * + * string page_token = 4; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListOccurrencesRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListOccurrencesRequest) + private static final io.grafeas.v1beta1.ListOccurrencesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListOccurrencesRequest(); + } + + public static io.grafeas.v1beta1.ListOccurrencesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOccurrencesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListOccurrencesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequestOrBuilder.java new file mode 100644 index 000000000000..5f2f3595bae0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesRequestOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListOccurrencesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListOccurrencesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the project to list occurrences for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The name of the project to list occurrences for in the form of
+   * `projects/[PROJECT_ID]`.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + java.lang.String getFilter(); + /** + *
+   * The filter expression.
+   * 
+ * + * string filter = 2; + */ + com.google.protobuf.ByteString + getFilterBytes(); + + /** + *
+   * Number of occurrences to return in the list.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); + + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + java.lang.String getPageToken(); + /** + *
+   * Token to provide to skip to a particular spot in the list.
+   * 
+ * + * string page_token = 4; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..820d10d3a3ac --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponse.java @@ -0,0 +1,1031 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Response for listing occurrences.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListOccurrencesResponse} + */ +public final class ListOccurrencesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.ListOccurrencesResponse) + ListOccurrencesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListOccurrencesResponse.newBuilder() to construct. + private ListOccurrencesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListOccurrencesResponse() { + occurrences_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListOccurrencesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + occurrences_.add( + input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListOccurrencesResponse.class, io.grafeas.v1beta1.ListOccurrencesResponse.Builder.class); + } + + private int bitField0_; + public static final int OCCURRENCES_FIELD_NUMBER = 1; + private java.util.List occurrences_; + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + return occurrences_; + } + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + return occurrences_; + } + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + return occurrences_.size(); + } + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + return occurrences_.get(index); + } + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + return occurrences_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < occurrences_.size(); i++) { + output.writeMessage(1, occurrences_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < occurrences_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, occurrences_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.ListOccurrencesResponse)) { + return super.equals(obj); + } + io.grafeas.v1beta1.ListOccurrencesResponse other = (io.grafeas.v1beta1.ListOccurrencesResponse) obj; + + boolean result = true; + result = result && getOccurrencesList() + .equals(other.getOccurrencesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getOccurrencesCount() > 0) { + hash = (37 * hash) + OCCURRENCES_FIELD_NUMBER; + hash = (53 * hash) + getOccurrencesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.ListOccurrencesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.ListOccurrencesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response for listing occurrences.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.ListOccurrencesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.ListOccurrencesResponse) + io.grafeas.v1beta1.ListOccurrencesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.ListOccurrencesResponse.class, io.grafeas.v1beta1.ListOccurrencesResponse.Builder.class); + } + + // Construct using io.grafeas.v1beta1.ListOccurrencesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOccurrencesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + occurrencesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_ListOccurrencesResponse_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesResponse getDefaultInstanceForType() { + return io.grafeas.v1beta1.ListOccurrencesResponse.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesResponse build() { + io.grafeas.v1beta1.ListOccurrencesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000001)) { + occurrences_ = java.util.Collections.unmodifiableList(occurrences_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.occurrences_ = occurrences_; + } else { + result.occurrences_ = occurrencesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.ListOccurrencesResponse) { + return mergeFrom((io.grafeas.v1beta1.ListOccurrencesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.ListOccurrencesResponse other) { + if (other == io.grafeas.v1beta1.ListOccurrencesResponse.getDefaultInstance()) return this; + if (occurrencesBuilder_ == null) { + if (!other.occurrences_.isEmpty()) { + if (occurrences_.isEmpty()) { + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOccurrencesIsMutable(); + occurrences_.addAll(other.occurrences_); + } + onChanged(); + } + } else { + if (!other.occurrences_.isEmpty()) { + if (occurrencesBuilder_.isEmpty()) { + occurrencesBuilder_.dispose(); + occurrencesBuilder_ = null; + occurrences_ = other.occurrences_; + bitField0_ = (bitField0_ & ~0x00000001); + occurrencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOccurrencesFieldBuilder() : null; + } else { + occurrencesBuilder_.addAllMessages(other.occurrences_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.ListOccurrencesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.ListOccurrencesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List occurrences_ = + java.util.Collections.emptyList(); + private void ensureOccurrencesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + occurrences_ = new java.util.ArrayList(occurrences_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrencesBuilder_; + + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List getOccurrencesList() { + if (occurrencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(occurrences_); + } else { + return occurrencesBuilder_.getMessageList(); + } + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public int getOccurrencesCount() { + if (occurrencesBuilder_ == null) { + return occurrences_.size(); + } else { + return occurrencesBuilder_.getCount(); + } + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence getOccurrences(int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); + } else { + return occurrencesBuilder_.getMessage(index); + } + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.set(index, value); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder setOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.set(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences(io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence value) { + if (occurrencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOccurrencesIsMutable(); + occurrences_.add(index, value); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addOccurrences( + int index, io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.add(index, builderForValue.build()); + onChanged(); + } else { + occurrencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder addAllOccurrences( + java.lang.Iterable values) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, occurrences_); + onChanged(); + } else { + occurrencesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder clearOccurrences() { + if (occurrencesBuilder_ == null) { + occurrences_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + occurrencesBuilder_.clear(); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public Builder removeOccurrences(int index) { + if (occurrencesBuilder_ == null) { + ensureOccurrencesIsMutable(); + occurrences_.remove(index); + onChanged(); + } else { + occurrencesBuilder_.remove(index); + } + return this; + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().getBuilder(index); + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index) { + if (occurrencesBuilder_ == null) { + return occurrences_.get(index); } else { + return occurrencesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesOrBuilderList() { + if (occurrencesBuilder_ != null) { + return occurrencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(occurrences_); + } + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder() { + return getOccurrencesFieldBuilder().addBuilder( + io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public io.grafeas.v1beta1.Occurrence.Builder addOccurrencesBuilder( + int index) { + return getOccurrencesFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.Occurrence.getDefaultInstance()); + } + /** + *
+     * The occurrences requested.
+     * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + public java.util.List + getOccurrencesBuilderList() { + return getOccurrencesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrencesFieldBuilder() { + if (occurrencesBuilder_ == null) { + occurrencesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + occurrences_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + occurrences_ = null; + } + return occurrencesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * The next pagination token in the list response. It should be used as
+     * `page_token` for the following request. An empty value means no more
+     * results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.ListOccurrencesResponse) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.ListOccurrencesResponse) + private static final io.grafeas.v1beta1.ListOccurrencesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.ListOccurrencesResponse(); + } + + public static io.grafeas.v1beta1.ListOccurrencesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListOccurrencesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListOccurrencesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.ListOccurrencesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponseOrBuilder.java new file mode 100644 index 000000000000..e3133c425939 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ListOccurrencesResponseOrBuilder.java @@ -0,0 +1,75 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ListOccurrencesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.ListOccurrencesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesList(); + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.Occurrence getOccurrences(int index); + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + int getOccurrencesCount(); + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + java.util.List + getOccurrencesOrBuilderList(); + /** + *
+   * The occurrences requested.
+   * 
+ * + * repeated .grafeas.v1beta1.Occurrence occurrences = 1; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrencesOrBuilder( + int index); + + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * The next pagination token in the list response. It should be used as
+   * `page_token` for the following request. An empty value means no more
+   * results.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} 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 new file mode 100644 index 000000000000..fa3811d95c6b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Note.java @@ -0,0 +1,4219 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * A type of analysis that can be done for a resource.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.Note} + */ +public final class Note extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.Note) + NoteOrBuilder { +private static final long serialVersionUID = 0L; + // Use Note.newBuilder() to construct. + private Note(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Note() { + name_ = ""; + shortDescription_ = ""; + longDescription_ = ""; + kind_ = 0; + relatedUrl_ = java.util.Collections.emptyList(); + relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Note( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + shortDescription_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + longDescription_ = s; + break; + } + case 32: { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + relatedUrl_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + relatedUrl_.add( + input.readMessage(io.grafeas.v1beta1.common.RelatedUrl.parser(), extensionRegistry)); + break; + } + case 50: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (expirationTime_ != null) { + subBuilder = expirationTime_.toBuilder(); + } + expirationTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(expirationTime_); + expirationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 74: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + relatedNoteNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000100; + } + relatedNoteNames_.add(s); + break; + } + case 82: { + io.grafeas.v1beta1.vulnerability.Vulnerability.Builder subBuilder = null; + if (typeCase_ == 10) { + subBuilder = ((io.grafeas.v1beta1.vulnerability.Vulnerability) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.vulnerability.Vulnerability.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.vulnerability.Vulnerability) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 10; + break; + } + case 90: { + io.grafeas.v1beta1.build.Build.Builder subBuilder = null; + if (typeCase_ == 11) { + subBuilder = ((io.grafeas.v1beta1.build.Build) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.build.Build.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.build.Build) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 11; + break; + } + case 98: { + io.grafeas.v1beta1.image.Basis.Builder subBuilder = null; + if (typeCase_ == 12) { + subBuilder = ((io.grafeas.v1beta1.image.Basis) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.image.Basis.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.image.Basis) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 12; + break; + } + case 106: { + io.grafeas.v1beta1.pkg.Package.Builder subBuilder = null; + if (typeCase_ == 13) { + subBuilder = ((io.grafeas.v1beta1.pkg.Package) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.pkg.Package.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.pkg.Package) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 13; + break; + } + case 114: { + io.grafeas.v1beta1.deployment.Deployable.Builder subBuilder = null; + if (typeCase_ == 14) { + subBuilder = ((io.grafeas.v1beta1.deployment.Deployable) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.deployment.Deployable.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.deployment.Deployable) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 14; + break; + } + case 122: { + io.grafeas.v1beta1.discovery.Discovery.Builder subBuilder = null; + if (typeCase_ == 15) { + subBuilder = ((io.grafeas.v1beta1.discovery.Discovery) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.discovery.Discovery.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.discovery.Discovery) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 15; + break; + } + case 130: { + io.grafeas.v1beta1.attestation.Authority.Builder subBuilder = null; + if (typeCase_ == 16) { + subBuilder = ((io.grafeas.v1beta1.attestation.Authority) type_).toBuilder(); + } + type_ = + input.readMessage(io.grafeas.v1beta1.attestation.Authority.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.attestation.Authority) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 16; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + relatedUrl_ = java.util.Collections.unmodifiableList(relatedUrl_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + relatedNoteNames_ = relatedNoteNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Note_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Note_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Note.class, io.grafeas.v1beta1.Note.Builder.class); + } + + private int bitField0_; + private int typeCase_ = 0; + private java.lang.Object type_; + public enum TypeCase + implements com.google.protobuf.Internal.EnumLite { + VULNERABILITY(10), + BUILD(11), + BASE_IMAGE(12), + PACKAGE(13), + DEPLOYABLE(14), + DISCOVERY(15), + ATTESTATION_AUTHORITY(16), + TYPE_NOT_SET(0); + private final int value; + private TypeCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 10: return VULNERABILITY; + case 11: return BUILD; + case 12: return BASE_IMAGE; + case 13: return PACKAGE; + case 14: return DEPLOYABLE; + case 15: return DISCOVERY; + case 16: return ATTESTATION_AUTHORITY; + case 0: return TYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Output only. The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Output only. The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SHORT_DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object shortDescription_; + /** + *
+   * A one sentence description of this note.
+   * 
+ * + * string short_description = 2; + */ + public java.lang.String getShortDescription() { + java.lang.Object ref = shortDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortDescription_ = s; + return s; + } + } + /** + *
+   * A one sentence description of this note.
+   * 
+ * + * string short_description = 2; + */ + public com.google.protobuf.ByteString + getShortDescriptionBytes() { + java.lang.Object ref = shortDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shortDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LONG_DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object longDescription_; + /** + *
+   * A detailed description of this note.
+   * 
+ * + * string long_description = 3; + */ + public java.lang.String getLongDescription() { + java.lang.Object ref = longDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + longDescription_ = s; + return s; + } + } + /** + *
+   * A detailed description of this note.
+   * 
+ * + * string long_description = 3; + */ + public com.google.protobuf.ByteString + getLongDescriptionBytes() { + java.lang.Object ref = longDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + private int kind_; + /** + *
+   * Output only. The type of analysis. This field can be used as a filter in
+   * list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+   * Output only. The type of analysis. This field can be used as a filter in
+   * list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public io.grafeas.v1beta1.common.NoteKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + + public static final int RELATED_URL_FIELD_NUMBER = 5; + private java.util.List relatedUrl_; + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public java.util.List getRelatedUrlList() { + return relatedUrl_; + } + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public java.util.List + getRelatedUrlOrBuilderList() { + return relatedUrl_; + } + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public int getRelatedUrlCount() { + return relatedUrl_.size(); + } + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrl getRelatedUrl(int index) { + return relatedUrl_.get(index); + } + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlOrBuilder( + int index) { + return relatedUrl_.get(index); + } + + public static final int EXPIRATION_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp expirationTime_; + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public boolean hasExpirationTime() { + return expirationTime_ != null; + } + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.Timestamp getExpirationTime() { + return expirationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expirationTime_; + } + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + return getExpirationTime(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 8; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int RELATED_NOTE_NAMES_FIELD_NUMBER = 9; + private com.google.protobuf.LazyStringList relatedNoteNames_; + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + public com.google.protobuf.ProtocolStringList + getRelatedNoteNamesList() { + return relatedNoteNames_; + } + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + public int getRelatedNoteNamesCount() { + return relatedNoteNames_.size(); + } + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + public java.lang.String getRelatedNoteNames(int index) { + return relatedNoteNames_.get(index); + } + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + public com.google.protobuf.ByteString + getRelatedNoteNamesBytes(int index) { + return relatedNoteNames_.getByteString(index); + } + + public static final int VULNERABILITY_FIELD_NUMBER = 10; + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public boolean hasVulnerability() { + return typeCase_ == 10; + } + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability getVulnerability() { + if (typeCase_ == 10) { + return (io.grafeas.v1beta1.vulnerability.Vulnerability) type_; + } + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder getVulnerabilityOrBuilder() { + if (typeCase_ == 10) { + return (io.grafeas.v1beta1.vulnerability.Vulnerability) type_; + } + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + + public static final int BUILD_FIELD_NUMBER = 11; + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public boolean hasBuild() { + return typeCase_ == 11; + } + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public io.grafeas.v1beta1.build.Build getBuild() { + if (typeCase_ == 11) { + return (io.grafeas.v1beta1.build.Build) type_; + } + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public io.grafeas.v1beta1.build.BuildOrBuilder getBuildOrBuilder() { + if (typeCase_ == 11) { + return (io.grafeas.v1beta1.build.Build) type_; + } + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + + public static final int BASE_IMAGE_FIELD_NUMBER = 12; + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public boolean hasBaseImage() { + return typeCase_ == 12; + } + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public io.grafeas.v1beta1.image.Basis getBaseImage() { + if (typeCase_ == 12) { + return (io.grafeas.v1beta1.image.Basis) type_; + } + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public io.grafeas.v1beta1.image.BasisOrBuilder getBaseImageOrBuilder() { + if (typeCase_ == 12) { + return (io.grafeas.v1beta1.image.Basis) type_; + } + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + + public static final int PACKAGE_FIELD_NUMBER = 13; + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public boolean hasPackage() { + return typeCase_ == 13; + } + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public io.grafeas.v1beta1.pkg.Package getPackage() { + if (typeCase_ == 13) { + return (io.grafeas.v1beta1.pkg.Package) type_; + } + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public io.grafeas.v1beta1.pkg.PackageOrBuilder getPackageOrBuilder() { + if (typeCase_ == 13) { + return (io.grafeas.v1beta1.pkg.Package) type_; + } + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + + public static final int DEPLOYABLE_FIELD_NUMBER = 14; + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public boolean hasDeployable() { + return typeCase_ == 14; + } + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public io.grafeas.v1beta1.deployment.Deployable getDeployable() { + if (typeCase_ == 14) { + return (io.grafeas.v1beta1.deployment.Deployable) type_; + } + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public io.grafeas.v1beta1.deployment.DeployableOrBuilder getDeployableOrBuilder() { + if (typeCase_ == 14) { + return (io.grafeas.v1beta1.deployment.Deployable) type_; + } + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + + public static final int DISCOVERY_FIELD_NUMBER = 15; + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public boolean hasDiscovery() { + return typeCase_ == 15; + } + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public io.grafeas.v1beta1.discovery.Discovery getDiscovery() { + if (typeCase_ == 15) { + return (io.grafeas.v1beta1.discovery.Discovery) type_; + } + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public io.grafeas.v1beta1.discovery.DiscoveryOrBuilder getDiscoveryOrBuilder() { + if (typeCase_ == 15) { + return (io.grafeas.v1beta1.discovery.Discovery) type_; + } + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + + public static final int ATTESTATION_AUTHORITY_FIELD_NUMBER = 16; + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public boolean hasAttestationAuthority() { + return typeCase_ == 16; + } + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public io.grafeas.v1beta1.attestation.Authority getAttestationAuthority() { + if (typeCase_ == 16) { + return (io.grafeas.v1beta1.attestation.Authority) type_; + } + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public io.grafeas.v1beta1.attestation.AuthorityOrBuilder getAttestationAuthorityOrBuilder() { + if (typeCase_ == 16) { + return (io.grafeas.v1beta1.attestation.Authority) type_; + } + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getShortDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, shortDescription_); + } + if (!getLongDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, longDescription_); + } + if (kind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(4, kind_); + } + for (int i = 0; i < relatedUrl_.size(); i++) { + output.writeMessage(5, relatedUrl_.get(i)); + } + if (expirationTime_ != null) { + output.writeMessage(6, getExpirationTime()); + } + if (createTime_ != null) { + output.writeMessage(7, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(8, getUpdateTime()); + } + for (int i = 0; i < relatedNoteNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, relatedNoteNames_.getRaw(i)); + } + if (typeCase_ == 10) { + output.writeMessage(10, (io.grafeas.v1beta1.vulnerability.Vulnerability) type_); + } + if (typeCase_ == 11) { + output.writeMessage(11, (io.grafeas.v1beta1.build.Build) type_); + } + if (typeCase_ == 12) { + output.writeMessage(12, (io.grafeas.v1beta1.image.Basis) type_); + } + if (typeCase_ == 13) { + output.writeMessage(13, (io.grafeas.v1beta1.pkg.Package) type_); + } + if (typeCase_ == 14) { + output.writeMessage(14, (io.grafeas.v1beta1.deployment.Deployable) type_); + } + if (typeCase_ == 15) { + output.writeMessage(15, (io.grafeas.v1beta1.discovery.Discovery) type_); + } + if (typeCase_ == 16) { + output.writeMessage(16, (io.grafeas.v1beta1.attestation.Authority) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getShortDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, shortDescription_); + } + if (!getLongDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, longDescription_); + } + if (kind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kind_); + } + for (int i = 0; i < relatedUrl_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, relatedUrl_.get(i)); + } + if (expirationTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getExpirationTime()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getUpdateTime()); + } + { + int dataSize = 0; + for (int i = 0; i < relatedNoteNames_.size(); i++) { + dataSize += computeStringSizeNoTag(relatedNoteNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getRelatedNoteNamesList().size(); + } + if (typeCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (io.grafeas.v1beta1.vulnerability.Vulnerability) type_); + } + if (typeCase_ == 11) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, (io.grafeas.v1beta1.build.Build) type_); + } + if (typeCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, (io.grafeas.v1beta1.image.Basis) type_); + } + if (typeCase_ == 13) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, (io.grafeas.v1beta1.pkg.Package) type_); + } + if (typeCase_ == 14) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, (io.grafeas.v1beta1.deployment.Deployable) type_); + } + if (typeCase_ == 15) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(15, (io.grafeas.v1beta1.discovery.Discovery) type_); + } + if (typeCase_ == 16) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(16, (io.grafeas.v1beta1.attestation.Authority) type_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.Note)) { + return super.equals(obj); + } + io.grafeas.v1beta1.Note other = (io.grafeas.v1beta1.Note) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getShortDescription() + .equals(other.getShortDescription()); + result = result && getLongDescription() + .equals(other.getLongDescription()); + result = result && kind_ == other.kind_; + result = result && getRelatedUrlList() + .equals(other.getRelatedUrlList()); + result = result && (hasExpirationTime() == other.hasExpirationTime()); + if (hasExpirationTime()) { + result = result && getExpirationTime() + .equals(other.getExpirationTime()); + } + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && getRelatedNoteNamesList() + .equals(other.getRelatedNoteNamesList()); + result = result && getTypeCase().equals( + other.getTypeCase()); + if (!result) return false; + switch (typeCase_) { + case 10: + result = result && getVulnerability() + .equals(other.getVulnerability()); + break; + case 11: + result = result && getBuild() + .equals(other.getBuild()); + break; + case 12: + result = result && getBaseImage() + .equals(other.getBaseImage()); + break; + case 13: + result = result && getPackage() + .equals(other.getPackage()); + break; + case 14: + result = result && getDeployable() + .equals(other.getDeployable()); + break; + case 15: + result = result && getDiscovery() + .equals(other.getDiscovery()); + break; + case 16: + result = result && getAttestationAuthority() + .equals(other.getAttestationAuthority()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + SHORT_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getShortDescription().hashCode(); + hash = (37 * hash) + LONG_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getLongDescription().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + if (getRelatedUrlCount() > 0) { + hash = (37 * hash) + RELATED_URL_FIELD_NUMBER; + hash = (53 * hash) + getRelatedUrlList().hashCode(); + } + if (hasExpirationTime()) { + hash = (37 * hash) + EXPIRATION_TIME_FIELD_NUMBER; + hash = (53 * hash) + getExpirationTime().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (getRelatedNoteNamesCount() > 0) { + hash = (37 * hash) + RELATED_NOTE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getRelatedNoteNamesList().hashCode(); + } + switch (typeCase_) { + case 10: + hash = (37 * hash) + VULNERABILITY_FIELD_NUMBER; + hash = (53 * hash) + getVulnerability().hashCode(); + break; + case 11: + hash = (37 * hash) + BUILD_FIELD_NUMBER; + hash = (53 * hash) + getBuild().hashCode(); + break; + case 12: + hash = (37 * hash) + BASE_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getBaseImage().hashCode(); + break; + case 13: + hash = (37 * hash) + PACKAGE_FIELD_NUMBER; + hash = (53 * hash) + getPackage().hashCode(); + break; + case 14: + hash = (37 * hash) + DEPLOYABLE_FIELD_NUMBER; + hash = (53 * hash) + getDeployable().hashCode(); + break; + case 15: + hash = (37 * hash) + DISCOVERY_FIELD_NUMBER; + hash = (53 * hash) + getDiscovery().hashCode(); + break; + case 16: + hash = (37 * hash) + ATTESTATION_AUTHORITY_FIELD_NUMBER; + hash = (53 * hash) + getAttestationAuthority().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.Note parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Note parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Note parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Note parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Note parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Note parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Note parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Note parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Note parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Note parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Note parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Note parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.Note prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A type of analysis that can be done for a resource.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.Note} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.Note) + io.grafeas.v1beta1.NoteOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Note_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Note_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Note.class, io.grafeas.v1beta1.Note.Builder.class); + } + + // Construct using io.grafeas.v1beta1.Note.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRelatedUrlFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + shortDescription_ = ""; + + longDescription_ = ""; + + kind_ = 0; + + if (relatedUrlBuilder_ == null) { + relatedUrl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + } else { + relatedUrlBuilder_.clear(); + } + if (expirationTimeBuilder_ == null) { + expirationTime_ = null; + } else { + expirationTime_ = null; + expirationTimeBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Note_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.Note getDefaultInstanceForType() { + return io.grafeas.v1beta1.Note.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.Note build() { + io.grafeas.v1beta1.Note result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000010)) { + relatedUrl_ = java.util.Collections.unmodifiableList(relatedUrl_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.relatedUrl_ = relatedUrl_; + } else { + result.relatedUrl_ = relatedUrlBuilder_.build(); + } + if (expirationTimeBuilder_ == null) { + result.expirationTime_ = expirationTime_; + } else { + result.expirationTime_ = expirationTimeBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + relatedNoteNames_ = relatedNoteNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.relatedNoteNames_ = relatedNoteNames_; + if (typeCase_ == 10) { + if (vulnerabilityBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = vulnerabilityBuilder_.build(); + } + } + if (typeCase_ == 11) { + if (buildBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = buildBuilder_.build(); + } + } + if (typeCase_ == 12) { + if (baseImageBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = baseImageBuilder_.build(); + } + } + if (typeCase_ == 13) { + if (packageBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = packageBuilder_.build(); + } + } + if (typeCase_ == 14) { + if (deployableBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = deployableBuilder_.build(); + } + } + if (typeCase_ == 15) { + if (discoveryBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = discoveryBuilder_.build(); + } + } + if (typeCase_ == 16) { + if (attestationAuthorityBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = attestationAuthorityBuilder_.build(); + } + } + result.bitField0_ = to_bitField0_; + result.typeCase_ = typeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.Note) { + return mergeFrom((io.grafeas.v1beta1.Note)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.Note other) { + if (other == io.grafeas.v1beta1.Note.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getShortDescription().isEmpty()) { + shortDescription_ = other.shortDescription_; + onChanged(); + } + if (!other.getLongDescription().isEmpty()) { + longDescription_ = other.longDescription_; + onChanged(); + } + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + if (relatedUrlBuilder_ == null) { + if (!other.relatedUrl_.isEmpty()) { + if (relatedUrl_.isEmpty()) { + relatedUrl_ = other.relatedUrl_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureRelatedUrlIsMutable(); + relatedUrl_.addAll(other.relatedUrl_); + } + onChanged(); + } + } else { + if (!other.relatedUrl_.isEmpty()) { + if (relatedUrlBuilder_.isEmpty()) { + relatedUrlBuilder_.dispose(); + relatedUrlBuilder_ = null; + relatedUrl_ = other.relatedUrl_; + bitField0_ = (bitField0_ & ~0x00000010); + relatedUrlBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRelatedUrlFieldBuilder() : null; + } else { + relatedUrlBuilder_.addAllMessages(other.relatedUrl_); + } + } + } + if (other.hasExpirationTime()) { + mergeExpirationTime(other.getExpirationTime()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.relatedNoteNames_.isEmpty()) { + if (relatedNoteNames_.isEmpty()) { + relatedNoteNames_ = other.relatedNoteNames_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureRelatedNoteNamesIsMutable(); + relatedNoteNames_.addAll(other.relatedNoteNames_); + } + onChanged(); + } + switch (other.getTypeCase()) { + case VULNERABILITY: { + mergeVulnerability(other.getVulnerability()); + break; + } + case BUILD: { + mergeBuild(other.getBuild()); + break; + } + case BASE_IMAGE: { + mergeBaseImage(other.getBaseImage()); + break; + } + case PACKAGE: { + mergePackage(other.getPackage()); + break; + } + case DEPLOYABLE: { + mergeDeployable(other.getDeployable()); + break; + } + case DISCOVERY: { + mergeDiscovery(other.getDiscovery()); + break; + } + case ATTESTATION_AUTHORITY: { + mergeAttestationAuthority(other.getAttestationAuthority()); + break; + } + case TYPE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.Note parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.Note) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int typeCase_ = 0; + private java.lang.Object type_; + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object shortDescription_ = ""; + /** + *
+     * A one sentence description of this note.
+     * 
+ * + * string short_description = 2; + */ + public java.lang.String getShortDescription() { + java.lang.Object ref = shortDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A one sentence description of this note.
+     * 
+ * + * string short_description = 2; + */ + public com.google.protobuf.ByteString + getShortDescriptionBytes() { + java.lang.Object ref = shortDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shortDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A one sentence description of this note.
+     * 
+ * + * string short_description = 2; + */ + public Builder setShortDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + shortDescription_ = value; + onChanged(); + return this; + } + /** + *
+     * A one sentence description of this note.
+     * 
+ * + * string short_description = 2; + */ + public Builder clearShortDescription() { + + shortDescription_ = getDefaultInstance().getShortDescription(); + onChanged(); + return this; + } + /** + *
+     * A one sentence description of this note.
+     * 
+ * + * string short_description = 2; + */ + public Builder setShortDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + shortDescription_ = value; + onChanged(); + return this; + } + + private java.lang.Object longDescription_ = ""; + /** + *
+     * A detailed description of this note.
+     * 
+ * + * string long_description = 3; + */ + public java.lang.String getLongDescription() { + java.lang.Object ref = longDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + longDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A detailed description of this note.
+     * 
+ * + * string long_description = 3; + */ + public com.google.protobuf.ByteString + getLongDescriptionBytes() { + java.lang.Object ref = longDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A detailed description of this note.
+     * 
+ * + * string long_description = 3; + */ + public Builder setLongDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + longDescription_ = value; + onChanged(); + return this; + } + /** + *
+     * A detailed description of this note.
+     * 
+ * + * string long_description = 3; + */ + public Builder clearLongDescription() { + + longDescription_ = getDefaultInstance().getLongDescription(); + onChanged(); + return this; + } + /** + *
+     * A detailed description of this note.
+     * 
+ * + * string long_description = 3; + */ + public Builder setLongDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + longDescription_ = value; + onChanged(); + return this; + } + + private int kind_ = 0; + /** + *
+     * Output only. The type of analysis. This field can be used as a filter in
+     * list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+     * Output only. The type of analysis. This field can be used as a filter in
+     * list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder setKindValue(int value) { + kind_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The type of analysis. This field can be used as a filter in
+     * list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public io.grafeas.v1beta1.common.NoteKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The type of analysis. This field can be used as a filter in
+     * list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder setKind(io.grafeas.v1beta1.common.NoteKind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The type of analysis. This field can be used as a filter in
+     * list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + + private java.util.List relatedUrl_ = + java.util.Collections.emptyList(); + private void ensureRelatedUrlIsMutable() { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { + relatedUrl_ = new java.util.ArrayList(relatedUrl_); + bitField0_ |= 0x00000010; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder> relatedUrlBuilder_; + + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public java.util.List getRelatedUrlList() { + if (relatedUrlBuilder_ == null) { + return java.util.Collections.unmodifiableList(relatedUrl_); + } else { + return relatedUrlBuilder_.getMessageList(); + } + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public int getRelatedUrlCount() { + if (relatedUrlBuilder_ == null) { + return relatedUrl_.size(); + } else { + return relatedUrlBuilder_.getCount(); + } + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrl getRelatedUrl(int index) { + if (relatedUrlBuilder_ == null) { + return relatedUrl_.get(index); + } else { + return relatedUrlBuilder_.getMessage(index); + } + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder setRelatedUrl( + int index, io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlIsMutable(); + relatedUrl_.set(index, value); + onChanged(); + } else { + relatedUrlBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder setRelatedUrl( + int index, io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlBuilder_ == null) { + ensureRelatedUrlIsMutable(); + relatedUrl_.set(index, builderForValue.build()); + onChanged(); + } else { + relatedUrlBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder addRelatedUrl(io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlIsMutable(); + relatedUrl_.add(value); + onChanged(); + } else { + relatedUrlBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder addRelatedUrl( + int index, io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlIsMutable(); + relatedUrl_.add(index, value); + onChanged(); + } else { + relatedUrlBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder addRelatedUrl( + io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlBuilder_ == null) { + ensureRelatedUrlIsMutable(); + relatedUrl_.add(builderForValue.build()); + onChanged(); + } else { + relatedUrlBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder addRelatedUrl( + int index, io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlBuilder_ == null) { + ensureRelatedUrlIsMutable(); + relatedUrl_.add(index, builderForValue.build()); + onChanged(); + } else { + relatedUrlBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder addAllRelatedUrl( + java.lang.Iterable values) { + if (relatedUrlBuilder_ == null) { + ensureRelatedUrlIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, relatedUrl_); + onChanged(); + } else { + relatedUrlBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder clearRelatedUrl() { + if (relatedUrlBuilder_ == null) { + relatedUrl_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + } else { + relatedUrlBuilder_.clear(); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public Builder removeRelatedUrl(int index) { + if (relatedUrlBuilder_ == null) { + ensureRelatedUrlIsMutable(); + relatedUrl_.remove(index); + onChanged(); + } else { + relatedUrlBuilder_.remove(index); + } + return this; + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder getRelatedUrlBuilder( + int index) { + return getRelatedUrlFieldBuilder().getBuilder(index); + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlOrBuilder( + int index) { + if (relatedUrlBuilder_ == null) { + return relatedUrl_.get(index); } else { + return relatedUrlBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public java.util.List + getRelatedUrlOrBuilderList() { + if (relatedUrlBuilder_ != null) { + return relatedUrlBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(relatedUrl_); + } + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder addRelatedUrlBuilder() { + return getRelatedUrlFieldBuilder().addBuilder( + io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance()); + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder addRelatedUrlBuilder( + int index) { + return getRelatedUrlFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance()); + } + /** + *
+     * URLs associated with this note.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + public java.util.List + getRelatedUrlBuilderList() { + return getRelatedUrlFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder> + getRelatedUrlFieldBuilder() { + if (relatedUrlBuilder_ == null) { + relatedUrlBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder>( + relatedUrl_, + ((bitField0_ & 0x00000010) == 0x00000010), + getParentForChildren(), + isClean()); + relatedUrl_ = null; + } + return relatedUrlBuilder_; + } + + private com.google.protobuf.Timestamp expirationTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> expirationTimeBuilder_; + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public boolean hasExpirationTime() { + return expirationTimeBuilder_ != null || expirationTime_ != null; + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.Timestamp getExpirationTime() { + if (expirationTimeBuilder_ == null) { + return expirationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : expirationTime_; + } else { + return expirationTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + expirationTime_ = value; + onChanged(); + } else { + expirationTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder setExpirationTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (expirationTimeBuilder_ == null) { + expirationTime_ = builderForValue.build(); + onChanged(); + } else { + expirationTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder mergeExpirationTime(com.google.protobuf.Timestamp value) { + if (expirationTimeBuilder_ == null) { + if (expirationTime_ != null) { + expirationTime_ = + com.google.protobuf.Timestamp.newBuilder(expirationTime_).mergeFrom(value).buildPartial(); + } else { + expirationTime_ = value; + } + onChanged(); + } else { + expirationTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public Builder clearExpirationTime() { + if (expirationTimeBuilder_ == null) { + expirationTime_ = null; + onChanged(); + } else { + expirationTime_ = null; + expirationTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getExpirationTimeBuilder() { + + onChanged(); + return getExpirationTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder() { + if (expirationTimeBuilder_ != null) { + return expirationTimeBuilder_.getMessageOrBuilder(); + } else { + return expirationTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : expirationTime_; + } + } + /** + *
+     * Time of expiration for this note. Empty if note does not expire.
+     * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getExpirationTimeFieldBuilder() { + if (expirationTimeBuilder_ == null) { + expirationTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getExpirationTime(), + getParentForChildren(), + isClean()); + expirationTime_ = null; + } + return expirationTimeBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only. The time this note was created. This field can be used as a
+     * filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public Builder setUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + } + /** + *
+     * Output only. The time this note was last updated. This field can be used as
+     * a filter in list requests.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), + getParentForChildren(), + isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.LazyStringList relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureRelatedNoteNamesIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + relatedNoteNames_ = new com.google.protobuf.LazyStringArrayList(relatedNoteNames_); + bitField0_ |= 0x00000100; + } + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public com.google.protobuf.ProtocolStringList + getRelatedNoteNamesList() { + return relatedNoteNames_.getUnmodifiableView(); + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public int getRelatedNoteNamesCount() { + return relatedNoteNames_.size(); + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public java.lang.String getRelatedNoteNames(int index) { + return relatedNoteNames_.get(index); + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public com.google.protobuf.ByteString + getRelatedNoteNamesBytes(int index) { + return relatedNoteNames_.getByteString(index); + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public Builder setRelatedNoteNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedNoteNamesIsMutable(); + relatedNoteNames_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public Builder addRelatedNoteNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedNoteNamesIsMutable(); + relatedNoteNames_.add(value); + onChanged(); + return this; + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public Builder addAllRelatedNoteNames( + java.lang.Iterable values) { + ensureRelatedNoteNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, relatedNoteNames_); + onChanged(); + return this; + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public Builder clearRelatedNoteNames() { + relatedNoteNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000100); + onChanged(); + return this; + } + /** + *
+     * Other notes related to this note.
+     * 
+ * + * repeated string related_note_names = 9; + */ + public Builder addRelatedNoteNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRelatedNoteNamesIsMutable(); + relatedNoteNames_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability, io.grafeas.v1beta1.vulnerability.Vulnerability.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder> vulnerabilityBuilder_; + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public boolean hasVulnerability() { + return typeCase_ == 10; + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability getVulnerability() { + if (vulnerabilityBuilder_ == null) { + if (typeCase_ == 10) { + return (io.grafeas.v1beta1.vulnerability.Vulnerability) type_; + } + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } else { + if (typeCase_ == 10) { + return vulnerabilityBuilder_.getMessage(); + } + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public Builder setVulnerability(io.grafeas.v1beta1.vulnerability.Vulnerability value) { + if (vulnerabilityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + vulnerabilityBuilder_.setMessage(value); + } + typeCase_ = 10; + return this; + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public Builder setVulnerability( + io.grafeas.v1beta1.vulnerability.Vulnerability.Builder builderForValue) { + if (vulnerabilityBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + vulnerabilityBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 10; + return this; + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public Builder mergeVulnerability(io.grafeas.v1beta1.vulnerability.Vulnerability value) { + if (vulnerabilityBuilder_ == null) { + if (typeCase_ == 10 && + type_ != io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.vulnerability.Vulnerability.newBuilder((io.grafeas.v1beta1.vulnerability.Vulnerability) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 10) { + vulnerabilityBuilder_.mergeFrom(value); + } + vulnerabilityBuilder_.setMessage(value); + } + typeCase_ = 10; + return this; + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public Builder clearVulnerability() { + if (vulnerabilityBuilder_ == null) { + if (typeCase_ == 10) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 10) { + typeCase_ = 0; + type_ = null; + } + vulnerabilityBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Builder getVulnerabilityBuilder() { + return getVulnerabilityFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder getVulnerabilityOrBuilder() { + if ((typeCase_ == 10) && (vulnerabilityBuilder_ != null)) { + return vulnerabilityBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 10) { + return (io.grafeas.v1beta1.vulnerability.Vulnerability) type_; + } + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + } + /** + *
+     * A note describing a package vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability, io.grafeas.v1beta1.vulnerability.Vulnerability.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder> + getVulnerabilityFieldBuilder() { + if (vulnerabilityBuilder_ == null) { + if (!(typeCase_ == 10)) { + type_ = io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + vulnerabilityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability, io.grafeas.v1beta1.vulnerability.Vulnerability.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder>( + (io.grafeas.v1beta1.vulnerability.Vulnerability) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 10; + onChanged();; + return vulnerabilityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Build, io.grafeas.v1beta1.build.Build.Builder, io.grafeas.v1beta1.build.BuildOrBuilder> buildBuilder_; + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public boolean hasBuild() { + return typeCase_ == 11; + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public io.grafeas.v1beta1.build.Build getBuild() { + if (buildBuilder_ == null) { + if (typeCase_ == 11) { + return (io.grafeas.v1beta1.build.Build) type_; + } + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } else { + if (typeCase_ == 11) { + return buildBuilder_.getMessage(); + } + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public Builder setBuild(io.grafeas.v1beta1.build.Build value) { + if (buildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + buildBuilder_.setMessage(value); + } + typeCase_ = 11; + return this; + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public Builder setBuild( + io.grafeas.v1beta1.build.Build.Builder builderForValue) { + if (buildBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + buildBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 11; + return this; + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public Builder mergeBuild(io.grafeas.v1beta1.build.Build value) { + if (buildBuilder_ == null) { + if (typeCase_ == 11 && + type_ != io.grafeas.v1beta1.build.Build.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.build.Build.newBuilder((io.grafeas.v1beta1.build.Build) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 11) { + buildBuilder_.mergeFrom(value); + } + buildBuilder_.setMessage(value); + } + typeCase_ = 11; + return this; + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public Builder clearBuild() { + if (buildBuilder_ == null) { + if (typeCase_ == 11) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 11) { + typeCase_ = 0; + type_ = null; + } + buildBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public io.grafeas.v1beta1.build.Build.Builder getBuildBuilder() { + return getBuildFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + public io.grafeas.v1beta1.build.BuildOrBuilder getBuildOrBuilder() { + if ((typeCase_ == 11) && (buildBuilder_ != null)) { + return buildBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 11) { + return (io.grafeas.v1beta1.build.Build) type_; + } + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + } + /** + *
+     * A note describing build provenance for a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Build, io.grafeas.v1beta1.build.Build.Builder, io.grafeas.v1beta1.build.BuildOrBuilder> + getBuildFieldBuilder() { + if (buildBuilder_ == null) { + if (!(typeCase_ == 11)) { + type_ = io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + buildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Build, io.grafeas.v1beta1.build.Build.Builder, io.grafeas.v1beta1.build.BuildOrBuilder>( + (io.grafeas.v1beta1.build.Build) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 11; + onChanged();; + return buildBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Basis, io.grafeas.v1beta1.image.Basis.Builder, io.grafeas.v1beta1.image.BasisOrBuilder> baseImageBuilder_; + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public boolean hasBaseImage() { + return typeCase_ == 12; + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public io.grafeas.v1beta1.image.Basis getBaseImage() { + if (baseImageBuilder_ == null) { + if (typeCase_ == 12) { + return (io.grafeas.v1beta1.image.Basis) type_; + } + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } else { + if (typeCase_ == 12) { + return baseImageBuilder_.getMessage(); + } + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public Builder setBaseImage(io.grafeas.v1beta1.image.Basis value) { + if (baseImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + baseImageBuilder_.setMessage(value); + } + typeCase_ = 12; + return this; + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public Builder setBaseImage( + io.grafeas.v1beta1.image.Basis.Builder builderForValue) { + if (baseImageBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + baseImageBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 12; + return this; + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public Builder mergeBaseImage(io.grafeas.v1beta1.image.Basis value) { + if (baseImageBuilder_ == null) { + if (typeCase_ == 12 && + type_ != io.grafeas.v1beta1.image.Basis.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.image.Basis.newBuilder((io.grafeas.v1beta1.image.Basis) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 12) { + baseImageBuilder_.mergeFrom(value); + } + baseImageBuilder_.setMessage(value); + } + typeCase_ = 12; + return this; + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public Builder clearBaseImage() { + if (baseImageBuilder_ == null) { + if (typeCase_ == 12) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 12) { + typeCase_ = 0; + type_ = null; + } + baseImageBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public io.grafeas.v1beta1.image.Basis.Builder getBaseImageBuilder() { + return getBaseImageFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + public io.grafeas.v1beta1.image.BasisOrBuilder getBaseImageOrBuilder() { + if ((typeCase_ == 12) && (baseImageBuilder_ != null)) { + return baseImageBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 12) { + return (io.grafeas.v1beta1.image.Basis) type_; + } + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + } + /** + *
+     * A note describing a base image.
+     * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Basis, io.grafeas.v1beta1.image.Basis.Builder, io.grafeas.v1beta1.image.BasisOrBuilder> + getBaseImageFieldBuilder() { + if (baseImageBuilder_ == null) { + if (!(typeCase_ == 12)) { + type_ = io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + baseImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Basis, io.grafeas.v1beta1.image.Basis.Builder, io.grafeas.v1beta1.image.BasisOrBuilder>( + (io.grafeas.v1beta1.image.Basis) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 12; + onChanged();; + return baseImageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Package, io.grafeas.v1beta1.pkg.Package.Builder, io.grafeas.v1beta1.pkg.PackageOrBuilder> packageBuilder_; + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public boolean hasPackage() { + return typeCase_ == 13; + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public io.grafeas.v1beta1.pkg.Package getPackage() { + if (packageBuilder_ == null) { + if (typeCase_ == 13) { + return (io.grafeas.v1beta1.pkg.Package) type_; + } + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } else { + if (typeCase_ == 13) { + return packageBuilder_.getMessage(); + } + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public Builder setPackage(io.grafeas.v1beta1.pkg.Package value) { + if (packageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + packageBuilder_.setMessage(value); + } + typeCase_ = 13; + return this; + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public Builder setPackage( + io.grafeas.v1beta1.pkg.Package.Builder builderForValue) { + if (packageBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + packageBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 13; + return this; + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public Builder mergePackage(io.grafeas.v1beta1.pkg.Package value) { + if (packageBuilder_ == null) { + if (typeCase_ == 13 && + type_ != io.grafeas.v1beta1.pkg.Package.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.pkg.Package.newBuilder((io.grafeas.v1beta1.pkg.Package) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 13) { + packageBuilder_.mergeFrom(value); + } + packageBuilder_.setMessage(value); + } + typeCase_ = 13; + return this; + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public Builder clearPackage() { + if (packageBuilder_ == null) { + if (typeCase_ == 13) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 13) { + typeCase_ = 0; + type_ = null; + } + packageBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public io.grafeas.v1beta1.pkg.Package.Builder getPackageBuilder() { + return getPackageFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + public io.grafeas.v1beta1.pkg.PackageOrBuilder getPackageOrBuilder() { + if ((typeCase_ == 13) && (packageBuilder_ != null)) { + return packageBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 13) { + return (io.grafeas.v1beta1.pkg.Package) type_; + } + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + } + /** + *
+     * A note describing a package hosted by various package managers.
+     * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Package, io.grafeas.v1beta1.pkg.Package.Builder, io.grafeas.v1beta1.pkg.PackageOrBuilder> + getPackageFieldBuilder() { + if (packageBuilder_ == null) { + if (!(typeCase_ == 13)) { + type_ = io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + packageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Package, io.grafeas.v1beta1.pkg.Package.Builder, io.grafeas.v1beta1.pkg.PackageOrBuilder>( + (io.grafeas.v1beta1.pkg.Package) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 13; + onChanged();; + return packageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployable, io.grafeas.v1beta1.deployment.Deployable.Builder, io.grafeas.v1beta1.deployment.DeployableOrBuilder> deployableBuilder_; + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public boolean hasDeployable() { + return typeCase_ == 14; + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public io.grafeas.v1beta1.deployment.Deployable getDeployable() { + if (deployableBuilder_ == null) { + if (typeCase_ == 14) { + return (io.grafeas.v1beta1.deployment.Deployable) type_; + } + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } else { + if (typeCase_ == 14) { + return deployableBuilder_.getMessage(); + } + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public Builder setDeployable(io.grafeas.v1beta1.deployment.Deployable value) { + if (deployableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + deployableBuilder_.setMessage(value); + } + typeCase_ = 14; + return this; + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public Builder setDeployable( + io.grafeas.v1beta1.deployment.Deployable.Builder builderForValue) { + if (deployableBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + deployableBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 14; + return this; + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public Builder mergeDeployable(io.grafeas.v1beta1.deployment.Deployable value) { + if (deployableBuilder_ == null) { + if (typeCase_ == 14 && + type_ != io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.deployment.Deployable.newBuilder((io.grafeas.v1beta1.deployment.Deployable) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 14) { + deployableBuilder_.mergeFrom(value); + } + deployableBuilder_.setMessage(value); + } + typeCase_ = 14; + return this; + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public Builder clearDeployable() { + if (deployableBuilder_ == null) { + if (typeCase_ == 14) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 14) { + typeCase_ = 0; + type_ = null; + } + deployableBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public io.grafeas.v1beta1.deployment.Deployable.Builder getDeployableBuilder() { + return getDeployableFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + public io.grafeas.v1beta1.deployment.DeployableOrBuilder getDeployableOrBuilder() { + if ((typeCase_ == 14) && (deployableBuilder_ != null)) { + return deployableBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 14) { + return (io.grafeas.v1beta1.deployment.Deployable) type_; + } + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + } + /** + *
+     * A note describing something that can be deployed.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployable, io.grafeas.v1beta1.deployment.Deployable.Builder, io.grafeas.v1beta1.deployment.DeployableOrBuilder> + getDeployableFieldBuilder() { + if (deployableBuilder_ == null) { + if (!(typeCase_ == 14)) { + type_ = io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + deployableBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployable, io.grafeas.v1beta1.deployment.Deployable.Builder, io.grafeas.v1beta1.deployment.DeployableOrBuilder>( + (io.grafeas.v1beta1.deployment.Deployable) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 14; + onChanged();; + return deployableBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovery, io.grafeas.v1beta1.discovery.Discovery.Builder, io.grafeas.v1beta1.discovery.DiscoveryOrBuilder> discoveryBuilder_; + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public boolean hasDiscovery() { + return typeCase_ == 15; + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public io.grafeas.v1beta1.discovery.Discovery getDiscovery() { + if (discoveryBuilder_ == null) { + if (typeCase_ == 15) { + return (io.grafeas.v1beta1.discovery.Discovery) type_; + } + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } else { + if (typeCase_ == 15) { + return discoveryBuilder_.getMessage(); + } + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public Builder setDiscovery(io.grafeas.v1beta1.discovery.Discovery value) { + if (discoveryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + discoveryBuilder_.setMessage(value); + } + typeCase_ = 15; + return this; + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public Builder setDiscovery( + io.grafeas.v1beta1.discovery.Discovery.Builder builderForValue) { + if (discoveryBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + discoveryBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 15; + return this; + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public Builder mergeDiscovery(io.grafeas.v1beta1.discovery.Discovery value) { + if (discoveryBuilder_ == null) { + if (typeCase_ == 15 && + type_ != io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.discovery.Discovery.newBuilder((io.grafeas.v1beta1.discovery.Discovery) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 15) { + discoveryBuilder_.mergeFrom(value); + } + discoveryBuilder_.setMessage(value); + } + typeCase_ = 15; + return this; + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public Builder clearDiscovery() { + if (discoveryBuilder_ == null) { + if (typeCase_ == 15) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 15) { + typeCase_ = 0; + type_ = null; + } + discoveryBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public io.grafeas.v1beta1.discovery.Discovery.Builder getDiscoveryBuilder() { + return getDiscoveryFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + public io.grafeas.v1beta1.discovery.DiscoveryOrBuilder getDiscoveryOrBuilder() { + if ((typeCase_ == 15) && (discoveryBuilder_ != null)) { + return discoveryBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 15) { + return (io.grafeas.v1beta1.discovery.Discovery) type_; + } + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + } + /** + *
+     * A note describing the initial analysis of a resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovery, io.grafeas.v1beta1.discovery.Discovery.Builder, io.grafeas.v1beta1.discovery.DiscoveryOrBuilder> + getDiscoveryFieldBuilder() { + if (discoveryBuilder_ == null) { + if (!(typeCase_ == 15)) { + type_ = io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + discoveryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovery, io.grafeas.v1beta1.discovery.Discovery.Builder, io.grafeas.v1beta1.discovery.DiscoveryOrBuilder>( + (io.grafeas.v1beta1.discovery.Discovery) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 15; + onChanged();; + return discoveryBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority, io.grafeas.v1beta1.attestation.Authority.Builder, io.grafeas.v1beta1.attestation.AuthorityOrBuilder> attestationAuthorityBuilder_; + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public boolean hasAttestationAuthority() { + return typeCase_ == 16; + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public io.grafeas.v1beta1.attestation.Authority getAttestationAuthority() { + if (attestationAuthorityBuilder_ == null) { + if (typeCase_ == 16) { + return (io.grafeas.v1beta1.attestation.Authority) type_; + } + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } else { + if (typeCase_ == 16) { + return attestationAuthorityBuilder_.getMessage(); + } + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public Builder setAttestationAuthority(io.grafeas.v1beta1.attestation.Authority value) { + if (attestationAuthorityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + attestationAuthorityBuilder_.setMessage(value); + } + typeCase_ = 16; + return this; + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public Builder setAttestationAuthority( + io.grafeas.v1beta1.attestation.Authority.Builder builderForValue) { + if (attestationAuthorityBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + attestationAuthorityBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 16; + return this; + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public Builder mergeAttestationAuthority(io.grafeas.v1beta1.attestation.Authority value) { + if (attestationAuthorityBuilder_ == null) { + if (typeCase_ == 16 && + type_ != io.grafeas.v1beta1.attestation.Authority.getDefaultInstance()) { + type_ = io.grafeas.v1beta1.attestation.Authority.newBuilder((io.grafeas.v1beta1.attestation.Authority) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 16) { + attestationAuthorityBuilder_.mergeFrom(value); + } + attestationAuthorityBuilder_.setMessage(value); + } + typeCase_ = 16; + return this; + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public Builder clearAttestationAuthority() { + if (attestationAuthorityBuilder_ == null) { + if (typeCase_ == 16) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 16) { + typeCase_ = 0; + type_ = null; + } + attestationAuthorityBuilder_.clear(); + } + return this; + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public io.grafeas.v1beta1.attestation.Authority.Builder getAttestationAuthorityBuilder() { + return getAttestationAuthorityFieldBuilder().getBuilder(); + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + public io.grafeas.v1beta1.attestation.AuthorityOrBuilder getAttestationAuthorityOrBuilder() { + if ((typeCase_ == 16) && (attestationAuthorityBuilder_ != null)) { + return attestationAuthorityBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 16) { + return (io.grafeas.v1beta1.attestation.Authority) type_; + } + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + } + /** + *
+     * A note describing an attestation role.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority, io.grafeas.v1beta1.attestation.Authority.Builder, io.grafeas.v1beta1.attestation.AuthorityOrBuilder> + getAttestationAuthorityFieldBuilder() { + if (attestationAuthorityBuilder_ == null) { + if (!(typeCase_ == 16)) { + type_ = io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + attestationAuthorityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority, io.grafeas.v1beta1.attestation.Authority.Builder, io.grafeas.v1beta1.attestation.AuthorityOrBuilder>( + (io.grafeas.v1beta1.attestation.Authority) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 16; + onChanged();; + return attestationAuthorityBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.Note) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.Note) + private static final io.grafeas.v1beta1.Note DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.Note(); + } + + public static io.grafeas.v1beta1.Note getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Note parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Note(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.Note getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/NoteName.java new file mode 100644 index 000000000000..373388991494 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/NoteOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/NoteOrBuilder.java new file mode 100644 index 000000000000..ebc5ba7d9627 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/NoteOrBuilder.java @@ -0,0 +1,421 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface NoteOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.Note) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Output only. The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * A one sentence description of this note.
+   * 
+ * + * string short_description = 2; + */ + java.lang.String getShortDescription(); + /** + *
+   * A one sentence description of this note.
+   * 
+ * + * string short_description = 2; + */ + com.google.protobuf.ByteString + getShortDescriptionBytes(); + + /** + *
+   * A detailed description of this note.
+   * 
+ * + * string long_description = 3; + */ + java.lang.String getLongDescription(); + /** + *
+   * A detailed description of this note.
+   * 
+ * + * string long_description = 3; + */ + com.google.protobuf.ByteString + getLongDescriptionBytes(); + + /** + *
+   * Output only. The type of analysis. This field can be used as a filter in
+   * list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + int getKindValue(); + /** + *
+   * Output only. The type of analysis. This field can be used as a filter in
+   * list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + io.grafeas.v1beta1.common.NoteKind getKind(); + + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + java.util.List + getRelatedUrlList(); + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + io.grafeas.v1beta1.common.RelatedUrl getRelatedUrl(int index); + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + int getRelatedUrlCount(); + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + java.util.List + getRelatedUrlOrBuilderList(); + /** + *
+   * URLs associated with this note.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_url = 5; + */ + io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlOrBuilder( + int index); + + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + boolean hasExpirationTime(); + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + com.google.protobuf.Timestamp getExpirationTime(); + /** + *
+   * Time of expiration for this note. Empty if note does not expire.
+   * 
+ * + * .google.protobuf.Timestamp expiration_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getExpirationTimeOrBuilder(); + + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + boolean hasCreateTime(); + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only. The time this note was created. This field can be used as a
+   * filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + boolean hasUpdateTime(); + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * Output only. The time this note was last updated. This field can be used as
+   * a filter in list requests.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 8; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + java.util.List + getRelatedNoteNamesList(); + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + int getRelatedNoteNamesCount(); + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + java.lang.String getRelatedNoteNames(int index); + /** + *
+   * Other notes related to this note.
+   * 
+ * + * repeated string related_note_names = 9; + */ + com.google.protobuf.ByteString + getRelatedNoteNamesBytes(int index); + + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + boolean hasVulnerability(); + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + io.grafeas.v1beta1.vulnerability.Vulnerability getVulnerability(); + /** + *
+   * A note describing a package vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder getVulnerabilityOrBuilder(); + + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + boolean hasBuild(); + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + io.grafeas.v1beta1.build.Build getBuild(); + /** + *
+   * A note describing build provenance for a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Build build = 11; + */ + io.grafeas.v1beta1.build.BuildOrBuilder getBuildOrBuilder(); + + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + boolean hasBaseImage(); + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + io.grafeas.v1beta1.image.Basis getBaseImage(); + /** + *
+   * A note describing a base image.
+   * 
+ * + * .grafeas.v1beta1.image.Basis base_image = 12; + */ + io.grafeas.v1beta1.image.BasisOrBuilder getBaseImageOrBuilder(); + + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + boolean hasPackage(); + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + io.grafeas.v1beta1.pkg.Package getPackage(); + /** + *
+   * A note describing a package hosted by various package managers.
+   * 
+ * + * .grafeas.v1beta1.package.Package package = 13; + */ + io.grafeas.v1beta1.pkg.PackageOrBuilder getPackageOrBuilder(); + + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + boolean hasDeployable(); + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + io.grafeas.v1beta1.deployment.Deployable getDeployable(); + /** + *
+   * A note describing something that can be deployed.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployable deployable = 14; + */ + io.grafeas.v1beta1.deployment.DeployableOrBuilder getDeployableOrBuilder(); + + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + boolean hasDiscovery(); + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + io.grafeas.v1beta1.discovery.Discovery getDiscovery(); + /** + *
+   * A note describing the initial analysis of a resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovery discovery = 15; + */ + io.grafeas.v1beta1.discovery.DiscoveryOrBuilder getDiscoveryOrBuilder(); + + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + boolean hasAttestationAuthority(); + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + io.grafeas.v1beta1.attestation.Authority getAttestationAuthority(); + /** + *
+   * A note describing an attestation role.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority attestation_authority = 16; + */ + io.grafeas.v1beta1.attestation.AuthorityOrBuilder getAttestationAuthorityOrBuilder(); + + public io.grafeas.v1beta1.Note.TypeCase getTypeCase(); +} 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 new file mode 100644 index 000000000000..3428848cd8cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Occurrence.java @@ -0,0 +1,3559 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * An instance of an analysis type that has been found on a resource.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.Occurrence} + */ +public final class Occurrence extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.Occurrence) + OccurrenceOrBuilder { +private static final long serialVersionUID = 0L; + // Use Occurrence.newBuilder() to construct. + private Occurrence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Occurrence() { + name_ = ""; + noteName_ = ""; + kind_ = 0; + remediation_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Occurrence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.Resource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = input.readMessage(io.grafeas.v1beta1.Resource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + noteName_ = s; + break; + } + case 32: { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + remediation_ = s; + break; + } + case 50: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + io.grafeas.v1beta1.vulnerability.Details.Builder subBuilder = null; + if (detailsCase_ == 8) { + subBuilder = ((io.grafeas.v1beta1.vulnerability.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.vulnerability.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.vulnerability.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 8; + break; + } + case 74: { + io.grafeas.v1beta1.build.Details.Builder subBuilder = null; + if (detailsCase_ == 9) { + subBuilder = ((io.grafeas.v1beta1.build.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.build.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.build.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 9; + break; + } + case 82: { + io.grafeas.v1beta1.image.Details.Builder subBuilder = null; + if (detailsCase_ == 10) { + subBuilder = ((io.grafeas.v1beta1.image.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.image.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.image.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 10; + break; + } + case 90: { + io.grafeas.v1beta1.pkg.Details.Builder subBuilder = null; + if (detailsCase_ == 11) { + subBuilder = ((io.grafeas.v1beta1.pkg.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.pkg.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.pkg.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 11; + break; + } + case 98: { + io.grafeas.v1beta1.deployment.Details.Builder subBuilder = null; + if (detailsCase_ == 12) { + subBuilder = ((io.grafeas.v1beta1.deployment.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.deployment.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.deployment.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 12; + break; + } + case 106: { + io.grafeas.v1beta1.discovery.Details.Builder subBuilder = null; + if (detailsCase_ == 13) { + subBuilder = ((io.grafeas.v1beta1.discovery.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.discovery.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.discovery.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 13; + break; + } + case 114: { + io.grafeas.v1beta1.attestation.Details.Builder subBuilder = null; + if (detailsCase_ == 14) { + subBuilder = ((io.grafeas.v1beta1.attestation.Details) details_).toBuilder(); + } + details_ = + input.readMessage(io.grafeas.v1beta1.attestation.Details.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.attestation.Details) details_); + details_ = subBuilder.buildPartial(); + } + detailsCase_ = 14; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Occurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Occurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Occurrence.class, io.grafeas.v1beta1.Occurrence.Builder.class); + } + + private int detailsCase_ = 0; + private java.lang.Object details_; + public enum DetailsCase + implements com.google.protobuf.Internal.EnumLite { + VULNERABILITY(8), + BUILD(9), + DERIVED_IMAGE(10), + INSTALLATION(11), + DEPLOYMENT(12), + DISCOVERED(13), + ATTESTATION(14), + DETAILS_NOT_SET(0); + private final int value; + private DetailsCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DetailsCase valueOf(int value) { + return forNumber(value); + } + + public static DetailsCase forNumber(int value) { + switch (value) { + case 8: return VULNERABILITY; + case 9: return BUILD; + case 10: return DERIVED_IMAGE; + case 11: return INSTALLATION; + case 12: return DEPLOYMENT; + case 13: return DISCOVERED; + case 14: return ATTESTATION; + case 0: return DETAILS_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DetailsCase + getDetailsCase() { + return DetailsCase.forNumber( + detailsCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Output only. The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Output only. The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.Resource resource_; + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public boolean hasResource() { + return resource_ != null; + } + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public io.grafeas.v1beta1.Resource getResource() { + return resource_ == null ? io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int NOTE_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object noteName_; + /** + *
+   * Required. Immutable. The analysis note associated with this occurrence, in
+   * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+   * as a filter in list requests.
+   * 
+ * + * string note_name = 3; + */ + public java.lang.String getNoteName() { + java.lang.Object ref = noteName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + noteName_ = s; + return s; + } + } + /** + *
+   * Required. Immutable. The analysis note associated with this occurrence, in
+   * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+   * as a filter in list requests.
+   * 
+ * + * string note_name = 3; + */ + public com.google.protobuf.ByteString + getNoteNameBytes() { + java.lang.Object ref = noteName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + noteName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + private int kind_; + /** + *
+   * Output only. This explicitly denotes which of the occurrence details are
+   * specified. This field can be used as a filter in list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+   * Output only. This explicitly denotes which of the occurrence details are
+   * specified. This field can be used as a filter in list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public io.grafeas.v1beta1.common.NoteKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + + public static final int REMEDIATION_FIELD_NUMBER = 5; + private volatile java.lang.Object remediation_; + /** + *
+   * A description of actions that can be taken to remedy the note.
+   * 
+ * + * string remediation = 5; + */ + public java.lang.String getRemediation() { + java.lang.Object ref = remediation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remediation_ = s; + return s; + } + } + /** + *
+   * A description of actions that can be taken to remedy the note.
+   * 
+ * + * string remediation = 5; + */ + public com.google.protobuf.ByteString + getRemediationBytes() { + java.lang.Object ref = remediation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remediation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp updateTime_; + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int VULNERABILITY_FIELD_NUMBER = 8; + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public boolean hasVulnerability() { + return detailsCase_ == 8; + } + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public io.grafeas.v1beta1.vulnerability.Details getVulnerability() { + if (detailsCase_ == 8) { + return (io.grafeas.v1beta1.vulnerability.Details) details_; + } + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public io.grafeas.v1beta1.vulnerability.DetailsOrBuilder getVulnerabilityOrBuilder() { + if (detailsCase_ == 8) { + return (io.grafeas.v1beta1.vulnerability.Details) details_; + } + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + + public static final int BUILD_FIELD_NUMBER = 9; + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public boolean hasBuild() { + return detailsCase_ == 9; + } + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public io.grafeas.v1beta1.build.Details getBuild() { + if (detailsCase_ == 9) { + return (io.grafeas.v1beta1.build.Details) details_; + } + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public io.grafeas.v1beta1.build.DetailsOrBuilder getBuildOrBuilder() { + if (detailsCase_ == 9) { + return (io.grafeas.v1beta1.build.Details) details_; + } + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + + public static final int DERIVED_IMAGE_FIELD_NUMBER = 10; + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public boolean hasDerivedImage() { + return detailsCase_ == 10; + } + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public io.grafeas.v1beta1.image.Details getDerivedImage() { + if (detailsCase_ == 10) { + return (io.grafeas.v1beta1.image.Details) details_; + } + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public io.grafeas.v1beta1.image.DetailsOrBuilder getDerivedImageOrBuilder() { + if (detailsCase_ == 10) { + return (io.grafeas.v1beta1.image.Details) details_; + } + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + + public static final int INSTALLATION_FIELD_NUMBER = 11; + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public boolean hasInstallation() { + return detailsCase_ == 11; + } + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public io.grafeas.v1beta1.pkg.Details getInstallation() { + if (detailsCase_ == 11) { + return (io.grafeas.v1beta1.pkg.Details) details_; + } + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public io.grafeas.v1beta1.pkg.DetailsOrBuilder getInstallationOrBuilder() { + if (detailsCase_ == 11) { + return (io.grafeas.v1beta1.pkg.Details) details_; + } + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + + public static final int DEPLOYMENT_FIELD_NUMBER = 12; + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public boolean hasDeployment() { + return detailsCase_ == 12; + } + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public io.grafeas.v1beta1.deployment.Details getDeployment() { + if (detailsCase_ == 12) { + return (io.grafeas.v1beta1.deployment.Details) details_; + } + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public io.grafeas.v1beta1.deployment.DetailsOrBuilder getDeploymentOrBuilder() { + if (detailsCase_ == 12) { + return (io.grafeas.v1beta1.deployment.Details) details_; + } + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + + public static final int DISCOVERED_FIELD_NUMBER = 13; + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public boolean hasDiscovered() { + return detailsCase_ == 13; + } + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public io.grafeas.v1beta1.discovery.Details getDiscovered() { + if (detailsCase_ == 13) { + return (io.grafeas.v1beta1.discovery.Details) details_; + } + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public io.grafeas.v1beta1.discovery.DetailsOrBuilder getDiscoveredOrBuilder() { + if (detailsCase_ == 13) { + return (io.grafeas.v1beta1.discovery.Details) details_; + } + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + + public static final int ATTESTATION_FIELD_NUMBER = 14; + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public boolean hasAttestation() { + return detailsCase_ == 14; + } + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public io.grafeas.v1beta1.attestation.Details getAttestation() { + if (detailsCase_ == 14) { + return (io.grafeas.v1beta1.attestation.Details) details_; + } + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public io.grafeas.v1beta1.attestation.DetailsOrBuilder getAttestationOrBuilder() { + if (detailsCase_ == 14) { + return (io.grafeas.v1beta1.attestation.Details) details_; + } + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (resource_ != null) { + output.writeMessage(2, getResource()); + } + if (!getNoteNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, noteName_); + } + if (kind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(4, kind_); + } + if (!getRemediationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, remediation_); + } + if (createTime_ != null) { + output.writeMessage(6, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(7, getUpdateTime()); + } + if (detailsCase_ == 8) { + output.writeMessage(8, (io.grafeas.v1beta1.vulnerability.Details) details_); + } + if (detailsCase_ == 9) { + output.writeMessage(9, (io.grafeas.v1beta1.build.Details) details_); + } + if (detailsCase_ == 10) { + output.writeMessage(10, (io.grafeas.v1beta1.image.Details) details_); + } + if (detailsCase_ == 11) { + output.writeMessage(11, (io.grafeas.v1beta1.pkg.Details) details_); + } + if (detailsCase_ == 12) { + output.writeMessage(12, (io.grafeas.v1beta1.deployment.Details) details_); + } + if (detailsCase_ == 13) { + output.writeMessage(13, (io.grafeas.v1beta1.discovery.Details) details_); + } + if (detailsCase_ == 14) { + output.writeMessage(14, (io.grafeas.v1beta1.attestation.Details) details_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getResource()); + } + if (!getNoteNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, noteName_); + } + if (kind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kind_); + } + if (!getRemediationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, remediation_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getUpdateTime()); + } + if (detailsCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (io.grafeas.v1beta1.vulnerability.Details) details_); + } + if (detailsCase_ == 9) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(9, (io.grafeas.v1beta1.build.Details) details_); + } + if (detailsCase_ == 10) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, (io.grafeas.v1beta1.image.Details) details_); + } + if (detailsCase_ == 11) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, (io.grafeas.v1beta1.pkg.Details) details_); + } + if (detailsCase_ == 12) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, (io.grafeas.v1beta1.deployment.Details) details_); + } + if (detailsCase_ == 13) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, (io.grafeas.v1beta1.discovery.Details) details_); + } + if (detailsCase_ == 14) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(14, (io.grafeas.v1beta1.attestation.Details) details_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.Occurrence)) { + return super.equals(obj); + } + io.grafeas.v1beta1.Occurrence other = (io.grafeas.v1beta1.Occurrence) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasResource() == other.hasResource()); + if (hasResource()) { + result = result && getResource() + .equals(other.getResource()); + } + result = result && getNoteName() + .equals(other.getNoteName()); + result = result && kind_ == other.kind_; + result = result && getRemediation() + .equals(other.getRemediation()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasUpdateTime() == other.hasUpdateTime()); + if (hasUpdateTime()) { + result = result && getUpdateTime() + .equals(other.getUpdateTime()); + } + result = result && getDetailsCase().equals( + other.getDetailsCase()); + if (!result) return false; + switch (detailsCase_) { + case 8: + result = result && getVulnerability() + .equals(other.getVulnerability()); + break; + case 9: + result = result && getBuild() + .equals(other.getBuild()); + break; + case 10: + result = result && getDerivedImage() + .equals(other.getDerivedImage()); + break; + case 11: + result = result && getInstallation() + .equals(other.getInstallation()); + break; + case 12: + result = result && getDeployment() + .equals(other.getDeployment()); + break; + case 13: + result = result && getDiscovered() + .equals(other.getDiscovered()); + break; + case 14: + result = result && getAttestation() + .equals(other.getAttestation()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (37 * hash) + NOTE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getNoteName().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + hash = (37 * hash) + REMEDIATION_FIELD_NUMBER; + hash = (53 * hash) + getRemediation().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + switch (detailsCase_) { + case 8: + hash = (37 * hash) + VULNERABILITY_FIELD_NUMBER; + hash = (53 * hash) + getVulnerability().hashCode(); + break; + case 9: + hash = (37 * hash) + BUILD_FIELD_NUMBER; + hash = (53 * hash) + getBuild().hashCode(); + break; + case 10: + hash = (37 * hash) + DERIVED_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getDerivedImage().hashCode(); + break; + case 11: + hash = (37 * hash) + INSTALLATION_FIELD_NUMBER; + hash = (53 * hash) + getInstallation().hashCode(); + break; + case 12: + hash = (37 * hash) + DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getDeployment().hashCode(); + break; + case 13: + hash = (37 * hash) + DISCOVERED_FIELD_NUMBER; + hash = (53 * hash) + getDiscovered().hashCode(); + break; + case 14: + hash = (37 * hash) + ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getAttestation().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.Occurrence parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Occurrence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Occurrence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Occurrence parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Occurrence parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Occurrence parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.Occurrence prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An instance of an analysis type that has been found on a resource.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.Occurrence} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.Occurrence) + io.grafeas.v1beta1.OccurrenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Occurrence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Occurrence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Occurrence.class, io.grafeas.v1beta1.Occurrence.Builder.class); + } + + // Construct using io.grafeas.v1beta1.Occurrence.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + noteName_ = ""; + + kind_ = 0; + + remediation_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + detailsCase_ = 0; + details_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Occurrence_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.Occurrence getDefaultInstanceForType() { + return io.grafeas.v1beta1.Occurrence.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.Occurrence build() { + io.grafeas.v1beta1.Occurrence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.Occurrence buildPartial() { + io.grafeas.v1beta1.Occurrence result = new io.grafeas.v1beta1.Occurrence(this); + result.name_ = name_; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + result.noteName_ = noteName_; + result.kind_ = kind_; + result.remediation_ = remediation_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + if (detailsCase_ == 8) { + if (vulnerabilityBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = vulnerabilityBuilder_.build(); + } + } + if (detailsCase_ == 9) { + if (buildBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = buildBuilder_.build(); + } + } + if (detailsCase_ == 10) { + if (derivedImageBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = derivedImageBuilder_.build(); + } + } + if (detailsCase_ == 11) { + if (installationBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = installationBuilder_.build(); + } + } + if (detailsCase_ == 12) { + if (deploymentBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = deploymentBuilder_.build(); + } + } + if (detailsCase_ == 13) { + if (discoveredBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = discoveredBuilder_.build(); + } + } + if (detailsCase_ == 14) { + if (attestationBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = attestationBuilder_.build(); + } + } + result.detailsCase_ = detailsCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.Occurrence) { + return mergeFrom((io.grafeas.v1beta1.Occurrence)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.Occurrence other) { + if (other == io.grafeas.v1beta1.Occurrence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (!other.getNoteName().isEmpty()) { + noteName_ = other.noteName_; + onChanged(); + } + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + if (!other.getRemediation().isEmpty()) { + remediation_ = other.remediation_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + switch (other.getDetailsCase()) { + case VULNERABILITY: { + mergeVulnerability(other.getVulnerability()); + break; + } + case BUILD: { + mergeBuild(other.getBuild()); + break; + } + case DERIVED_IMAGE: { + mergeDerivedImage(other.getDerivedImage()); + break; + } + case INSTALLATION: { + mergeInstallation(other.getInstallation()); + break; + } + case DEPLOYMENT: { + mergeDeployment(other.getDeployment()); + break; + } + case DISCOVERED: { + mergeDiscovered(other.getDiscovered()); + break; + } + case ATTESTATION: { + mergeAttestation(other.getAttestation()); + break; + } + case DETAILS_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.Occurrence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.Occurrence) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int detailsCase_ = 0; + private java.lang.Object details_; + public DetailsCase + getDetailsCase() { + return DetailsCase.forNumber( + detailsCase_); + } + + public Builder clearDetails() { + detailsCase_ = 0; + details_ = null; + onChanged(); + return this; + } + + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.Resource resource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder> resourceBuilder_; + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public io.grafeas.v1beta1.Resource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null ? io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public Builder setResource(io.grafeas.v1beta1.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public Builder setResource( + io.grafeas.v1beta1.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public Builder mergeResource(io.grafeas.v1beta1.Resource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + io.grafeas.v1beta1.Resource.newBuilder(resource_).mergeFrom(value).buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public io.grafeas.v1beta1.Resource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + public io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null ? + io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } + } + /** + *
+     * Required. Immutable. The resource for which the occurrence applies.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder>( + getResource(), + getParentForChildren(), + isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private java.lang.Object noteName_ = ""; + /** + *
+     * Required. Immutable. The analysis note associated with this occurrence, in
+     * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+     * as a filter in list requests.
+     * 
+ * + * string note_name = 3; + */ + public java.lang.String getNoteName() { + java.lang.Object ref = noteName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + noteName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Required. Immutable. The analysis note associated with this occurrence, in
+     * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+     * as a filter in list requests.
+     * 
+ * + * string note_name = 3; + */ + public com.google.protobuf.ByteString + getNoteNameBytes() { + java.lang.Object ref = noteName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + noteName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Required. Immutable. The analysis note associated with this occurrence, in
+     * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+     * as a filter in list requests.
+     * 
+ * + * string note_name = 3; + */ + public Builder setNoteName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + noteName_ = value; + onChanged(); + return this; + } + /** + *
+     * Required. Immutable. The analysis note associated with this occurrence, in
+     * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+     * as a filter in list requests.
+     * 
+ * + * string note_name = 3; + */ + public Builder clearNoteName() { + + noteName_ = getDefaultInstance().getNoteName(); + onChanged(); + return this; + } + /** + *
+     * Required. Immutable. The analysis note associated with this occurrence, in
+     * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+     * as a filter in list requests.
+     * 
+ * + * string note_name = 3; + */ + public Builder setNoteNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + noteName_ = value; + onChanged(); + return this; + } + + private int kind_ = 0; + /** + *
+     * Output only. This explicitly denotes which of the occurrence details are
+     * specified. This field can be used as a filter in list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+     * Output only. This explicitly denotes which of the occurrence details are
+     * specified. This field can be used as a filter in list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder setKindValue(int value) { + kind_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. This explicitly denotes which of the occurrence details are
+     * specified. This field can be used as a filter in list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public io.grafeas.v1beta1.common.NoteKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + /** + *
+     * Output only. This explicitly denotes which of the occurrence details are
+     * specified. This field can be used as a filter in list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder setKind(io.grafeas.v1beta1.common.NoteKind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. This explicitly denotes which of the occurrence details are
+     * specified. This field can be used as a filter in list requests.
+     * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object remediation_ = ""; + /** + *
+     * A description of actions that can be taken to remedy the note.
+     * 
+ * + * string remediation = 5; + */ + public java.lang.String getRemediation() { + java.lang.Object ref = remediation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + remediation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A description of actions that can be taken to remedy the note.
+     * 
+ * + * string remediation = 5; + */ + public com.google.protobuf.ByteString + getRemediationBytes() { + java.lang.Object ref = remediation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + remediation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A description of actions that can be taken to remedy the note.
+     * 
+ * + * string remediation = 5; + */ + public Builder setRemediation( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + remediation_ = value; + onChanged(); + return this; + } + /** + *
+     * A description of actions that can be taken to remedy the note.
+     * 
+ * + * string remediation = 5; + */ + public Builder clearRemediation() { + + remediation_ = getDefaultInstance().getRemediation(); + onChanged(); + return this; + } + /** + *
+     * A description of actions that can be taken to remedy the note.
+     * 
+ * + * string remediation = 5; + */ + public Builder setRemediationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + remediation_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Output only. The time this occurrence was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> updateTimeBuilder_; + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder setUpdateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + } + /** + *
+     * Output only. The time this occurrence was last updated.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), + getParentForChildren(), + isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Details, io.grafeas.v1beta1.vulnerability.Details.Builder, io.grafeas.v1beta1.vulnerability.DetailsOrBuilder> vulnerabilityBuilder_; + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public boolean hasVulnerability() { + return detailsCase_ == 8; + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public io.grafeas.v1beta1.vulnerability.Details getVulnerability() { + if (vulnerabilityBuilder_ == null) { + if (detailsCase_ == 8) { + return (io.grafeas.v1beta1.vulnerability.Details) details_; + } + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 8) { + return vulnerabilityBuilder_.getMessage(); + } + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public Builder setVulnerability(io.grafeas.v1beta1.vulnerability.Details value) { + if (vulnerabilityBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + vulnerabilityBuilder_.setMessage(value); + } + detailsCase_ = 8; + return this; + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public Builder setVulnerability( + io.grafeas.v1beta1.vulnerability.Details.Builder builderForValue) { + if (vulnerabilityBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + vulnerabilityBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 8; + return this; + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public Builder mergeVulnerability(io.grafeas.v1beta1.vulnerability.Details value) { + if (vulnerabilityBuilder_ == null) { + if (detailsCase_ == 8 && + details_ != io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.vulnerability.Details.newBuilder((io.grafeas.v1beta1.vulnerability.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 8) { + vulnerabilityBuilder_.mergeFrom(value); + } + vulnerabilityBuilder_.setMessage(value); + } + detailsCase_ = 8; + return this; + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public Builder clearVulnerability() { + if (vulnerabilityBuilder_ == null) { + if (detailsCase_ == 8) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 8) { + detailsCase_ = 0; + details_ = null; + } + vulnerabilityBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public io.grafeas.v1beta1.vulnerability.Details.Builder getVulnerabilityBuilder() { + return getVulnerabilityFieldBuilder().getBuilder(); + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + public io.grafeas.v1beta1.vulnerability.DetailsOrBuilder getVulnerabilityOrBuilder() { + if ((detailsCase_ == 8) && (vulnerabilityBuilder_ != null)) { + return vulnerabilityBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 8) { + return (io.grafeas.v1beta1.vulnerability.Details) details_; + } + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes a security vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Details, io.grafeas.v1beta1.vulnerability.Details.Builder, io.grafeas.v1beta1.vulnerability.DetailsOrBuilder> + getVulnerabilityFieldBuilder() { + if (vulnerabilityBuilder_ == null) { + if (!(detailsCase_ == 8)) { + details_ = io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + vulnerabilityBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Details, io.grafeas.v1beta1.vulnerability.Details.Builder, io.grafeas.v1beta1.vulnerability.DetailsOrBuilder>( + (io.grafeas.v1beta1.vulnerability.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 8; + onChanged();; + return vulnerabilityBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Details, io.grafeas.v1beta1.build.Details.Builder, io.grafeas.v1beta1.build.DetailsOrBuilder> buildBuilder_; + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public boolean hasBuild() { + return detailsCase_ == 9; + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public io.grafeas.v1beta1.build.Details getBuild() { + if (buildBuilder_ == null) { + if (detailsCase_ == 9) { + return (io.grafeas.v1beta1.build.Details) details_; + } + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 9) { + return buildBuilder_.getMessage(); + } + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public Builder setBuild(io.grafeas.v1beta1.build.Details value) { + if (buildBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + buildBuilder_.setMessage(value); + } + detailsCase_ = 9; + return this; + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public Builder setBuild( + io.grafeas.v1beta1.build.Details.Builder builderForValue) { + if (buildBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + buildBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 9; + return this; + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public Builder mergeBuild(io.grafeas.v1beta1.build.Details value) { + if (buildBuilder_ == null) { + if (detailsCase_ == 9 && + details_ != io.grafeas.v1beta1.build.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.build.Details.newBuilder((io.grafeas.v1beta1.build.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 9) { + buildBuilder_.mergeFrom(value); + } + buildBuilder_.setMessage(value); + } + detailsCase_ = 9; + return this; + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public Builder clearBuild() { + if (buildBuilder_ == null) { + if (detailsCase_ == 9) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 9) { + detailsCase_ = 0; + details_ = null; + } + buildBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public io.grafeas.v1beta1.build.Details.Builder getBuildBuilder() { + return getBuildFieldBuilder().getBuilder(); + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + public io.grafeas.v1beta1.build.DetailsOrBuilder getBuildOrBuilder() { + if ((detailsCase_ == 9) && (buildBuilder_ != null)) { + return buildBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 9) { + return (io.grafeas.v1beta1.build.Details) details_; + } + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes a verifiable build.
+     * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Details, io.grafeas.v1beta1.build.Details.Builder, io.grafeas.v1beta1.build.DetailsOrBuilder> + getBuildFieldBuilder() { + if (buildBuilder_ == null) { + if (!(detailsCase_ == 9)) { + details_ = io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + buildBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.Details, io.grafeas.v1beta1.build.Details.Builder, io.grafeas.v1beta1.build.DetailsOrBuilder>( + (io.grafeas.v1beta1.build.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 9; + onChanged();; + return buildBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Details, io.grafeas.v1beta1.image.Details.Builder, io.grafeas.v1beta1.image.DetailsOrBuilder> derivedImageBuilder_; + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public boolean hasDerivedImage() { + return detailsCase_ == 10; + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public io.grafeas.v1beta1.image.Details getDerivedImage() { + if (derivedImageBuilder_ == null) { + if (detailsCase_ == 10) { + return (io.grafeas.v1beta1.image.Details) details_; + } + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 10) { + return derivedImageBuilder_.getMessage(); + } + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public Builder setDerivedImage(io.grafeas.v1beta1.image.Details value) { + if (derivedImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + derivedImageBuilder_.setMessage(value); + } + detailsCase_ = 10; + return this; + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public Builder setDerivedImage( + io.grafeas.v1beta1.image.Details.Builder builderForValue) { + if (derivedImageBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + derivedImageBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 10; + return this; + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public Builder mergeDerivedImage(io.grafeas.v1beta1.image.Details value) { + if (derivedImageBuilder_ == null) { + if (detailsCase_ == 10 && + details_ != io.grafeas.v1beta1.image.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.image.Details.newBuilder((io.grafeas.v1beta1.image.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 10) { + derivedImageBuilder_.mergeFrom(value); + } + derivedImageBuilder_.setMessage(value); + } + detailsCase_ = 10; + return this; + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public Builder clearDerivedImage() { + if (derivedImageBuilder_ == null) { + if (detailsCase_ == 10) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 10) { + detailsCase_ = 0; + details_ = null; + } + derivedImageBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public io.grafeas.v1beta1.image.Details.Builder getDerivedImageBuilder() { + return getDerivedImageFieldBuilder().getBuilder(); + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + public io.grafeas.v1beta1.image.DetailsOrBuilder getDerivedImageOrBuilder() { + if ((detailsCase_ == 10) && (derivedImageBuilder_ != null)) { + return derivedImageBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 10) { + return (io.grafeas.v1beta1.image.Details) details_; + } + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes how this resource derives from the basis in the associated
+     * note.
+     * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Details, io.grafeas.v1beta1.image.Details.Builder, io.grafeas.v1beta1.image.DetailsOrBuilder> + getDerivedImageFieldBuilder() { + if (derivedImageBuilder_ == null) { + if (!(detailsCase_ == 10)) { + details_ = io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + derivedImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Details, io.grafeas.v1beta1.image.Details.Builder, io.grafeas.v1beta1.image.DetailsOrBuilder>( + (io.grafeas.v1beta1.image.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 10; + onChanged();; + return derivedImageBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Details, io.grafeas.v1beta1.pkg.Details.Builder, io.grafeas.v1beta1.pkg.DetailsOrBuilder> installationBuilder_; + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public boolean hasInstallation() { + return detailsCase_ == 11; + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public io.grafeas.v1beta1.pkg.Details getInstallation() { + if (installationBuilder_ == null) { + if (detailsCase_ == 11) { + return (io.grafeas.v1beta1.pkg.Details) details_; + } + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 11) { + return installationBuilder_.getMessage(); + } + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public Builder setInstallation(io.grafeas.v1beta1.pkg.Details value) { + if (installationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + installationBuilder_.setMessage(value); + } + detailsCase_ = 11; + return this; + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public Builder setInstallation( + io.grafeas.v1beta1.pkg.Details.Builder builderForValue) { + if (installationBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + installationBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 11; + return this; + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public Builder mergeInstallation(io.grafeas.v1beta1.pkg.Details value) { + if (installationBuilder_ == null) { + if (detailsCase_ == 11 && + details_ != io.grafeas.v1beta1.pkg.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.pkg.Details.newBuilder((io.grafeas.v1beta1.pkg.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 11) { + installationBuilder_.mergeFrom(value); + } + installationBuilder_.setMessage(value); + } + detailsCase_ = 11; + return this; + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public Builder clearInstallation() { + if (installationBuilder_ == null) { + if (detailsCase_ == 11) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 11) { + detailsCase_ = 0; + details_ = null; + } + installationBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public io.grafeas.v1beta1.pkg.Details.Builder getInstallationBuilder() { + return getInstallationFieldBuilder().getBuilder(); + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + public io.grafeas.v1beta1.pkg.DetailsOrBuilder getInstallationOrBuilder() { + if ((detailsCase_ == 11) && (installationBuilder_ != null)) { + return installationBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 11) { + return (io.grafeas.v1beta1.pkg.Details) details_; + } + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes the installation of a package on the linked resource.
+     * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Details, io.grafeas.v1beta1.pkg.Details.Builder, io.grafeas.v1beta1.pkg.DetailsOrBuilder> + getInstallationFieldBuilder() { + if (installationBuilder_ == null) { + if (!(detailsCase_ == 11)) { + details_ = io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + installationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Details, io.grafeas.v1beta1.pkg.Details.Builder, io.grafeas.v1beta1.pkg.DetailsOrBuilder>( + (io.grafeas.v1beta1.pkg.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 11; + onChanged();; + return installationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Details, io.grafeas.v1beta1.deployment.Details.Builder, io.grafeas.v1beta1.deployment.DetailsOrBuilder> deploymentBuilder_; + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public boolean hasDeployment() { + return detailsCase_ == 12; + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public io.grafeas.v1beta1.deployment.Details getDeployment() { + if (deploymentBuilder_ == null) { + if (detailsCase_ == 12) { + return (io.grafeas.v1beta1.deployment.Details) details_; + } + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 12) { + return deploymentBuilder_.getMessage(); + } + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public Builder setDeployment(io.grafeas.v1beta1.deployment.Details value) { + if (deploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + deploymentBuilder_.setMessage(value); + } + detailsCase_ = 12; + return this; + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public Builder setDeployment( + io.grafeas.v1beta1.deployment.Details.Builder builderForValue) { + if (deploymentBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + deploymentBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 12; + return this; + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public Builder mergeDeployment(io.grafeas.v1beta1.deployment.Details value) { + if (deploymentBuilder_ == null) { + if (detailsCase_ == 12 && + details_ != io.grafeas.v1beta1.deployment.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.deployment.Details.newBuilder((io.grafeas.v1beta1.deployment.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 12) { + deploymentBuilder_.mergeFrom(value); + } + deploymentBuilder_.setMessage(value); + } + detailsCase_ = 12; + return this; + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public Builder clearDeployment() { + if (deploymentBuilder_ == null) { + if (detailsCase_ == 12) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 12) { + detailsCase_ = 0; + details_ = null; + } + deploymentBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public io.grafeas.v1beta1.deployment.Details.Builder getDeploymentBuilder() { + return getDeploymentFieldBuilder().getBuilder(); + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + public io.grafeas.v1beta1.deployment.DetailsOrBuilder getDeploymentOrBuilder() { + if ((detailsCase_ == 12) && (deploymentBuilder_ != null)) { + return deploymentBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 12) { + return (io.grafeas.v1beta1.deployment.Details) details_; + } + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes the deployment of an artifact on a runtime.
+     * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Details, io.grafeas.v1beta1.deployment.Details.Builder, io.grafeas.v1beta1.deployment.DetailsOrBuilder> + getDeploymentFieldBuilder() { + if (deploymentBuilder_ == null) { + if (!(detailsCase_ == 12)) { + details_ = io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + deploymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Details, io.grafeas.v1beta1.deployment.Details.Builder, io.grafeas.v1beta1.deployment.DetailsOrBuilder>( + (io.grafeas.v1beta1.deployment.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 12; + onChanged();; + return deploymentBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Details, io.grafeas.v1beta1.discovery.Details.Builder, io.grafeas.v1beta1.discovery.DetailsOrBuilder> discoveredBuilder_; + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public boolean hasDiscovered() { + return detailsCase_ == 13; + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public io.grafeas.v1beta1.discovery.Details getDiscovered() { + if (discoveredBuilder_ == null) { + if (detailsCase_ == 13) { + return (io.grafeas.v1beta1.discovery.Details) details_; + } + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 13) { + return discoveredBuilder_.getMessage(); + } + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public Builder setDiscovered(io.grafeas.v1beta1.discovery.Details value) { + if (discoveredBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + discoveredBuilder_.setMessage(value); + } + detailsCase_ = 13; + return this; + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public Builder setDiscovered( + io.grafeas.v1beta1.discovery.Details.Builder builderForValue) { + if (discoveredBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + discoveredBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 13; + return this; + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public Builder mergeDiscovered(io.grafeas.v1beta1.discovery.Details value) { + if (discoveredBuilder_ == null) { + if (detailsCase_ == 13 && + details_ != io.grafeas.v1beta1.discovery.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.discovery.Details.newBuilder((io.grafeas.v1beta1.discovery.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 13) { + discoveredBuilder_.mergeFrom(value); + } + discoveredBuilder_.setMessage(value); + } + detailsCase_ = 13; + return this; + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public Builder clearDiscovered() { + if (discoveredBuilder_ == null) { + if (detailsCase_ == 13) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 13) { + detailsCase_ = 0; + details_ = null; + } + discoveredBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public io.grafeas.v1beta1.discovery.Details.Builder getDiscoveredBuilder() { + return getDiscoveredFieldBuilder().getBuilder(); + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + public io.grafeas.v1beta1.discovery.DetailsOrBuilder getDiscoveredOrBuilder() { + if ((detailsCase_ == 13) && (discoveredBuilder_ != null)) { + return discoveredBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 13) { + return (io.grafeas.v1beta1.discovery.Details) details_; + } + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes when a resource was discovered.
+     * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Details, io.grafeas.v1beta1.discovery.Details.Builder, io.grafeas.v1beta1.discovery.DetailsOrBuilder> + getDiscoveredFieldBuilder() { + if (discoveredBuilder_ == null) { + if (!(detailsCase_ == 13)) { + details_ = io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + discoveredBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Details, io.grafeas.v1beta1.discovery.Details.Builder, io.grafeas.v1beta1.discovery.DetailsOrBuilder>( + (io.grafeas.v1beta1.discovery.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 13; + onChanged();; + return discoveredBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Details, io.grafeas.v1beta1.attestation.Details.Builder, io.grafeas.v1beta1.attestation.DetailsOrBuilder> attestationBuilder_; + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public boolean hasAttestation() { + return detailsCase_ == 14; + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public io.grafeas.v1beta1.attestation.Details getAttestation() { + if (attestationBuilder_ == null) { + if (detailsCase_ == 14) { + return (io.grafeas.v1beta1.attestation.Details) details_; + } + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } else { + if (detailsCase_ == 14) { + return attestationBuilder_.getMessage(); + } + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public Builder setAttestation(io.grafeas.v1beta1.attestation.Details value) { + if (attestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + attestationBuilder_.setMessage(value); + } + detailsCase_ = 14; + return this; + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public Builder setAttestation( + io.grafeas.v1beta1.attestation.Details.Builder builderForValue) { + if (attestationBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + attestationBuilder_.setMessage(builderForValue.build()); + } + detailsCase_ = 14; + return this; + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public Builder mergeAttestation(io.grafeas.v1beta1.attestation.Details value) { + if (attestationBuilder_ == null) { + if (detailsCase_ == 14 && + details_ != io.grafeas.v1beta1.attestation.Details.getDefaultInstance()) { + details_ = io.grafeas.v1beta1.attestation.Details.newBuilder((io.grafeas.v1beta1.attestation.Details) details_) + .mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + if (detailsCase_ == 14) { + attestationBuilder_.mergeFrom(value); + } + attestationBuilder_.setMessage(value); + } + detailsCase_ = 14; + return this; + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public Builder clearAttestation() { + if (attestationBuilder_ == null) { + if (detailsCase_ == 14) { + detailsCase_ = 0; + details_ = null; + onChanged(); + } + } else { + if (detailsCase_ == 14) { + detailsCase_ = 0; + details_ = null; + } + attestationBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public io.grafeas.v1beta1.attestation.Details.Builder getAttestationBuilder() { + return getAttestationFieldBuilder().getBuilder(); + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + public io.grafeas.v1beta1.attestation.DetailsOrBuilder getAttestationOrBuilder() { + if ((detailsCase_ == 14) && (attestationBuilder_ != null)) { + return attestationBuilder_.getMessageOrBuilder(); + } else { + if (detailsCase_ == 14) { + return (io.grafeas.v1beta1.attestation.Details) details_; + } + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + } + /** + *
+     * Describes an attestation of an artifact.
+     * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Details, io.grafeas.v1beta1.attestation.Details.Builder, io.grafeas.v1beta1.attestation.DetailsOrBuilder> + getAttestationFieldBuilder() { + if (attestationBuilder_ == null) { + if (!(detailsCase_ == 14)) { + details_ = io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + attestationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Details, io.grafeas.v1beta1.attestation.Details.Builder, io.grafeas.v1beta1.attestation.DetailsOrBuilder>( + (io.grafeas.v1beta1.attestation.Details) details_, + getParentForChildren(), + isClean()); + details_ = null; + } + detailsCase_ = 14; + onChanged();; + return attestationBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.Occurrence) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.Occurrence) + private static final io.grafeas.v1beta1.Occurrence DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.Occurrence(); + } + + public static io.grafeas.v1beta1.Occurrence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Occurrence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Occurrence(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.Occurrence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceName.java new file mode 100644 index 000000000000..481f48bb96a6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceOrBuilder.java new file mode 100644 index 000000000000..0e016c6fcd3f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/OccurrenceOrBuilder.java @@ -0,0 +1,343 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface OccurrenceOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.Occurrence) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Output only. The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + boolean hasResource(); + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + io.grafeas.v1beta1.Resource getResource(); + /** + *
+   * Required. Immutable. The resource for which the occurrence applies.
+   * 
+ * + * .grafeas.v1beta1.Resource resource = 2; + */ + io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder(); + + /** + *
+   * Required. Immutable. The analysis note associated with this occurrence, in
+   * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+   * as a filter in list requests.
+   * 
+ * + * string note_name = 3; + */ + java.lang.String getNoteName(); + /** + *
+   * Required. Immutable. The analysis note associated with this occurrence, in
+   * the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used
+   * as a filter in list requests.
+   * 
+ * + * string note_name = 3; + */ + com.google.protobuf.ByteString + getNoteNameBytes(); + + /** + *
+   * Output only. This explicitly denotes which of the occurrence details are
+   * specified. This field can be used as a filter in list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + int getKindValue(); + /** + *
+   * Output only. This explicitly denotes which of the occurrence details are
+   * specified. This field can be used as a filter in list requests.
+   * 
+ * + * .grafeas.v1beta1.NoteKind kind = 4; + */ + io.grafeas.v1beta1.common.NoteKind getKind(); + + /** + *
+   * A description of actions that can be taken to remedy the note.
+   * 
+ * + * string remediation = 5; + */ + java.lang.String getRemediation(); + /** + *
+   * A description of actions that can be taken to remedy the note.
+   * 
+ * + * string remediation = 5; + */ + com.google.protobuf.ByteString + getRemediationBytes(); + + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + boolean hasCreateTime(); + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Output only. The time this occurrence was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + boolean hasUpdateTime(); + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + *
+   * Output only. The time this occurrence was last updated.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + boolean hasVulnerability(); + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + io.grafeas.v1beta1.vulnerability.Details getVulnerability(); + /** + *
+   * Describes a security vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Details vulnerability = 8; + */ + io.grafeas.v1beta1.vulnerability.DetailsOrBuilder getVulnerabilityOrBuilder(); + + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + boolean hasBuild(); + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + io.grafeas.v1beta1.build.Details getBuild(); + /** + *
+   * Describes a verifiable build.
+   * 
+ * + * .grafeas.v1beta1.build.Details build = 9; + */ + io.grafeas.v1beta1.build.DetailsOrBuilder getBuildOrBuilder(); + + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + boolean hasDerivedImage(); + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + io.grafeas.v1beta1.image.Details getDerivedImage(); + /** + *
+   * Describes how this resource derives from the basis in the associated
+   * note.
+   * 
+ * + * .grafeas.v1beta1.image.Details derived_image = 10; + */ + io.grafeas.v1beta1.image.DetailsOrBuilder getDerivedImageOrBuilder(); + + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + boolean hasInstallation(); + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + io.grafeas.v1beta1.pkg.Details getInstallation(); + /** + *
+   * Describes the installation of a package on the linked resource.
+   * 
+ * + * .grafeas.v1beta1.package.Details installation = 11; + */ + io.grafeas.v1beta1.pkg.DetailsOrBuilder getInstallationOrBuilder(); + + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + boolean hasDeployment(); + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + io.grafeas.v1beta1.deployment.Details getDeployment(); + /** + *
+   * Describes the deployment of an artifact on a runtime.
+   * 
+ * + * .grafeas.v1beta1.deployment.Details deployment = 12; + */ + io.grafeas.v1beta1.deployment.DetailsOrBuilder getDeploymentOrBuilder(); + + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + boolean hasDiscovered(); + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + io.grafeas.v1beta1.discovery.Details getDiscovered(); + /** + *
+   * Describes when a resource was discovered.
+   * 
+ * + * .grafeas.v1beta1.discovery.Details discovered = 13; + */ + io.grafeas.v1beta1.discovery.DetailsOrBuilder getDiscoveredOrBuilder(); + + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + boolean hasAttestation(); + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + io.grafeas.v1beta1.attestation.Details getAttestation(); + /** + *
+   * Describes an attestation of an artifact.
+   * 
+ * + * .grafeas.v1beta1.attestation.Details attestation = 14; + */ + io.grafeas.v1beta1.attestation.DetailsOrBuilder getAttestationOrBuilder(); + + public io.grafeas.v1beta1.Occurrence.DetailsCase getDetailsCase(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ProjectName.java new file mode 100644 index 000000000000..4357bff67091 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-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 new file mode 100644 index 000000000000..1d7de6da4938 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/Resource.java @@ -0,0 +1,975 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * An entity that can have metadata. For example, a Docker image.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.Resource} + */ +public final class Resource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.Resource) + ResourceOrBuilder { +private static final long serialVersionUID = 0L; + // Use Resource.newBuilder() to construct. + private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Resource() { + name_ = ""; + uri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Resource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + uri_ = s; + break; + } + case 26: { + io.grafeas.v1beta1.provenance.Hash.Builder subBuilder = null; + if (contentHash_ != null) { + subBuilder = contentHash_.toBuilder(); + } + contentHash_ = input.readMessage(io.grafeas.v1beta1.provenance.Hash.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(contentHash_); + contentHash_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Resource.class, io.grafeas.v1beta1.Resource.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the resource. For example, the name of a Docker image -
+   * "Debian".
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the resource. For example, the name of a Docker image -
+   * "Debian".
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_FIELD_NUMBER = 2; + private volatile java.lang.Object uri_; + /** + *
+   * The unique URI of the resource. For example,
+   * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+   * 
+ * + * string uri = 2; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } + } + /** + *
+   * The unique URI of the resource. For example,
+   * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+   * 
+ * + * string uri = 2; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_HASH_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.provenance.Hash contentHash_; + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public boolean hasContentHash() { + return contentHash_ != null; + } + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public io.grafeas.v1beta1.provenance.Hash getContentHash() { + return contentHash_ == null ? io.grafeas.v1beta1.provenance.Hash.getDefaultInstance() : contentHash_; + } + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public io.grafeas.v1beta1.provenance.HashOrBuilder getContentHashOrBuilder() { + return getContentHash(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, uri_); + } + if (contentHash_ != null) { + output.writeMessage(3, getContentHash()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, uri_); + } + if (contentHash_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getContentHash()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.Resource)) { + return super.equals(obj); + } + io.grafeas.v1beta1.Resource other = (io.grafeas.v1beta1.Resource) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getUri() + .equals(other.getUri()); + result = result && (hasContentHash() == other.hasContentHash()); + if (hasContentHash()) { + result = result && getContentHash() + .equals(other.getContentHash()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + if (hasContentHash()) { + hash = (37 * hash) + CONTENT_HASH_FIELD_NUMBER; + hash = (53 * hash) + getContentHash().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.Resource parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Resource parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Resource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Resource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Resource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.Resource parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.Resource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Resource parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Resource parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Resource parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.Resource parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.Resource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.Resource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An entity that can have metadata. For example, a Docker image.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.Resource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.Resource) + io.grafeas.v1beta1.ResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.Resource.class, io.grafeas.v1beta1.Resource.Builder.class); + } + + // Construct using io.grafeas.v1beta1.Resource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + uri_ = ""; + + if (contentHashBuilder_ == null) { + contentHash_ = null; + } else { + contentHash_ = null; + contentHashBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_Resource_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.Resource getDefaultInstanceForType() { + return io.grafeas.v1beta1.Resource.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.Resource build() { + io.grafeas.v1beta1.Resource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.Resource buildPartial() { + io.grafeas.v1beta1.Resource result = new io.grafeas.v1beta1.Resource(this); + result.name_ = name_; + result.uri_ = uri_; + if (contentHashBuilder_ == null) { + result.contentHash_ = contentHash_; + } else { + result.contentHash_ = contentHashBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.Resource) { + return mergeFrom((io.grafeas.v1beta1.Resource)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.Resource other) { + if (other == io.grafeas.v1beta1.Resource.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getUri().isEmpty()) { + uri_ = other.uri_; + onChanged(); + } + if (other.hasContentHash()) { + mergeContentHash(other.getContentHash()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.Resource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.Resource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the resource. For example, the name of a Docker image -
+     * "Debian".
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the resource. For example, the name of a Docker image -
+     * "Debian".
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the resource. For example, the name of a Docker image -
+     * "Debian".
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the resource. For example, the name of a Docker image -
+     * "Debian".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the resource. For example, the name of a Docker image -
+     * "Debian".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object uri_ = ""; + /** + *
+     * The unique URI of the resource. For example,
+     * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+     * 
+ * + * string uri = 2; + */ + public java.lang.String getUri() { + java.lang.Object ref = uri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + uri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The unique URI of the resource. For example,
+     * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+     * 
+ * + * string uri = 2; + */ + public com.google.protobuf.ByteString + getUriBytes() { + java.lang.Object ref = uri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + uri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The unique URI of the resource. For example,
+     * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+     * 
+ * + * string uri = 2; + */ + public Builder setUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + uri_ = value; + onChanged(); + return this; + } + /** + *
+     * The unique URI of the resource. For example,
+     * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+     * 
+ * + * string uri = 2; + */ + public Builder clearUri() { + + uri_ = getDefaultInstance().getUri(); + onChanged(); + return this; + } + /** + *
+     * The unique URI of the resource. For example,
+     * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+     * 
+ * + * string uri = 2; + */ + public Builder setUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + uri_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.provenance.Hash contentHash_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder> contentHashBuilder_; + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public boolean hasContentHash() { + return contentHashBuilder_ != null || contentHash_ != null; + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public io.grafeas.v1beta1.provenance.Hash getContentHash() { + if (contentHashBuilder_ == null) { + return contentHash_ == null ? io.grafeas.v1beta1.provenance.Hash.getDefaultInstance() : contentHash_; + } else { + return contentHashBuilder_.getMessage(); + } + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public Builder setContentHash(io.grafeas.v1beta1.provenance.Hash value) { + if (contentHashBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + contentHash_ = value; + onChanged(); + } else { + contentHashBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public Builder setContentHash( + io.grafeas.v1beta1.provenance.Hash.Builder builderForValue) { + if (contentHashBuilder_ == null) { + contentHash_ = builderForValue.build(); + onChanged(); + } else { + contentHashBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public Builder mergeContentHash(io.grafeas.v1beta1.provenance.Hash value) { + if (contentHashBuilder_ == null) { + if (contentHash_ != null) { + contentHash_ = + io.grafeas.v1beta1.provenance.Hash.newBuilder(contentHash_).mergeFrom(value).buildPartial(); + } else { + contentHash_ = value; + } + onChanged(); + } else { + contentHashBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public Builder clearContentHash() { + if (contentHashBuilder_ == null) { + contentHash_ = null; + onChanged(); + } else { + contentHash_ = null; + contentHashBuilder_ = null; + } + + return this; + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public io.grafeas.v1beta1.provenance.Hash.Builder getContentHashBuilder() { + + onChanged(); + return getContentHashFieldBuilder().getBuilder(); + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + public io.grafeas.v1beta1.provenance.HashOrBuilder getContentHashOrBuilder() { + if (contentHashBuilder_ != null) { + return contentHashBuilder_.getMessageOrBuilder(); + } else { + return contentHash_ == null ? + io.grafeas.v1beta1.provenance.Hash.getDefaultInstance() : contentHash_; + } + } + /** + *
+     * The hash of the resource content. For example, the Docker digest.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder> + getContentHashFieldBuilder() { + if (contentHashBuilder_ == null) { + contentHashBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder>( + getContentHash(), + getParentForChildren(), + isClean()); + contentHash_ = null; + } + return contentHashBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.Resource) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.Resource) + private static final io.grafeas.v1beta1.Resource DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.Resource(); + } + + public static io.grafeas.v1beta1.Resource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Resource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Resource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.Resource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ResourceOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ResourceOrBuilder.java new file mode 100644 index 000000000000..0d09e0eacb02 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ResourceOrBuilder.java @@ -0,0 +1,74 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface ResourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.Resource) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the resource. For example, the name of a Docker image -
+   * "Debian".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the resource. For example, the name of a Docker image -
+   * "Debian".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The unique URI of the resource. For example,
+   * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+   * 
+ * + * string uri = 2; + */ + java.lang.String getUri(); + /** + *
+   * The unique URI of the resource. For example,
+   * `https://gcr.io/project/image@sha256:foo` for a Docker image.
+   * 
+ * + * string uri = 2; + */ + com.google.protobuf.ByteString + getUriBytes(); + + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + boolean hasContentHash(); + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + io.grafeas.v1beta1.provenance.Hash getContentHash(); + /** + *
+   * The hash of the resource content. For example, the Docker digest.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash content_hash = 3; + */ + io.grafeas.v1beta1.provenance.HashOrBuilder getContentHashOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ScanConfigName.java new file mode 100644 index 000000000000..a42680d84043 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..dc77557a3918 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequest.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to update a note.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.UpdateNoteRequest} + */ +public final class UpdateNoteRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.UpdateNoteRequest) + UpdateNoteRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateNoteRequest.newBuilder() to construct. + private UpdateNoteRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateNoteRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateNoteRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.Note.Builder subBuilder = null; + if (note_ != null) { + subBuilder = note_.toBuilder(); + } + note_ = input.readMessage(io.grafeas.v1beta1.Note.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(note_); + note_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.UpdateNoteRequest.class, io.grafeas.v1beta1.UpdateNoteRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NOTE_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.Note note_; + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public boolean hasNote() { + return note_ != null; + } + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public io.grafeas.v1beta1.Note getNote() { + return note_ == null ? io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { + return getNote(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (note_ != null) { + output.writeMessage(2, getNote()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (note_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getNote()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.UpdateNoteRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.UpdateNoteRequest other = (io.grafeas.v1beta1.UpdateNoteRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasNote() == other.hasNote()); + if (hasNote()) { + result = result && getNote() + .equals(other.getNote()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasNote()) { + hash = (37 * hash) + NOTE_FIELD_NUMBER; + hash = (53 * hash) + getNote().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateNoteRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.UpdateNoteRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to update a note.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.UpdateNoteRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.UpdateNoteRequest) + io.grafeas.v1beta1.UpdateNoteRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateNoteRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.UpdateNoteRequest.class, io.grafeas.v1beta1.UpdateNoteRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.UpdateNoteRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (noteBuilder_ == null) { + note_ = null; + } else { + note_ = null; + noteBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateNoteRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateNoteRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateNoteRequest build() { + io.grafeas.v1beta1.UpdateNoteRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateNoteRequest buildPartial() { + io.grafeas.v1beta1.UpdateNoteRequest result = new io.grafeas.v1beta1.UpdateNoteRequest(this); + result.name_ = name_; + if (noteBuilder_ == null) { + result.note_ = note_; + } else { + result.note_ = noteBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.UpdateNoteRequest) { + return mergeFrom((io.grafeas.v1beta1.UpdateNoteRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.UpdateNoteRequest other) { + if (other == io.grafeas.v1beta1.UpdateNoteRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasNote()) { + mergeNote(other.getNote()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.UpdateNoteRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.UpdateNoteRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the note in the form of
+     * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.Note note_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> noteBuilder_; + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public boolean hasNote() { + return noteBuilder_ != null || note_ != null; + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public io.grafeas.v1beta1.Note getNote() { + if (noteBuilder_ == null) { + return note_ == null ? io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } else { + return noteBuilder_.getMessage(); + } + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public Builder setNote(io.grafeas.v1beta1.Note value) { + if (noteBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + note_ = value; + onChanged(); + } else { + noteBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public Builder setNote( + io.grafeas.v1beta1.Note.Builder builderForValue) { + if (noteBuilder_ == null) { + note_ = builderForValue.build(); + onChanged(); + } else { + noteBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public Builder mergeNote(io.grafeas.v1beta1.Note value) { + if (noteBuilder_ == null) { + if (note_ != null) { + note_ = + io.grafeas.v1beta1.Note.newBuilder(note_).mergeFrom(value).buildPartial(); + } else { + note_ = value; + } + onChanged(); + } else { + noteBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public Builder clearNote() { + if (noteBuilder_ == null) { + note_ = null; + onChanged(); + } else { + note_ = null; + noteBuilder_ = null; + } + + return this; + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public io.grafeas.v1beta1.Note.Builder getNoteBuilder() { + + onChanged(); + return getNoteFieldBuilder().getBuilder(); + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + public io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder() { + if (noteBuilder_ != null) { + return noteBuilder_.getMessageOrBuilder(); + } else { + return note_ == null ? + io.grafeas.v1beta1.Note.getDefaultInstance() : note_; + } + } + /** + *
+     * The updated note.
+     * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder> + getNoteFieldBuilder() { + if (noteBuilder_ == null) { + noteBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Note, io.grafeas.v1beta1.Note.Builder, io.grafeas.v1beta1.NoteOrBuilder>( + getNote(), + getParentForChildren(), + isClean()); + note_ = null; + } + return noteBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.UpdateNoteRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.UpdateNoteRequest) + private static final io.grafeas.v1beta1.UpdateNoteRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.UpdateNoteRequest(); + } + + public static io.grafeas.v1beta1.UpdateNoteRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateNoteRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateNoteRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateNoteRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequestOrBuilder.java new file mode 100644 index 000000000000..f58b68907522 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateNoteRequestOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface UpdateNoteRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.UpdateNoteRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the note in the form of
+   * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + boolean hasNote(); + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + io.grafeas.v1beta1.Note getNote(); + /** + *
+   * The updated note.
+   * 
+ * + * .grafeas.v1beta1.Note note = 2; + */ + io.grafeas.v1beta1.NoteOrBuilder getNoteOrBuilder(); + + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + boolean hasUpdateMask(); + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} 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 new file mode 100644 index 000000000000..0b91f772e65d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequest.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * Request to update an occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.UpdateOccurrenceRequest} + */ +public final class UpdateOccurrenceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.UpdateOccurrenceRequest) + UpdateOccurrenceRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateOccurrenceRequest.newBuilder() to construct. + private UpdateOccurrenceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateOccurrenceRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateOccurrenceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.Occurrence.Builder subBuilder = null; + if (occurrence_ != null) { + subBuilder = occurrence_.toBuilder(); + } + occurrence_ = input.readMessage(io.grafeas.v1beta1.Occurrence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(occurrence_); + occurrence_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.UpdateOccurrenceRequest.class, io.grafeas.v1beta1.UpdateOccurrenceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OCCURRENCE_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.Occurrence occurrence_; + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public boolean hasOccurrence() { + return occurrence_ != null; + } + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrence() { + return occurrence_ == null ? io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { + return getOccurrence(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (occurrence_ != null) { + output.writeMessage(2, getOccurrence()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (occurrence_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getOccurrence()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.UpdateOccurrenceRequest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.UpdateOccurrenceRequest other = (io.grafeas.v1beta1.UpdateOccurrenceRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasOccurrence() == other.hasOccurrence()); + if (hasOccurrence()) { + result = result && getOccurrence() + .equals(other.getOccurrence()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasOccurrence()) { + hash = (37 * hash) + OCCURRENCE_FIELD_NUMBER; + hash = (53 * hash) + getOccurrence().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.UpdateOccurrenceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.UpdateOccurrenceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request to update an occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.UpdateOccurrenceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.UpdateOccurrenceRequest) + io.grafeas.v1beta1.UpdateOccurrenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.UpdateOccurrenceRequest.class, io.grafeas.v1beta1.UpdateOccurrenceRequest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.UpdateOccurrenceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (occurrenceBuilder_ == null) { + occurrence_ = null; + } else { + occurrence_ = null; + occurrenceBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_UpdateOccurrenceRequest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateOccurrenceRequest getDefaultInstanceForType() { + return io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateOccurrenceRequest build() { + io.grafeas.v1beta1.UpdateOccurrenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateOccurrenceRequest buildPartial() { + io.grafeas.v1beta1.UpdateOccurrenceRequest result = new io.grafeas.v1beta1.UpdateOccurrenceRequest(this); + result.name_ = name_; + if (occurrenceBuilder_ == null) { + result.occurrence_ = occurrence_; + } else { + result.occurrence_ = occurrenceBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.UpdateOccurrenceRequest) { + return mergeFrom((io.grafeas.v1beta1.UpdateOccurrenceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.UpdateOccurrenceRequest other) { + if (other == io.grafeas.v1beta1.UpdateOccurrenceRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasOccurrence()) { + mergeOccurrence(other.getOccurrence()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.UpdateOccurrenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.UpdateOccurrenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the occurrence in the form of
+     * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.Occurrence occurrence_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> occurrenceBuilder_; + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public boolean hasOccurrence() { + return occurrenceBuilder_ != null || occurrence_ != null; + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence getOccurrence() { + if (occurrenceBuilder_ == null) { + return occurrence_ == null ? io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } else { + return occurrenceBuilder_.getMessage(); + } + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder setOccurrence(io.grafeas.v1beta1.Occurrence value) { + if (occurrenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + occurrence_ = value; + onChanged(); + } else { + occurrenceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder setOccurrence( + io.grafeas.v1beta1.Occurrence.Builder builderForValue) { + if (occurrenceBuilder_ == null) { + occurrence_ = builderForValue.build(); + onChanged(); + } else { + occurrenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder mergeOccurrence(io.grafeas.v1beta1.Occurrence value) { + if (occurrenceBuilder_ == null) { + if (occurrence_ != null) { + occurrence_ = + io.grafeas.v1beta1.Occurrence.newBuilder(occurrence_).mergeFrom(value).buildPartial(); + } else { + occurrence_ = value; + } + onChanged(); + } else { + occurrenceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public Builder clearOccurrence() { + if (occurrenceBuilder_ == null) { + occurrence_ = null; + onChanged(); + } else { + occurrence_ = null; + occurrenceBuilder_ = null; + } + + return this; + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.Occurrence.Builder getOccurrenceBuilder() { + + onChanged(); + return getOccurrenceFieldBuilder().getBuilder(); + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + public io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder() { + if (occurrenceBuilder_ != null) { + return occurrenceBuilder_.getMessageOrBuilder(); + } else { + return occurrence_ == null ? + io.grafeas.v1beta1.Occurrence.getDefaultInstance() : occurrence_; + } + } + /** + *
+     * The updated occurrence.
+     * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder> + getOccurrenceFieldBuilder() { + if (occurrenceBuilder_ == null) { + occurrenceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Occurrence, io.grafeas.v1beta1.Occurrence.Builder, io.grafeas.v1beta1.OccurrenceOrBuilder>( + getOccurrence(), + getParentForChildren(), + isClean()); + occurrence_ = null; + } + return occurrenceBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * The fields to update.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.UpdateOccurrenceRequest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.UpdateOccurrenceRequest) + private static final io.grafeas.v1beta1.UpdateOccurrenceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.UpdateOccurrenceRequest(); + } + + public static io.grafeas.v1beta1.UpdateOccurrenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateOccurrenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateOccurrenceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.UpdateOccurrenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequestOrBuilder.java new file mode 100644 index 000000000000..bfc31ae3ad97 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/UpdateOccurrenceRequestOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface UpdateOccurrenceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.UpdateOccurrenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the occurrence in the form of
+   * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + boolean hasOccurrence(); + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + io.grafeas.v1beta1.Occurrence getOccurrence(); + /** + *
+   * The updated occurrence.
+   * 
+ * + * .grafeas.v1beta1.Occurrence occurrence = 2; + */ + io.grafeas.v1beta1.OccurrenceOrBuilder getOccurrenceOrBuilder(); + + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + boolean hasUpdateMask(); + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * The fields to update.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} 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 new file mode 100644 index 000000000000..152c1adec330 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummary.java @@ -0,0 +1,1843 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +/** + *
+ * A summary of how many vulnerability occurrences there are per resource and
+ * severity type.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.VulnerabilityOccurrencesSummary} + */ +public final class VulnerabilityOccurrencesSummary extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.VulnerabilityOccurrencesSummary) + VulnerabilityOccurrencesSummaryOrBuilder { +private static final long serialVersionUID = 0L; + // Use VulnerabilityOccurrencesSummary.newBuilder() to construct. + private VulnerabilityOccurrencesSummary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VulnerabilityOccurrencesSummary() { + counts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VulnerabilityOccurrencesSummary( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + counts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + counts_.add( + input.readMessage(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + counts_ = java.util.Collections.unmodifiableList(counts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.class, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.Builder.class); + } + + public interface FixableTotalByDigestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + boolean hasResource(); + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + io.grafeas.v1beta1.Resource getResource(); + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder(); + + /** + *
+     * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+     * all severities.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + int getSeverityValue(); + /** + *
+     * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+     * all severities.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + io.grafeas.v1beta1.vulnerability.Severity getSeverity(); + + /** + *
+     * The number of fixable vulnerabilities associated with this resource.
+     * 
+ * + * int64 fixable_count = 3; + */ + long getFixableCount(); + + /** + *
+     * The total number of vulnerabilities associated with this resource.
+     * 
+ * + * int64 total_count = 4; + */ + long getTotalCount(); + } + /** + *
+   * Per resource and severity counts of fixable and total vulnerabilites.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest} + */ + public static final class FixableTotalByDigest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) + FixableTotalByDigestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FixableTotalByDigest.newBuilder() to construct. + private FixableTotalByDigest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FixableTotalByDigest() { + severity_ = 0; + fixableCount_ = 0L; + totalCount_ = 0L; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FixableTotalByDigest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.Resource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = input.readMessage(io.grafeas.v1beta1.Resource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 24: { + + fixableCount_ = input.readInt64(); + break; + } + case 32: { + + totalCount_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.class, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder.class); + } + + public static final int RESOURCE_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.Resource resource_; + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public boolean hasResource() { + return resource_ != null; + } + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public io.grafeas.v1beta1.Resource getResource() { + return resource_ == null ? io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } + /** + *
+     * The affected resource.
+     * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+     * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+     * all severities.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+     * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+     * all severities.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + + public static final int FIXABLE_COUNT_FIELD_NUMBER = 3; + private long fixableCount_; + /** + *
+     * The number of fixable vulnerabilities associated with this resource.
+     * 
+ * + * int64 fixable_count = 3; + */ + public long getFixableCount() { + return fixableCount_; + } + + public static final int TOTAL_COUNT_FIELD_NUMBER = 4; + private long totalCount_; + /** + *
+     * The total number of vulnerabilities associated with this resource.
+     * 
+ * + * int64 total_count = 4; + */ + public long getTotalCount() { + return totalCount_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (resource_ != null) { + output.writeMessage(1, getResource()); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (fixableCount_ != 0L) { + output.writeInt64(3, fixableCount_); + } + if (totalCount_ != 0L) { + output.writeInt64(4, totalCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getResource()); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + if (fixableCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, fixableCount_); + } + if (totalCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, totalCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest)) { + return super.equals(obj); + } + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest other = (io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) obj; + + boolean result = true; + result = result && (hasResource() == other.hasResource()); + if (hasResource()) { + result = result && getResource() + .equals(other.getResource()); + } + result = result && severity_ == other.severity_; + result = result && (getFixableCount() + == other.getFixableCount()); + result = result && (getTotalCount() + == other.getTotalCount()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + FIXABLE_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFixableCount()); + hash = (37 * hash) + TOTAL_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getTotalCount()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Per resource and severity counts of fixable and total vulnerabilites.
+     * 
+ * + * Protobuf type {@code grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.class, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder.class); + } + + // Construct using io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + severity_ = 0; + + fixableCount_ = 0L; + + totalCount_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_FixableTotalByDigest_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getDefaultInstanceForType() { + return io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest build() { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest buildPartial() { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest result = new io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest(this); + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + result.severity_ = severity_; + result.fixableCount_ = fixableCount_; + result.totalCount_ = totalCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) { + return mergeFrom((io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest other) { + if (other == io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.getDefaultInstance()) return this; + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (other.getFixableCount() != 0L) { + setFixableCount(other.getFixableCount()); + } + if (other.getTotalCount() != 0L) { + setTotalCount(other.getTotalCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.Resource resource_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder> resourceBuilder_; + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public io.grafeas.v1beta1.Resource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null ? io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public Builder setResource(io.grafeas.v1beta1.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public Builder setResource( + io.grafeas.v1beta1.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public Builder mergeResource(io.grafeas.v1beta1.Resource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + io.grafeas.v1beta1.Resource.newBuilder(resource_).mergeFrom(value).buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public io.grafeas.v1beta1.Resource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + public io.grafeas.v1beta1.ResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null ? + io.grafeas.v1beta1.Resource.getDefaultInstance() : resource_; + } + } + /** + *
+       * The affected resource.
+       * 
+ * + * .grafeas.v1beta1.Resource resource = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.Resource, io.grafeas.v1beta1.Resource.Builder, io.grafeas.v1beta1.ResourceOrBuilder>( + getResource(), + getParentForChildren(), + isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private int severity_ = 0; + /** + *
+       * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+       * all severities.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+       * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+       * all severities.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverityValue(int value) { + severity_ = value; + onChanged(); + return this; + } + /** + *
+       * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+       * all severities.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + /** + *
+       * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+       * all severities.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverity(io.grafeas.v1beta1.vulnerability.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * The severity for this count. SEVERITY_UNSPECIFIED indicates total across
+       * all severities.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private long fixableCount_ ; + /** + *
+       * The number of fixable vulnerabilities associated with this resource.
+       * 
+ * + * int64 fixable_count = 3; + */ + public long getFixableCount() { + return fixableCount_; + } + /** + *
+       * The number of fixable vulnerabilities associated with this resource.
+       * 
+ * + * int64 fixable_count = 3; + */ + public Builder setFixableCount(long value) { + + fixableCount_ = value; + onChanged(); + return this; + } + /** + *
+       * The number of fixable vulnerabilities associated with this resource.
+       * 
+ * + * int64 fixable_count = 3; + */ + public Builder clearFixableCount() { + + fixableCount_ = 0L; + onChanged(); + return this; + } + + private long totalCount_ ; + /** + *
+       * The total number of vulnerabilities associated with this resource.
+       * 
+ * + * int64 total_count = 4; + */ + public long getTotalCount() { + return totalCount_; + } + /** + *
+       * The total number of vulnerabilities associated with this resource.
+       * 
+ * + * int64 total_count = 4; + */ + public Builder setTotalCount(long value) { + + totalCount_ = value; + onChanged(); + return this; + } + /** + *
+       * The total number of vulnerabilities associated with this resource.
+       * 
+ * + * int64 total_count = 4; + */ + public Builder clearTotalCount() { + + totalCount_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest) + private static final io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest(); + } + + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FixableTotalByDigest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FixableTotalByDigest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int COUNTS_FIELD_NUMBER = 1; + private java.util.List counts_; + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public java.util.List getCountsList() { + return counts_; + } + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public java.util.List + getCountsOrBuilderList() { + return counts_; + } + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public int getCountsCount() { + return counts_.size(); + } + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getCounts(int index) { + return counts_.get(index); + } + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder getCountsOrBuilder( + int index) { + return counts_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < counts_.size(); i++) { + output.writeMessage(1, counts_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < counts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, counts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.VulnerabilityOccurrencesSummary)) { + return super.equals(obj); + } + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary other = (io.grafeas.v1beta1.VulnerabilityOccurrencesSummary) obj; + + boolean result = true; + result = result && getCountsList() + .equals(other.getCountsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCountsCount() > 0) { + hash = (37 * hash) + COUNTS_FIELD_NUMBER; + hash = (53 * hash) + getCountsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A summary of how many vulnerability occurrences there are per resource and
+   * severity type.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.VulnerabilityOccurrencesSummary} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.VulnerabilityOccurrencesSummary) + io.grafeas.v1beta1.VulnerabilityOccurrencesSummaryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.class, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.Builder.class); + } + + // Construct using io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCountsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (countsBuilder_ == null) { + counts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + countsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.Grafeas.internal_static_grafeas_v1beta1_VulnerabilityOccurrencesSummary_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getDefaultInstanceForType() { + return io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary build() { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary buildPartial() { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary result = new io.grafeas.v1beta1.VulnerabilityOccurrencesSummary(this); + int from_bitField0_ = bitField0_; + if (countsBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + counts_ = java.util.Collections.unmodifiableList(counts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.counts_ = counts_; + } else { + result.counts_ = countsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.VulnerabilityOccurrencesSummary) { + return mergeFrom((io.grafeas.v1beta1.VulnerabilityOccurrencesSummary)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary other) { + if (other == io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.getDefaultInstance()) return this; + if (countsBuilder_ == null) { + if (!other.counts_.isEmpty()) { + if (counts_.isEmpty()) { + counts_ = other.counts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCountsIsMutable(); + counts_.addAll(other.counts_); + } + onChanged(); + } + } else { + if (!other.counts_.isEmpty()) { + if (countsBuilder_.isEmpty()) { + countsBuilder_.dispose(); + countsBuilder_ = null; + counts_ = other.counts_; + bitField0_ = (bitField0_ & ~0x00000001); + countsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCountsFieldBuilder() : null; + } else { + countsBuilder_.addAllMessages(other.counts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.VulnerabilityOccurrencesSummary) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List counts_ = + java.util.Collections.emptyList(); + private void ensureCountsIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + counts_ = new java.util.ArrayList(counts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder> countsBuilder_; + + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public java.util.List getCountsList() { + if (countsBuilder_ == null) { + return java.util.Collections.unmodifiableList(counts_); + } else { + return countsBuilder_.getMessageList(); + } + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public int getCountsCount() { + if (countsBuilder_ == null) { + return counts_.size(); + } else { + return countsBuilder_.getCount(); + } + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getCounts(int index) { + if (countsBuilder_ == null) { + return counts_.get(index); + } else { + return countsBuilder_.getMessage(index); + } + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder setCounts( + int index, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest value) { + if (countsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCountsIsMutable(); + counts_.set(index, value); + onChanged(); + } else { + countsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder setCounts( + int index, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder builderForValue) { + if (countsBuilder_ == null) { + ensureCountsIsMutable(); + counts_.set(index, builderForValue.build()); + onChanged(); + } else { + countsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder addCounts(io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest value) { + if (countsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCountsIsMutable(); + counts_.add(value); + onChanged(); + } else { + countsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder addCounts( + int index, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest value) { + if (countsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCountsIsMutable(); + counts_.add(index, value); + onChanged(); + } else { + countsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder addCounts( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder builderForValue) { + if (countsBuilder_ == null) { + ensureCountsIsMutable(); + counts_.add(builderForValue.build()); + onChanged(); + } else { + countsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder addCounts( + int index, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder builderForValue) { + if (countsBuilder_ == null) { + ensureCountsIsMutable(); + counts_.add(index, builderForValue.build()); + onChanged(); + } else { + countsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder addAllCounts( + java.lang.Iterable values) { + if (countsBuilder_ == null) { + ensureCountsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, counts_); + onChanged(); + } else { + countsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder clearCounts() { + if (countsBuilder_ == null) { + counts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + countsBuilder_.clear(); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public Builder removeCounts(int index) { + if (countsBuilder_ == null) { + ensureCountsIsMutable(); + counts_.remove(index); + onChanged(); + } else { + countsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder getCountsBuilder( + int index) { + return getCountsFieldBuilder().getBuilder(index); + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder getCountsOrBuilder( + int index) { + if (countsBuilder_ == null) { + return counts_.get(index); } else { + return countsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public java.util.List + getCountsOrBuilderList() { + if (countsBuilder_ != null) { + return countsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(counts_); + } + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder addCountsBuilder() { + return getCountsFieldBuilder().addBuilder( + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.getDefaultInstance()); + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder addCountsBuilder( + int index) { + return getCountsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.getDefaultInstance()); + } + /** + *
+     * A listing by resource of the number of fixable and total vulnerabilities.
+     * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + public java.util.List + getCountsBuilderList() { + return getCountsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder> + getCountsFieldBuilder() { + if (countsBuilder_ == null) { + countsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest.Builder, io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder>( + counts_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + counts_ = null; + } + return countsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.VulnerabilityOccurrencesSummary) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.VulnerabilityOccurrencesSummary) + private static final io.grafeas.v1beta1.VulnerabilityOccurrencesSummary DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.VulnerabilityOccurrencesSummary(); + } + + public static io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VulnerabilityOccurrencesSummary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VulnerabilityOccurrencesSummary(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.VulnerabilityOccurrencesSummary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummaryOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummaryOrBuilder.java new file mode 100644 index 000000000000..e541e1a2997d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/VulnerabilityOccurrencesSummaryOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto + +package io.grafeas.v1beta1; + +public interface VulnerabilityOccurrencesSummaryOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.VulnerabilityOccurrencesSummary) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + java.util.List + getCountsList(); + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest getCounts(int index); + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + int getCountsCount(); + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + java.util.List + getCountsOrBuilderList(); + /** + *
+   * A listing by resource of the number of fixable and total vulnerabilities.
+   * 
+ * + * repeated .grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigest counts = 1; + */ + io.grafeas.v1beta1.VulnerabilityOccurrencesSummary.FixableTotalByDigestOrBuilder getCountsOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..985eefc6b55d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Attestation.java @@ -0,0 +1,756 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +/** + *
+ * Occurrence that represents a single "attestation". The authenticity of an
+ * Attestation can be verified using the attached signature. If the verifier
+ * trusts the public key of the signer, then verifying the signature is
+ * sufficient to establish trust. In this circumstance, the Authority to which
+ * this Attestation is attached is primarily useful for look-up (how to find
+ * this Attestation if you already know the Authority and artifact to be
+ * verified) and intent (which authority was this attestation intended to sign
+ * for).
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Attestation} + */ +public final class Attestation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.Attestation) + AttestationOrBuilder { +private static final long serialVersionUID = 0L; + // Use Attestation.newBuilder() to construct. + private Attestation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Attestation() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Attestation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder subBuilder = null; + if (signatureCase_ == 1) { + subBuilder = ((io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_).toBuilder(); + } + signature_ = + input.readMessage(io.grafeas.v1beta1.attestation.PgpSignedAttestation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_); + signature_ = subBuilder.buildPartial(); + } + signatureCase_ = 1; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Attestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Attestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Attestation.class, io.grafeas.v1beta1.attestation.Attestation.Builder.class); + } + + private int signatureCase_ = 0; + private java.lang.Object signature_; + public enum SignatureCase + implements com.google.protobuf.Internal.EnumLite { + PGP_SIGNED_ATTESTATION(1), + SIGNATURE_NOT_SET(0); + private final int value; + private SignatureCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SignatureCase valueOf(int value) { + return forNumber(value); + } + + public static SignatureCase forNumber(int value) { + switch (value) { + case 1: return PGP_SIGNED_ATTESTATION; + case 0: return SIGNATURE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SignatureCase + getSignatureCase() { + return SignatureCase.forNumber( + signatureCase_); + } + + public static final int PGP_SIGNED_ATTESTATION_FIELD_NUMBER = 1; + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public boolean hasPgpSignedAttestation() { + return signatureCase_ == 1; + } + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestation getPgpSignedAttestation() { + if (signatureCase_ == 1) { + return (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_; + } + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder getPgpSignedAttestationOrBuilder() { + if (signatureCase_ == 1) { + return (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_; + } + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (signatureCase_ == 1) { + output.writeMessage(1, (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (signatureCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.attestation.Attestation)) { + return super.equals(obj); + } + io.grafeas.v1beta1.attestation.Attestation other = (io.grafeas.v1beta1.attestation.Attestation) obj; + + boolean result = true; + result = result && getSignatureCase().equals( + other.getSignatureCase()); + if (!result) return false; + switch (signatureCase_) { + case 1: + result = result && getPgpSignedAttestation() + .equals(other.getPgpSignedAttestation()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (signatureCase_) { + case 1: + hash = (37 * hash) + PGP_SIGNED_ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getPgpSignedAttestation().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Attestation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Attestation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Attestation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.attestation.Attestation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Occurrence that represents a single "attestation". The authenticity of an
+   * Attestation can be verified using the attached signature. If the verifier
+   * trusts the public key of the signer, then verifying the signature is
+   * sufficient to establish trust. In this circumstance, the Authority to which
+   * this Attestation is attached is primarily useful for look-up (how to find
+   * this Attestation if you already know the Authority and artifact to be
+   * verified) and intent (which authority was this attestation intended to sign
+   * for).
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Attestation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.Attestation) + io.grafeas.v1beta1.attestation.AttestationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Attestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Attestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Attestation.class, io.grafeas.v1beta1.attestation.Attestation.Builder.class); + } + + // Construct using io.grafeas.v1beta1.attestation.Attestation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + signatureCase_ = 0; + signature_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Attestation_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Attestation getDefaultInstanceForType() { + return io.grafeas.v1beta1.attestation.Attestation.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Attestation build() { + io.grafeas.v1beta1.attestation.Attestation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Attestation buildPartial() { + io.grafeas.v1beta1.attestation.Attestation result = new io.grafeas.v1beta1.attestation.Attestation(this); + if (signatureCase_ == 1) { + if (pgpSignedAttestationBuilder_ == null) { + result.signature_ = signature_; + } else { + result.signature_ = pgpSignedAttestationBuilder_.build(); + } + } + result.signatureCase_ = signatureCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.attestation.Attestation) { + return mergeFrom((io.grafeas.v1beta1.attestation.Attestation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.attestation.Attestation other) { + if (other == io.grafeas.v1beta1.attestation.Attestation.getDefaultInstance()) return this; + switch (other.getSignatureCase()) { + case PGP_SIGNED_ATTESTATION: { + mergePgpSignedAttestation(other.getPgpSignedAttestation()); + break; + } + case SIGNATURE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.attestation.Attestation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.attestation.Attestation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int signatureCase_ = 0; + private java.lang.Object signature_; + public SignatureCase + getSignatureCase() { + return SignatureCase.forNumber( + signatureCase_); + } + + public Builder clearSignature() { + signatureCase_ = 0; + signature_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.PgpSignedAttestation, io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder, io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder> pgpSignedAttestationBuilder_; + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public boolean hasPgpSignedAttestation() { + return signatureCase_ == 1; + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestation getPgpSignedAttestation() { + if (pgpSignedAttestationBuilder_ == null) { + if (signatureCase_ == 1) { + return (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_; + } + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } else { + if (signatureCase_ == 1) { + return pgpSignedAttestationBuilder_.getMessage(); + } + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public Builder setPgpSignedAttestation(io.grafeas.v1beta1.attestation.PgpSignedAttestation value) { + if (pgpSignedAttestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + signature_ = value; + onChanged(); + } else { + pgpSignedAttestationBuilder_.setMessage(value); + } + signatureCase_ = 1; + return this; + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public Builder setPgpSignedAttestation( + io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder builderForValue) { + if (pgpSignedAttestationBuilder_ == null) { + signature_ = builderForValue.build(); + onChanged(); + } else { + pgpSignedAttestationBuilder_.setMessage(builderForValue.build()); + } + signatureCase_ = 1; + return this; + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public Builder mergePgpSignedAttestation(io.grafeas.v1beta1.attestation.PgpSignedAttestation value) { + if (pgpSignedAttestationBuilder_ == null) { + if (signatureCase_ == 1 && + signature_ != io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance()) { + signature_ = io.grafeas.v1beta1.attestation.PgpSignedAttestation.newBuilder((io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_) + .mergeFrom(value).buildPartial(); + } else { + signature_ = value; + } + onChanged(); + } else { + if (signatureCase_ == 1) { + pgpSignedAttestationBuilder_.mergeFrom(value); + } + pgpSignedAttestationBuilder_.setMessage(value); + } + signatureCase_ = 1; + return this; + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public Builder clearPgpSignedAttestation() { + if (pgpSignedAttestationBuilder_ == null) { + if (signatureCase_ == 1) { + signatureCase_ = 0; + signature_ = null; + onChanged(); + } + } else { + if (signatureCase_ == 1) { + signatureCase_ = 0; + signature_ = null; + } + pgpSignedAttestationBuilder_.clear(); + } + return this; + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder getPgpSignedAttestationBuilder() { + return getPgpSignedAttestationFieldBuilder().getBuilder(); + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder getPgpSignedAttestationOrBuilder() { + if ((signatureCase_ == 1) && (pgpSignedAttestationBuilder_ != null)) { + return pgpSignedAttestationBuilder_.getMessageOrBuilder(); + } else { + if (signatureCase_ == 1) { + return (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_; + } + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + } + /** + *
+     * A PGP signed attestation.
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.PgpSignedAttestation, io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder, io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder> + getPgpSignedAttestationFieldBuilder() { + if (pgpSignedAttestationBuilder_ == null) { + if (!(signatureCase_ == 1)) { + signature_ = io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + pgpSignedAttestationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.PgpSignedAttestation, io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder, io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder>( + (io.grafeas.v1beta1.attestation.PgpSignedAttestation) signature_, + getParentForChildren(), + isClean()); + signature_ = null; + } + signatureCase_ = 1; + onChanged();; + return pgpSignedAttestationBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.Attestation) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.Attestation) + private static final io.grafeas.v1beta1.attestation.Attestation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.Attestation(); + } + + public static io.grafeas.v1beta1.attestation.Attestation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Attestation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Attestation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Attestation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOrBuilder.java new file mode 100644 index 000000000000..c9d2fa751ff6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +public interface AttestationOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.attestation.Attestation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + boolean hasPgpSignedAttestation(); + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + io.grafeas.v1beta1.attestation.PgpSignedAttestation getPgpSignedAttestation(); + /** + *
+   * A PGP signed attestation.
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation pgp_signed_attestation = 1; + */ + io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder getPgpSignedAttestationOrBuilder(); + + public io.grafeas.v1beta1.attestation.Attestation.SignatureCase getSignatureCase(); +} 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 new file mode 100644 index 000000000000..6ab6597f079a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AttestationOuterClass.java @@ -0,0 +1,117 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +public final class AttestationOuterClass { + private AttestationOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_attestation_Authority_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_attestation_Authority_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_attestation_Authority_Hint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_attestation_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_attestation_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_attestation_Attestation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_attestation_Attestation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nGgoogle/devtools/containeranalysis/v1be" + + "ta1/attestation/attestation.proto\022\033grafe" + + "as.v1beta1.attestation\"\344\001\n\024PgpSignedAtte" + + "station\022\021\n\tsignature\030\001 \001(\t\022S\n\014content_ty" + + "pe\030\003 \001(\0162=.grafeas.v1beta1.attestation.P" + + "gpSignedAttestation.ContentType\022\024\n\npgp_k" + + "ey_id\030\002 \001(\tH\000\"D\n\013ContentType\022\034\n\030CONTENT_" + + "TYPE_UNSPECIFIED\020\000\022\027\n\023SIMPLE_SIGNING_JSO" + + "N\020\001B\010\n\006key_id\"k\n\tAuthority\0229\n\004hint\030\001 \001(\013" + + "2+.grafeas.v1beta1.attestation.Authority" + + ".Hint\032#\n\004Hint\022\033\n\023human_readable_name\030\001 \001" + + "(\t\"H\n\007Details\022=\n\013attestation\030\001 \001(\0132(.gra" + + "feas.v1beta1.attestation.Attestation\"o\n\013" + + "Attestation\022S\n\026pgp_signed_attestation\030\001 " + + "\001(\01321.grafeas.v1beta1.attestation.PgpSig" + + "nedAttestationH\000B\013\n\tsignatureB\212\001\n\036io.gra" + + "feas.v1beta1.attestationP\001Z`google.golan" + + "g.org/genproto/googleapis/devtools/conta" + + "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); + internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor, + new java.lang.String[] { "Signature", "ContentType", "PgpKeyId", "KeyId", }); + internal_static_grafeas_v1beta1_attestation_Authority_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_attestation_Authority_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_attestation_Authority_descriptor, + new java.lang.String[] { "Hint", }); + internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor = + internal_static_grafeas_v1beta1_attestation_Authority_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_attestation_Authority_Hint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor, + new java.lang.String[] { "HumanReadableName", }); + internal_static_grafeas_v1beta1_attestation_Details_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_attestation_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_attestation_Details_descriptor, + new java.lang.String[] { "Attestation", }); + internal_static_grafeas_v1beta1_attestation_Attestation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_attestation_Attestation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_attestation_Attestation_descriptor, + new java.lang.String[] { "PgpSignedAttestation", "Signature", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..04dfe9603f28 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Authority.java @@ -0,0 +1,1271 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +/** + *
+ * Note kind that represents a logical attestation "role" or "authority". For
+ * example, an organization might have one `Authority` for "QA" and one for
+ * "build". This Note is intended to act strictly as a grouping mechanism for
+ * the attached Occurrences (Attestations). This grouping mechanism also
+ * provides a security boundary, since IAM ACLs gate the ability for a principle
+ * to attach an Occurrence to a given Note. It also provides a single point of
+ * lookup to find all attached Attestation Occurrences, even if they don't all
+ * live in the same project.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Authority} + */ +public final class Authority extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.Authority) + AuthorityOrBuilder { +private static final long serialVersionUID = 0L; + // Use Authority.newBuilder() to construct. + private Authority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Authority() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Authority( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.attestation.Authority.Hint.Builder subBuilder = null; + if (hint_ != null) { + subBuilder = hint_.toBuilder(); + } + hint_ = input.readMessage(io.grafeas.v1beta1.attestation.Authority.Hint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(hint_); + hint_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Authority.class, io.grafeas.v1beta1.attestation.Authority.Builder.class); + } + + public interface HintOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.attestation.Authority.Hint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The human readable name of this Attestation Authority, for example "qa".
+     * 
+ * + * string human_readable_name = 1; + */ + java.lang.String getHumanReadableName(); + /** + *
+     * The human readable name of this Attestation Authority, for example "qa".
+     * 
+ * + * string human_readable_name = 1; + */ + com.google.protobuf.ByteString + getHumanReadableNameBytes(); + } + /** + *
+   * This submessage provides human-readable hints about the purpose of the
+   * Authority. Because the name of a Note acts as its resource reference, it is
+   * important to disambiguate the canonical name of the Note (which might be a
+   * UUID for security purposes) from "readable" names more suitable for debug
+   * output. Note that these hints should NOT be used to look up authorities in
+   * security sensitive contexts, such as when looking up Attestations to
+   * verify.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Authority.Hint} + */ + public static final class Hint extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.Authority.Hint) + HintOrBuilder { + private static final long serialVersionUID = 0L; + // Use Hint.newBuilder() to construct. + private Hint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Hint() { + humanReadableName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Hint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + humanReadableName_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_Hint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Authority.Hint.class, io.grafeas.v1beta1.attestation.Authority.Hint.Builder.class); + } + + public static final int HUMAN_READABLE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object humanReadableName_; + /** + *
+     * The human readable name of this Attestation Authority, for example "qa".
+     * 
+ * + * string human_readable_name = 1; + */ + public java.lang.String getHumanReadableName() { + java.lang.Object ref = humanReadableName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + humanReadableName_ = s; + return s; + } + } + /** + *
+     * The human readable name of this Attestation Authority, for example "qa".
+     * 
+ * + * string human_readable_name = 1; + */ + public com.google.protobuf.ByteString + getHumanReadableNameBytes() { + java.lang.Object ref = humanReadableName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + humanReadableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getHumanReadableNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, humanReadableName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getHumanReadableNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, humanReadableName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.attestation.Authority.Hint)) { + return super.equals(obj); + } + io.grafeas.v1beta1.attestation.Authority.Hint other = (io.grafeas.v1beta1.attestation.Authority.Hint) obj; + + boolean result = true; + result = result && getHumanReadableName() + .equals(other.getHumanReadableName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HUMAN_READABLE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getHumanReadableName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority.Hint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.attestation.Authority.Hint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * This submessage provides human-readable hints about the purpose of the
+     * Authority. Because the name of a Note acts as its resource reference, it is
+     * important to disambiguate the canonical name of the Note (which might be a
+     * UUID for security purposes) from "readable" names more suitable for debug
+     * output. Note that these hints should NOT be used to look up authorities in
+     * security sensitive contexts, such as when looking up Attestations to
+     * verify.
+     * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Authority.Hint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.Authority.Hint) + io.grafeas.v1beta1.attestation.Authority.HintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_Hint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Authority.Hint.class, io.grafeas.v1beta1.attestation.Authority.Hint.Builder.class); + } + + // Construct using io.grafeas.v1beta1.attestation.Authority.Hint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + humanReadableName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_Hint_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority.Hint getDefaultInstanceForType() { + return io.grafeas.v1beta1.attestation.Authority.Hint.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority.Hint build() { + io.grafeas.v1beta1.attestation.Authority.Hint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority.Hint buildPartial() { + io.grafeas.v1beta1.attestation.Authority.Hint result = new io.grafeas.v1beta1.attestation.Authority.Hint(this); + result.humanReadableName_ = humanReadableName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.attestation.Authority.Hint) { + return mergeFrom((io.grafeas.v1beta1.attestation.Authority.Hint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.attestation.Authority.Hint other) { + if (other == io.grafeas.v1beta1.attestation.Authority.Hint.getDefaultInstance()) return this; + if (!other.getHumanReadableName().isEmpty()) { + humanReadableName_ = other.humanReadableName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.attestation.Authority.Hint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.attestation.Authority.Hint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object humanReadableName_ = ""; + /** + *
+       * The human readable name of this Attestation Authority, for example "qa".
+       * 
+ * + * string human_readable_name = 1; + */ + public java.lang.String getHumanReadableName() { + java.lang.Object ref = humanReadableName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + humanReadableName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The human readable name of this Attestation Authority, for example "qa".
+       * 
+ * + * string human_readable_name = 1; + */ + public com.google.protobuf.ByteString + getHumanReadableNameBytes() { + java.lang.Object ref = humanReadableName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + humanReadableName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The human readable name of this Attestation Authority, for example "qa".
+       * 
+ * + * string human_readable_name = 1; + */ + public Builder setHumanReadableName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + humanReadableName_ = value; + onChanged(); + return this; + } + /** + *
+       * The human readable name of this Attestation Authority, for example "qa".
+       * 
+ * + * string human_readable_name = 1; + */ + public Builder clearHumanReadableName() { + + humanReadableName_ = getDefaultInstance().getHumanReadableName(); + onChanged(); + return this; + } + /** + *
+       * The human readable name of this Attestation Authority, for example "qa".
+       * 
+ * + * string human_readable_name = 1; + */ + public Builder setHumanReadableNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + humanReadableName_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.Authority.Hint) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.Authority.Hint) + private static final io.grafeas.v1beta1.attestation.Authority.Hint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.Authority.Hint(); + } + + public static io.grafeas.v1beta1.attestation.Authority.Hint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Hint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Hint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority.Hint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int HINT_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.attestation.Authority.Hint hint_; + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public boolean hasHint() { + return hint_ != null; + } + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public io.grafeas.v1beta1.attestation.Authority.Hint getHint() { + return hint_ == null ? io.grafeas.v1beta1.attestation.Authority.Hint.getDefaultInstance() : hint_; + } + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public io.grafeas.v1beta1.attestation.Authority.HintOrBuilder getHintOrBuilder() { + return getHint(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (hint_ != null) { + output.writeMessage(1, getHint()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (hint_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getHint()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.attestation.Authority)) { + return super.equals(obj); + } + io.grafeas.v1beta1.attestation.Authority other = (io.grafeas.v1beta1.attestation.Authority) obj; + + boolean result = true; + result = result && (hasHint() == other.hasHint()); + if (hasHint()) { + result = result && getHint() + .equals(other.getHint()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasHint()) { + hash = (37 * hash) + HINT_FIELD_NUMBER; + hash = (53 * hash) + getHint().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Authority parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.attestation.Authority prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Note kind that represents a logical attestation "role" or "authority". For
+   * example, an organization might have one `Authority` for "QA" and one for
+   * "build". This Note is intended to act strictly as a grouping mechanism for
+   * the attached Occurrences (Attestations). This grouping mechanism also
+   * provides a security boundary, since IAM ACLs gate the ability for a principle
+   * to attach an Occurrence to a given Note. It also provides a single point of
+   * lookup to find all attached Attestation Occurrences, even if they don't all
+   * live in the same project.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Authority} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.Authority) + io.grafeas.v1beta1.attestation.AuthorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Authority.class, io.grafeas.v1beta1.attestation.Authority.Builder.class); + } + + // Construct using io.grafeas.v1beta1.attestation.Authority.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (hintBuilder_ == null) { + hint_ = null; + } else { + hint_ = null; + hintBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Authority_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority getDefaultInstanceForType() { + return io.grafeas.v1beta1.attestation.Authority.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority build() { + io.grafeas.v1beta1.attestation.Authority result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority buildPartial() { + io.grafeas.v1beta1.attestation.Authority result = new io.grafeas.v1beta1.attestation.Authority(this); + if (hintBuilder_ == null) { + result.hint_ = hint_; + } else { + result.hint_ = hintBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.attestation.Authority) { + return mergeFrom((io.grafeas.v1beta1.attestation.Authority)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.attestation.Authority other) { + if (other == io.grafeas.v1beta1.attestation.Authority.getDefaultInstance()) return this; + if (other.hasHint()) { + mergeHint(other.getHint()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.attestation.Authority parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.attestation.Authority) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.attestation.Authority.Hint hint_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority.Hint, io.grafeas.v1beta1.attestation.Authority.Hint.Builder, io.grafeas.v1beta1.attestation.Authority.HintOrBuilder> hintBuilder_; + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public boolean hasHint() { + return hintBuilder_ != null || hint_ != null; + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public io.grafeas.v1beta1.attestation.Authority.Hint getHint() { + if (hintBuilder_ == null) { + return hint_ == null ? io.grafeas.v1beta1.attestation.Authority.Hint.getDefaultInstance() : hint_; + } else { + return hintBuilder_.getMessage(); + } + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public Builder setHint(io.grafeas.v1beta1.attestation.Authority.Hint value) { + if (hintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + hint_ = value; + onChanged(); + } else { + hintBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public Builder setHint( + io.grafeas.v1beta1.attestation.Authority.Hint.Builder builderForValue) { + if (hintBuilder_ == null) { + hint_ = builderForValue.build(); + onChanged(); + } else { + hintBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public Builder mergeHint(io.grafeas.v1beta1.attestation.Authority.Hint value) { + if (hintBuilder_ == null) { + if (hint_ != null) { + hint_ = + io.grafeas.v1beta1.attestation.Authority.Hint.newBuilder(hint_).mergeFrom(value).buildPartial(); + } else { + hint_ = value; + } + onChanged(); + } else { + hintBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public Builder clearHint() { + if (hintBuilder_ == null) { + hint_ = null; + onChanged(); + } else { + hint_ = null; + hintBuilder_ = null; + } + + return this; + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public io.grafeas.v1beta1.attestation.Authority.Hint.Builder getHintBuilder() { + + onChanged(); + return getHintFieldBuilder().getBuilder(); + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + public io.grafeas.v1beta1.attestation.Authority.HintOrBuilder getHintOrBuilder() { + if (hintBuilder_ != null) { + return hintBuilder_.getMessageOrBuilder(); + } else { + return hint_ == null ? + io.grafeas.v1beta1.attestation.Authority.Hint.getDefaultInstance() : hint_; + } + } + /** + *
+     * Hint hints at the purpose of the attestation authority.
+     * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority.Hint, io.grafeas.v1beta1.attestation.Authority.Hint.Builder, io.grafeas.v1beta1.attestation.Authority.HintOrBuilder> + getHintFieldBuilder() { + if (hintBuilder_ == null) { + hintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Authority.Hint, io.grafeas.v1beta1.attestation.Authority.Hint.Builder, io.grafeas.v1beta1.attestation.Authority.HintOrBuilder>( + getHint(), + getParentForChildren(), + isClean()); + hint_ = null; + } + return hintBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.Authority) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.Authority) + private static final io.grafeas.v1beta1.attestation.Authority DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.Authority(); + } + + public static io.grafeas.v1beta1.attestation.Authority getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Authority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Authority(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Authority getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AuthorityOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AuthorityOrBuilder.java new file mode 100644 index 000000000000..b51d840fc5ad --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/AuthorityOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +public interface AuthorityOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.attestation.Authority) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + boolean hasHint(); + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + io.grafeas.v1beta1.attestation.Authority.Hint getHint(); + /** + *
+   * Hint hints at the purpose of the attestation authority.
+   * 
+ * + * .grafeas.v1beta1.attestation.Authority.Hint hint = 1; + */ + io.grafeas.v1beta1.attestation.Authority.HintOrBuilder getHintOrBuilder(); +} 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 new file mode 100644 index 000000000000..0238b2c3b342 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/Details.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +/** + *
+ * Details of an attestation occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.attestation.Attestation.Builder subBuilder = null; + if (attestation_ != null) { + subBuilder = attestation_.toBuilder(); + } + attestation_ = input.readMessage(io.grafeas.v1beta1.attestation.Attestation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(attestation_); + attestation_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Details.class, io.grafeas.v1beta1.attestation.Details.Builder.class); + } + + public static final int ATTESTATION_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.attestation.Attestation attestation_; + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public boolean hasAttestation() { + return attestation_ != null; + } + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public io.grafeas.v1beta1.attestation.Attestation getAttestation() { + return attestation_ == null ? io.grafeas.v1beta1.attestation.Attestation.getDefaultInstance() : attestation_; + } + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public io.grafeas.v1beta1.attestation.AttestationOrBuilder getAttestationOrBuilder() { + return getAttestation(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (attestation_ != null) { + output.writeMessage(1, getAttestation()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (attestation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAttestation()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.attestation.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.attestation.Details other = (io.grafeas.v1beta1.attestation.Details) obj; + + boolean result = true; + result = result && (hasAttestation() == other.hasAttestation()); + if (hasAttestation()) { + result = result && getAttestation() + .equals(other.getAttestation()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAttestation()) { + hash = (37 * hash) + ATTESTATION_FIELD_NUMBER; + hash = (53 * hash) + getAttestation().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.attestation.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.attestation.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of an attestation occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.Details) + io.grafeas.v1beta1.attestation.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.Details.class, io.grafeas.v1beta1.attestation.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.attestation.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (attestationBuilder_ == null) { + attestation_ = null; + } else { + attestation_ = null; + attestationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.attestation.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Details build() { + io.grafeas.v1beta1.attestation.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Details buildPartial() { + io.grafeas.v1beta1.attestation.Details result = new io.grafeas.v1beta1.attestation.Details(this); + if (attestationBuilder_ == null) { + result.attestation_ = attestation_; + } else { + result.attestation_ = attestationBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.attestation.Details) { + return mergeFrom((io.grafeas.v1beta1.attestation.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.attestation.Details other) { + if (other == io.grafeas.v1beta1.attestation.Details.getDefaultInstance()) return this; + if (other.hasAttestation()) { + mergeAttestation(other.getAttestation()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.attestation.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.attestation.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.attestation.Attestation attestation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Attestation, io.grafeas.v1beta1.attestation.Attestation.Builder, io.grafeas.v1beta1.attestation.AttestationOrBuilder> attestationBuilder_; + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public boolean hasAttestation() { + return attestationBuilder_ != null || attestation_ != null; + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public io.grafeas.v1beta1.attestation.Attestation getAttestation() { + if (attestationBuilder_ == null) { + return attestation_ == null ? io.grafeas.v1beta1.attestation.Attestation.getDefaultInstance() : attestation_; + } else { + return attestationBuilder_.getMessage(); + } + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public Builder setAttestation(io.grafeas.v1beta1.attestation.Attestation value) { + if (attestationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + attestation_ = value; + onChanged(); + } else { + attestationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public Builder setAttestation( + io.grafeas.v1beta1.attestation.Attestation.Builder builderForValue) { + if (attestationBuilder_ == null) { + attestation_ = builderForValue.build(); + onChanged(); + } else { + attestationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public Builder mergeAttestation(io.grafeas.v1beta1.attestation.Attestation value) { + if (attestationBuilder_ == null) { + if (attestation_ != null) { + attestation_ = + io.grafeas.v1beta1.attestation.Attestation.newBuilder(attestation_).mergeFrom(value).buildPartial(); + } else { + attestation_ = value; + } + onChanged(); + } else { + attestationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public Builder clearAttestation() { + if (attestationBuilder_ == null) { + attestation_ = null; + onChanged(); + } else { + attestation_ = null; + attestationBuilder_ = null; + } + + return this; + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public io.grafeas.v1beta1.attestation.Attestation.Builder getAttestationBuilder() { + + onChanged(); + return getAttestationFieldBuilder().getBuilder(); + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + public io.grafeas.v1beta1.attestation.AttestationOrBuilder getAttestationOrBuilder() { + if (attestationBuilder_ != null) { + return attestationBuilder_.getMessageOrBuilder(); + } else { + return attestation_ == null ? + io.grafeas.v1beta1.attestation.Attestation.getDefaultInstance() : attestation_; + } + } + /** + *
+     * Attestation for the resource.
+     * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Attestation, io.grafeas.v1beta1.attestation.Attestation.Builder, io.grafeas.v1beta1.attestation.AttestationOrBuilder> + getAttestationFieldBuilder() { + if (attestationBuilder_ == null) { + attestationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.attestation.Attestation, io.grafeas.v1beta1.attestation.Attestation.Builder, io.grafeas.v1beta1.attestation.AttestationOrBuilder>( + getAttestation(), + getParentForChildren(), + isClean()); + attestation_ = null; + } + return attestationBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.Details) + private static final io.grafeas.v1beta1.attestation.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.Details(); + } + + public static io.grafeas.v1beta1.attestation.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/DetailsOrBuilder.java new file mode 100644 index 000000000000..53f6d7f2386a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/DetailsOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.attestation.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + boolean hasAttestation(); + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + io.grafeas.v1beta1.attestation.Attestation getAttestation(); + /** + *
+   * Attestation for the resource.
+   * 
+ * + * .grafeas.v1beta1.attestation.Attestation attestation = 1; + */ + io.grafeas.v1beta1.attestation.AttestationOrBuilder getAttestationOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/NoteName.java new file mode 100644 index 000000000000..04b6cf013183 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.attestation; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/OccurrenceName.java new file mode 100644 index 000000000000..cb62c7ec61d1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.attestation; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-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 new file mode 100644 index 000000000000..3d4add572f7d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestation.java @@ -0,0 +1,1250 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +/** + *
+ * An attestation wrapper with a PGP-compatible signature. This message only
+ * supports `ATTACHED` signatures, where the payload that is signed is included
+ * alongside the signature itself in the same file.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.PgpSignedAttestation} + */ +public final class PgpSignedAttestation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.attestation.PgpSignedAttestation) + PgpSignedAttestationOrBuilder { +private static final long serialVersionUID = 0L; + // Use PgpSignedAttestation.newBuilder() to construct. + private PgpSignedAttestation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PgpSignedAttestation() { + signature_ = ""; + contentType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PgpSignedAttestation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + signature_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + keyIdCase_ = 2; + keyId_ = s; + break; + } + case 24: { + int rawValue = input.readEnum(); + + contentType_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.PgpSignedAttestation.class, io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder.class); + } + + /** + *
+   * Type (for example schema) of the attestation payload that was signed.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType} + */ + public enum ContentType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * `ContentType` is not set.
+     * 
+ * + * CONTENT_TYPE_UNSPECIFIED = 0; + */ + CONTENT_TYPE_UNSPECIFIED(0), + /** + *
+     * Atomic format attestation signature. See
+     * https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
+     * The payload extracted from `signature` is a JSON blob conforming to the
+     * linked schema.
+     * 
+ * + * SIMPLE_SIGNING_JSON = 1; + */ + SIMPLE_SIGNING_JSON(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * `ContentType` is not set.
+     * 
+ * + * CONTENT_TYPE_UNSPECIFIED = 0; + */ + public static final int CONTENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * Atomic format attestation signature. See
+     * https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md
+     * The payload extracted from `signature` is a JSON blob conforming to the
+     * linked schema.
+     * 
+ * + * SIMPLE_SIGNING_JSON = 1; + */ + public static final int SIMPLE_SIGNING_JSON_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContentType valueOf(int value) { + return forNumber(value); + } + + public static ContentType forNumber(int value) { + switch (value) { + case 0: return CONTENT_TYPE_UNSPECIFIED; + case 1: return SIMPLE_SIGNING_JSON; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ContentType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContentType findValueByNumber(int number) { + return ContentType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDescriptor().getEnumTypes().get(0); + } + + private static final ContentType[] VALUES = values(); + + public static ContentType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContentType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType) + } + + private int keyIdCase_ = 0; + private java.lang.Object keyId_; + public enum KeyIdCase + implements com.google.protobuf.Internal.EnumLite { + PGP_KEY_ID(2), + KEYID_NOT_SET(0); + private final int value; + private KeyIdCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KeyIdCase valueOf(int value) { + return forNumber(value); + } + + public static KeyIdCase forNumber(int value) { + switch (value) { + case 2: return PGP_KEY_ID; + case 0: return KEYID_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public KeyIdCase + getKeyIdCase() { + return KeyIdCase.forNumber( + keyIdCase_); + } + + public static final int SIGNATURE_FIELD_NUMBER = 1; + private volatile java.lang.Object signature_; + /** + *
+   * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+   * equivalent.  Since this message only supports attached signatures, the
+   * payload that was signed must be attached. While the signature format
+   * supported is dependent on the verification implementation, currently only
+   * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+   * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+   * --output=signature.gpg payload.json` will create the signature content
+   * expected in this field in `signature.gpg` for the `payload.json`
+   * attestation payload.
+   * 
+ * + * string signature = 1; + */ + public java.lang.String getSignature() { + java.lang.Object ref = signature_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signature_ = s; + return s; + } + } + /** + *
+   * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+   * equivalent.  Since this message only supports attached signatures, the
+   * payload that was signed must be attached. While the signature format
+   * supported is dependent on the verification implementation, currently only
+   * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+   * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+   * --output=signature.gpg payload.json` will create the signature content
+   * expected in this field in `signature.gpg` for the `payload.json`
+   * attestation payload.
+   * 
+ * + * string signature = 1; + */ + public com.google.protobuf.ByteString + getSignatureBytes() { + java.lang.Object ref = signature_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + signature_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 3; + private int contentType_; + /** + *
+   * Type (for example schema) of the attestation payload that was signed.
+   * The verifier must ensure that the provided type is one that the verifier
+   * supports, and that the attestation payload is a valid instantiation of that
+   * type (for example by validating a JSON schema).
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public int getContentTypeValue() { + return contentType_; + } + /** + *
+   * Type (for example schema) of the attestation payload that was signed.
+   * The verifier must ensure that the provided type is one that the verifier
+   * supports, and that the attestation payload is a valid instantiation of that
+   * type (for example by validating a JSON schema).
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType getContentType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType result = io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.valueOf(contentType_); + return result == null ? io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.UNRECOGNIZED : result; + } + + public static final int PGP_KEY_ID_FIELD_NUMBER = 2; + /** + *
+   * The cryptographic fingerprint of the key used to generate the signature,
+   * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+   * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+   * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+   * Implementations may choose to acknowledge "LONG", "SHORT", or other
+   * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+   * In gpg, the full fingerprint can be retrieved from the `fpr` field
+   * returned when calling --list-keys with --with-colons.  For example:
+   * ```
+   * gpg --with-colons --with-fingerprint --force-v4-certs \
+   *     --list-keys attester@example.com
+   * tru::1:1513631572:0:3:1:5
+   * pub:...<SNIP>...
+   * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+   * ```
+   * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+   * 
+ * + * string pgp_key_id = 2; + */ + public java.lang.String getPgpKeyId() { + java.lang.Object ref = ""; + if (keyIdCase_ == 2) { + ref = keyId_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (keyIdCase_ == 2) { + keyId_ = s; + } + return s; + } + } + /** + *
+   * The cryptographic fingerprint of the key used to generate the signature,
+   * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+   * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+   * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+   * Implementations may choose to acknowledge "LONG", "SHORT", or other
+   * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+   * In gpg, the full fingerprint can be retrieved from the `fpr` field
+   * returned when calling --list-keys with --with-colons.  For example:
+   * ```
+   * gpg --with-colons --with-fingerprint --force-v4-certs \
+   *     --list-keys attester@example.com
+   * tru::1:1513631572:0:3:1:5
+   * pub:...<SNIP>...
+   * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+   * ```
+   * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+   * 
+ * + * string pgp_key_id = 2; + */ + public com.google.protobuf.ByteString + getPgpKeyIdBytes() { + java.lang.Object ref = ""; + if (keyIdCase_ == 2) { + ref = keyId_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (keyIdCase_ == 2) { + keyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSignatureBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, signature_); + } + if (keyIdCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyId_); + } + if (contentType_ != io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, contentType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSignatureBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, signature_); + } + if (keyIdCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyId_); + } + if (contentType_ != io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, contentType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.attestation.PgpSignedAttestation)) { + return super.equals(obj); + } + io.grafeas.v1beta1.attestation.PgpSignedAttestation other = (io.grafeas.v1beta1.attestation.PgpSignedAttestation) obj; + + boolean result = true; + result = result && getSignature() + .equals(other.getSignature()); + result = result && contentType_ == other.contentType_; + result = result && getKeyIdCase().equals( + other.getKeyIdCase()); + if (!result) return false; + switch (keyIdCase_) { + case 2: + result = result && getPgpKeyId() + .equals(other.getPgpKeyId()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + contentType_; + switch (keyIdCase_) { + case 2: + hash = (37 * hash) + PGP_KEY_ID_FIELD_NUMBER; + hash = (53 * hash) + getPgpKeyId().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.attestation.PgpSignedAttestation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An attestation wrapper with a PGP-compatible signature. This message only
+   * supports `ATTACHED` signatures, where the payload that is signed is included
+   * alongside the signature itself in the same file.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.attestation.PgpSignedAttestation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.attestation.PgpSignedAttestation) + io.grafeas.v1beta1.attestation.PgpSignedAttestationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.attestation.PgpSignedAttestation.class, io.grafeas.v1beta1.attestation.PgpSignedAttestation.Builder.class); + } + + // Construct using io.grafeas.v1beta1.attestation.PgpSignedAttestation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + signature_ = ""; + + contentType_ = 0; + + keyIdCase_ = 0; + keyId_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.attestation.AttestationOuterClass.internal_static_grafeas_v1beta1_attestation_PgpSignedAttestation_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.PgpSignedAttestation getDefaultInstanceForType() { + return io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.PgpSignedAttestation build() { + io.grafeas.v1beta1.attestation.PgpSignedAttestation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.PgpSignedAttestation buildPartial() { + io.grafeas.v1beta1.attestation.PgpSignedAttestation result = new io.grafeas.v1beta1.attestation.PgpSignedAttestation(this); + result.signature_ = signature_; + result.contentType_ = contentType_; + if (keyIdCase_ == 2) { + result.keyId_ = keyId_; + } + result.keyIdCase_ = keyIdCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.attestation.PgpSignedAttestation) { + return mergeFrom((io.grafeas.v1beta1.attestation.PgpSignedAttestation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.attestation.PgpSignedAttestation other) { + if (other == io.grafeas.v1beta1.attestation.PgpSignedAttestation.getDefaultInstance()) return this; + if (!other.getSignature().isEmpty()) { + signature_ = other.signature_; + onChanged(); + } + if (other.contentType_ != 0) { + setContentTypeValue(other.getContentTypeValue()); + } + switch (other.getKeyIdCase()) { + case PGP_KEY_ID: { + keyIdCase_ = 2; + keyId_ = other.keyId_; + onChanged(); + break; + } + case KEYID_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.attestation.PgpSignedAttestation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.attestation.PgpSignedAttestation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int keyIdCase_ = 0; + private java.lang.Object keyId_; + public KeyIdCase + getKeyIdCase() { + return KeyIdCase.forNumber( + keyIdCase_); + } + + public Builder clearKeyId() { + keyIdCase_ = 0; + keyId_ = null; + onChanged(); + return this; + } + + + private java.lang.Object signature_ = ""; + /** + *
+     * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+     * equivalent.  Since this message only supports attached signatures, the
+     * payload that was signed must be attached. While the signature format
+     * supported is dependent on the verification implementation, currently only
+     * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+     * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+     * --output=signature.gpg payload.json` will create the signature content
+     * expected in this field in `signature.gpg` for the `payload.json`
+     * attestation payload.
+     * 
+ * + * string signature = 1; + */ + public java.lang.String getSignature() { + java.lang.Object ref = signature_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + signature_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+     * equivalent.  Since this message only supports attached signatures, the
+     * payload that was signed must be attached. While the signature format
+     * supported is dependent on the verification implementation, currently only
+     * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+     * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+     * --output=signature.gpg payload.json` will create the signature content
+     * expected in this field in `signature.gpg` for the `payload.json`
+     * attestation payload.
+     * 
+ * + * string signature = 1; + */ + public com.google.protobuf.ByteString + getSignatureBytes() { + java.lang.Object ref = signature_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + signature_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+     * equivalent.  Since this message only supports attached signatures, the
+     * payload that was signed must be attached. While the signature format
+     * supported is dependent on the verification implementation, currently only
+     * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+     * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+     * --output=signature.gpg payload.json` will create the signature content
+     * expected in this field in `signature.gpg` for the `payload.json`
+     * attestation payload.
+     * 
+ * + * string signature = 1; + */ + public Builder setSignature( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + signature_ = value; + onChanged(); + return this; + } + /** + *
+     * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+     * equivalent.  Since this message only supports attached signatures, the
+     * payload that was signed must be attached. While the signature format
+     * supported is dependent on the verification implementation, currently only
+     * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+     * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+     * --output=signature.gpg payload.json` will create the signature content
+     * expected in this field in `signature.gpg` for the `payload.json`
+     * attestation payload.
+     * 
+ * + * string signature = 1; + */ + public Builder clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + /** + *
+     * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+     * equivalent.  Since this message only supports attached signatures, the
+     * payload that was signed must be attached. While the signature format
+     * supported is dependent on the verification implementation, currently only
+     * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+     * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+     * --output=signature.gpg payload.json` will create the signature content
+     * expected in this field in `signature.gpg` for the `payload.json`
+     * attestation payload.
+     * 
+ * + * string signature = 1; + */ + public Builder setSignatureBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + signature_ = value; + onChanged(); + return this; + } + + private int contentType_ = 0; + /** + *
+     * Type (for example schema) of the attestation payload that was signed.
+     * The verifier must ensure that the provided type is one that the verifier
+     * supports, and that the attestation payload is a valid instantiation of that
+     * type (for example by validating a JSON schema).
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public int getContentTypeValue() { + return contentType_; + } + /** + *
+     * Type (for example schema) of the attestation payload that was signed.
+     * The verifier must ensure that the provided type is one that the verifier
+     * supports, and that the attestation payload is a valid instantiation of that
+     * type (for example by validating a JSON schema).
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public Builder setContentTypeValue(int value) { + contentType_ = value; + onChanged(); + return this; + } + /** + *
+     * Type (for example schema) of the attestation payload that was signed.
+     * The verifier must ensure that the provided type is one that the verifier
+     * supports, and that the attestation payload is a valid instantiation of that
+     * type (for example by validating a JSON schema).
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType getContentType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType result = io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.valueOf(contentType_); + return result == null ? io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType.UNRECOGNIZED : result; + } + /** + *
+     * Type (for example schema) of the attestation payload that was signed.
+     * The verifier must ensure that the provided type is one that the verifier
+     * supports, and that the attestation payload is a valid instantiation of that
+     * type (for example by validating a JSON schema).
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public Builder setContentType(io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Type (for example schema) of the attestation payload that was signed.
+     * The verifier must ensure that the provided type is one that the verifier
+     * supports, and that the attestation payload is a valid instantiation of that
+     * type (for example by validating a JSON schema).
+     * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + public Builder clearContentType() { + + contentType_ = 0; + onChanged(); + return this; + } + + /** + *
+     * The cryptographic fingerprint of the key used to generate the signature,
+     * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+     * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+     * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+     * Implementations may choose to acknowledge "LONG", "SHORT", or other
+     * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+     * In gpg, the full fingerprint can be retrieved from the `fpr` field
+     * returned when calling --list-keys with --with-colons.  For example:
+     * ```
+     * gpg --with-colons --with-fingerprint --force-v4-certs \
+     *     --list-keys attester@example.com
+     * tru::1:1513631572:0:3:1:5
+     * pub:...<SNIP>...
+     * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+     * ```
+     * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+     * 
+ * + * string pgp_key_id = 2; + */ + public java.lang.String getPgpKeyId() { + java.lang.Object ref = ""; + if (keyIdCase_ == 2) { + ref = keyId_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (keyIdCase_ == 2) { + keyId_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The cryptographic fingerprint of the key used to generate the signature,
+     * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+     * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+     * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+     * Implementations may choose to acknowledge "LONG", "SHORT", or other
+     * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+     * In gpg, the full fingerprint can be retrieved from the `fpr` field
+     * returned when calling --list-keys with --with-colons.  For example:
+     * ```
+     * gpg --with-colons --with-fingerprint --force-v4-certs \
+     *     --list-keys attester@example.com
+     * tru::1:1513631572:0:3:1:5
+     * pub:...<SNIP>...
+     * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+     * ```
+     * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+     * 
+ * + * string pgp_key_id = 2; + */ + public com.google.protobuf.ByteString + getPgpKeyIdBytes() { + java.lang.Object ref = ""; + if (keyIdCase_ == 2) { + ref = keyId_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (keyIdCase_ == 2) { + keyId_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The cryptographic fingerprint of the key used to generate the signature,
+     * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+     * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+     * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+     * Implementations may choose to acknowledge "LONG", "SHORT", or other
+     * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+     * In gpg, the full fingerprint can be retrieved from the `fpr` field
+     * returned when calling --list-keys with --with-colons.  For example:
+     * ```
+     * gpg --with-colons --with-fingerprint --force-v4-certs \
+     *     --list-keys attester@example.com
+     * tru::1:1513631572:0:3:1:5
+     * pub:...<SNIP>...
+     * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+     * ```
+     * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+     * 
+ * + * string pgp_key_id = 2; + */ + public Builder setPgpKeyId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + keyIdCase_ = 2; + keyId_ = value; + onChanged(); + return this; + } + /** + *
+     * The cryptographic fingerprint of the key used to generate the signature,
+     * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+     * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+     * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+     * Implementations may choose to acknowledge "LONG", "SHORT", or other
+     * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+     * In gpg, the full fingerprint can be retrieved from the `fpr` field
+     * returned when calling --list-keys with --with-colons.  For example:
+     * ```
+     * gpg --with-colons --with-fingerprint --force-v4-certs \
+     *     --list-keys attester@example.com
+     * tru::1:1513631572:0:3:1:5
+     * pub:...<SNIP>...
+     * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+     * ```
+     * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+     * 
+ * + * string pgp_key_id = 2; + */ + public Builder clearPgpKeyId() { + if (keyIdCase_ == 2) { + keyIdCase_ = 0; + keyId_ = null; + onChanged(); + } + return this; + } + /** + *
+     * The cryptographic fingerprint of the key used to generate the signature,
+     * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+     * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+     * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+     * Implementations may choose to acknowledge "LONG", "SHORT", or other
+     * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+     * In gpg, the full fingerprint can be retrieved from the `fpr` field
+     * returned when calling --list-keys with --with-colons.  For example:
+     * ```
+     * gpg --with-colons --with-fingerprint --force-v4-certs \
+     *     --list-keys attester@example.com
+     * tru::1:1513631572:0:3:1:5
+     * pub:...<SNIP>...
+     * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+     * ```
+     * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+     * 
+ * + * string pgp_key_id = 2; + */ + public Builder setPgpKeyIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + keyIdCase_ = 2; + keyId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.attestation.PgpSignedAttestation) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.attestation.PgpSignedAttestation) + private static final io.grafeas.v1beta1.attestation.PgpSignedAttestation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.attestation.PgpSignedAttestation(); + } + + public static io.grafeas.v1beta1.attestation.PgpSignedAttestation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PgpSignedAttestation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PgpSignedAttestation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.attestation.PgpSignedAttestation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestationOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestationOrBuilder.java new file mode 100644 index 000000000000..a0a699a63f91 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/PgpSignedAttestationOrBuilder.java @@ -0,0 +1,116 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/attestation/attestation.proto + +package io.grafeas.v1beta1.attestation; + +public interface PgpSignedAttestationOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.attestation.PgpSignedAttestation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+   * equivalent.  Since this message only supports attached signatures, the
+   * payload that was signed must be attached. While the signature format
+   * supported is dependent on the verification implementation, currently only
+   * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+   * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+   * --output=signature.gpg payload.json` will create the signature content
+   * expected in this field in `signature.gpg` for the `payload.json`
+   * attestation payload.
+   * 
+ * + * string signature = 1; + */ + java.lang.String getSignature(); + /** + *
+   * The raw content of the signature, as output by GNU Privacy Guard (GPG) or
+   * equivalent.  Since this message only supports attached signatures, the
+   * payload that was signed must be attached. While the signature format
+   * supported is dependent on the verification implementation, currently only
+   * ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than
+   * `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor
+   * --output=signature.gpg payload.json` will create the signature content
+   * expected in this field in `signature.gpg` for the `payload.json`
+   * attestation payload.
+   * 
+ * + * string signature = 1; + */ + com.google.protobuf.ByteString + getSignatureBytes(); + + /** + *
+   * Type (for example schema) of the attestation payload that was signed.
+   * The verifier must ensure that the provided type is one that the verifier
+   * supports, and that the attestation payload is a valid instantiation of that
+   * type (for example by validating a JSON schema).
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + int getContentTypeValue(); + /** + *
+   * Type (for example schema) of the attestation payload that was signed.
+   * The verifier must ensure that the provided type is one that the verifier
+   * supports, and that the attestation payload is a valid instantiation of that
+   * type (for example by validating a JSON schema).
+   * 
+ * + * .grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType content_type = 3; + */ + io.grafeas.v1beta1.attestation.PgpSignedAttestation.ContentType getContentType(); + + /** + *
+   * The cryptographic fingerprint of the key used to generate the signature,
+   * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+   * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+   * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+   * Implementations may choose to acknowledge "LONG", "SHORT", or other
+   * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+   * In gpg, the full fingerprint can be retrieved from the `fpr` field
+   * returned when calling --list-keys with --with-colons.  For example:
+   * ```
+   * gpg --with-colons --with-fingerprint --force-v4-certs \
+   *     --list-keys attester@example.com
+   * tru::1:1513631572:0:3:1:5
+   * pub:...<SNIP>...
+   * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+   * ```
+   * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+   * 
+ * + * string pgp_key_id = 2; + */ + java.lang.String getPgpKeyId(); + /** + *
+   * The cryptographic fingerprint of the key used to generate the signature,
+   * as output by, e.g. `gpg --list-keys`. This should be the version 4, full
+   * 160-bit fingerprint, expressed as a 40 character hexidecimal string. See
+   * https://tools.ietf.org/html/rfc4880#section-12.2 for details.
+   * Implementations may choose to acknowledge "LONG", "SHORT", or other
+   * abbreviated key IDs, but only the full fingerprint is guaranteed to work.
+   * In gpg, the full fingerprint can be retrieved from the `fpr` field
+   * returned when calling --list-keys with --with-colons.  For example:
+   * ```
+   * gpg --with-colons --with-fingerprint --force-v4-certs \
+   *     --list-keys attester@example.com
+   * tru::1:1513631572:0:3:1:5
+   * pub:...<SNIP>...
+   * fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
+   * ```
+   * Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`.
+   * 
+ * + * string pgp_key_id = 2; + */ + com.google.protobuf.ByteString + getPgpKeyIdBytes(); + + public io.grafeas.v1beta1.attestation.PgpSignedAttestation.KeyIdCase getKeyIdCase(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ProjectName.java new file mode 100644 index 000000000000..0fee7a140646 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.attestation; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ScanConfigName.java new file mode 100644 index 000000000000..cdc5d06e4e79 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/attestation/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.attestation; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..9dceaba269a0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Build.java @@ -0,0 +1,820 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +/** + *
+ * Note holding the version of the provider's builder and the signature of the
+ * provenance message in linked BuildDetails.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.Build} + */ +public final class Build extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.build.Build) + BuildOrBuilder { +private static final long serialVersionUID = 0L; + // Use Build.newBuilder() to construct. + private Build(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Build() { + builderVersion_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Build( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + builderVersion_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.build.BuildSignature.Builder subBuilder = null; + if (signature_ != null) { + subBuilder = signature_.toBuilder(); + } + signature_ = input.readMessage(io.grafeas.v1beta1.build.BuildSignature.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(signature_); + signature_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Build_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Build_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.Build.class, io.grafeas.v1beta1.build.Build.Builder.class); + } + + public static final int BUILDER_VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object builderVersion_; + /** + *
+   * Version of the builder which produced this Note.
+   * 
+ * + * string builder_version = 1; + */ + public java.lang.String getBuilderVersion() { + java.lang.Object ref = builderVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + builderVersion_ = s; + return s; + } + } + /** + *
+   * Version of the builder which produced this Note.
+   * 
+ * + * string builder_version = 1; + */ + public com.google.protobuf.ByteString + getBuilderVersionBytes() { + java.lang.Object ref = builderVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + builderVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGNATURE_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.build.BuildSignature signature_; + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public boolean hasSignature() { + return signature_ != null; + } + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public io.grafeas.v1beta1.build.BuildSignature getSignature() { + return signature_ == null ? io.grafeas.v1beta1.build.BuildSignature.getDefaultInstance() : signature_; + } + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public io.grafeas.v1beta1.build.BuildSignatureOrBuilder getSignatureOrBuilder() { + return getSignature(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getBuilderVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, builderVersion_); + } + if (signature_ != null) { + output.writeMessage(2, getSignature()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getBuilderVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, builderVersion_); + } + if (signature_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getSignature()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.build.Build)) { + return super.equals(obj); + } + io.grafeas.v1beta1.build.Build other = (io.grafeas.v1beta1.build.Build) obj; + + boolean result = true; + result = result && getBuilderVersion() + .equals(other.getBuilderVersion()); + result = result && (hasSignature() == other.hasSignature()); + if (hasSignature()) { + result = result && getSignature() + .equals(other.getSignature()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BUILDER_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getBuilderVersion().hashCode(); + if (hasSignature()) { + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.build.Build parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Build parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Build parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Build parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Build parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Build parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.build.Build prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Note holding the version of the provider's builder and the signature of the
+   * provenance message in linked BuildDetails.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.Build} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.build.Build) + io.grafeas.v1beta1.build.BuildOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Build_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Build_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.Build.class, io.grafeas.v1beta1.build.Build.Builder.class); + } + + // Construct using io.grafeas.v1beta1.build.Build.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + builderVersion_ = ""; + + if (signatureBuilder_ == null) { + signature_ = null; + } else { + signature_ = null; + signatureBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Build_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Build getDefaultInstanceForType() { + return io.grafeas.v1beta1.build.Build.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Build build() { + io.grafeas.v1beta1.build.Build result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Build buildPartial() { + io.grafeas.v1beta1.build.Build result = new io.grafeas.v1beta1.build.Build(this); + result.builderVersion_ = builderVersion_; + if (signatureBuilder_ == null) { + result.signature_ = signature_; + } else { + result.signature_ = signatureBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.build.Build) { + return mergeFrom((io.grafeas.v1beta1.build.Build)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.build.Build other) { + if (other == io.grafeas.v1beta1.build.Build.getDefaultInstance()) return this; + if (!other.getBuilderVersion().isEmpty()) { + builderVersion_ = other.builderVersion_; + onChanged(); + } + if (other.hasSignature()) { + mergeSignature(other.getSignature()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.build.Build parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.build.Build) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object builderVersion_ = ""; + /** + *
+     * Version of the builder which produced this Note.
+     * 
+ * + * string builder_version = 1; + */ + public java.lang.String getBuilderVersion() { + java.lang.Object ref = builderVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + builderVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Version of the builder which produced this Note.
+     * 
+ * + * string builder_version = 1; + */ + public com.google.protobuf.ByteString + getBuilderVersionBytes() { + java.lang.Object ref = builderVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + builderVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Version of the builder which produced this Note.
+     * 
+ * + * string builder_version = 1; + */ + public Builder setBuilderVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + builderVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * Version of the builder which produced this Note.
+     * 
+ * + * string builder_version = 1; + */ + public Builder clearBuilderVersion() { + + builderVersion_ = getDefaultInstance().getBuilderVersion(); + onChanged(); + return this; + } + /** + *
+     * Version of the builder which produced this Note.
+     * 
+ * + * string builder_version = 1; + */ + public Builder setBuilderVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + builderVersion_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.build.BuildSignature signature_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.BuildSignature, io.grafeas.v1beta1.build.BuildSignature.Builder, io.grafeas.v1beta1.build.BuildSignatureOrBuilder> signatureBuilder_; + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public boolean hasSignature() { + return signatureBuilder_ != null || signature_ != null; + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public io.grafeas.v1beta1.build.BuildSignature getSignature() { + if (signatureBuilder_ == null) { + return signature_ == null ? io.grafeas.v1beta1.build.BuildSignature.getDefaultInstance() : signature_; + } else { + return signatureBuilder_.getMessage(); + } + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public Builder setSignature(io.grafeas.v1beta1.build.BuildSignature value) { + if (signatureBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + signature_ = value; + onChanged(); + } else { + signatureBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public Builder setSignature( + io.grafeas.v1beta1.build.BuildSignature.Builder builderForValue) { + if (signatureBuilder_ == null) { + signature_ = builderForValue.build(); + onChanged(); + } else { + signatureBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public Builder mergeSignature(io.grafeas.v1beta1.build.BuildSignature value) { + if (signatureBuilder_ == null) { + if (signature_ != null) { + signature_ = + io.grafeas.v1beta1.build.BuildSignature.newBuilder(signature_).mergeFrom(value).buildPartial(); + } else { + signature_ = value; + } + onChanged(); + } else { + signatureBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public Builder clearSignature() { + if (signatureBuilder_ == null) { + signature_ = null; + onChanged(); + } else { + signature_ = null; + signatureBuilder_ = null; + } + + return this; + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public io.grafeas.v1beta1.build.BuildSignature.Builder getSignatureBuilder() { + + onChanged(); + return getSignatureFieldBuilder().getBuilder(); + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + public io.grafeas.v1beta1.build.BuildSignatureOrBuilder getSignatureOrBuilder() { + if (signatureBuilder_ != null) { + return signatureBuilder_.getMessageOrBuilder(); + } else { + return signature_ == null ? + io.grafeas.v1beta1.build.BuildSignature.getDefaultInstance() : signature_; + } + } + /** + *
+     * Signature of the build in Occurrences pointing to the Note containing this
+     * `BuilderDetails`.
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.BuildSignature, io.grafeas.v1beta1.build.BuildSignature.Builder, io.grafeas.v1beta1.build.BuildSignatureOrBuilder> + getSignatureFieldBuilder() { + if (signatureBuilder_ == null) { + signatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.build.BuildSignature, io.grafeas.v1beta1.build.BuildSignature.Builder, io.grafeas.v1beta1.build.BuildSignatureOrBuilder>( + getSignature(), + getParentForChildren(), + isClean()); + signature_ = null; + } + return signatureBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.build.Build) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.build.Build) + private static final io.grafeas.v1beta1.build.Build DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.build.Build(); + } + + public static io.grafeas.v1beta1.build.Build getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Build parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Build(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Build getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOrBuilder.java new file mode 100644 index 000000000000..856716414712 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOrBuilder.java @@ -0,0 +1,55 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +public interface BuildOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.build.Build) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Version of the builder which produced this Note.
+   * 
+ * + * string builder_version = 1; + */ + java.lang.String getBuilderVersion(); + /** + *
+   * Version of the builder which produced this Note.
+   * 
+ * + * string builder_version = 1; + */ + com.google.protobuf.ByteString + getBuilderVersionBytes(); + + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + boolean hasSignature(); + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + io.grafeas.v1beta1.build.BuildSignature getSignature(); + /** + *
+   * Signature of the build in Occurrences pointing to the Note containing this
+   * `BuilderDetails`.
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature signature = 2; + */ + io.grafeas.v1beta1.build.BuildSignatureOrBuilder getSignatureOrBuilder(); +} 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 new file mode 100644 index 000000000000..146095ef2eb2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildOuterClass.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +public final class BuildOuterClass { + private BuildOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_build_Build_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_build_Build_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_build_BuildSignature_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_build_BuildSignature_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_build_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_build_Details_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n;google/devtools/containeranalysis/v1be" + + "ta1/build/build.proto\022\025grafeas.v1beta1.b" + + "uild\032Egoogle/devtools/containeranalysis/" + + "v1beta1/provenance/provenance.proto\"Z\n\005B" + + "uild\022\027\n\017builder_version\030\001 \001(\t\0228\n\tsignatu" + + "re\030\002 \001(\0132%.grafeas.v1beta1.build.BuildSi" + + "gnature\"\322\001\n\016BuildSignature\022\022\n\npublic_key" + + "\030\001 \001(\t\022\021\n\tsignature\030\002 \001(\014\022\016\n\006key_id\030\003 \001(" + + "\t\022?\n\010key_type\030\004 \001(\0162-.grafeas.v1beta1.bu" + + "ild.BuildSignature.KeyType\"H\n\007KeyType\022\030\n" + + "\024KEY_TYPE_UNSPECIFIED\020\000\022\025\n\021PGP_ASCII_ARM" + + "ORED\020\001\022\014\n\010PKIX_PEM\020\002\"d\n\007Details\022?\n\nprove" + + "nance\030\001 \001(\0132+.grafeas.v1beta1.provenance" + + ".BuildProvenance\022\030\n\020provenance_bytes\030\002 \001" + + "(\tBx\n\030io.grafeas.v1beta1.buildP\001ZTgoogle" + + ".golang.org/genproto/googleapis/devtools" + + "/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); + internal_static_grafeas_v1beta1_build_Build_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_build_Build_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_build_Build_descriptor, + new java.lang.String[] { "BuilderVersion", "Signature", }); + internal_static_grafeas_v1beta1_build_BuildSignature_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_build_BuildSignature_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_build_BuildSignature_descriptor, + new java.lang.String[] { "PublicKey", "Signature", "KeyId", "KeyType", }); + internal_static_grafeas_v1beta1_build_Details_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_build_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_build_Details_descriptor, + new java.lang.String[] { "Provenance", "ProvenanceBytes", }); + io.grafeas.v1beta1.provenance.Provenance.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..42320f5e69d5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignature.java @@ -0,0 +1,1159 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +/** + *
+ * Message encapsulating the signature of the verified build.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.BuildSignature} + */ +public final class BuildSignature extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.build.BuildSignature) + BuildSignatureOrBuilder { +private static final long serialVersionUID = 0L; + // Use BuildSignature.newBuilder() to construct. + private BuildSignature(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BuildSignature() { + publicKey_ = ""; + signature_ = com.google.protobuf.ByteString.EMPTY; + keyId_ = ""; + keyType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BuildSignature( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + publicKey_ = s; + break; + } + case 18: { + + signature_ = input.readBytes(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + keyId_ = s; + break; + } + case 32: { + int rawValue = input.readEnum(); + + keyType_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_BuildSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_BuildSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.BuildSignature.class, io.grafeas.v1beta1.build.BuildSignature.Builder.class); + } + + /** + *
+   * Public key formats
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.build.BuildSignature.KeyType} + */ + public enum KeyType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * `KeyType` is not set.
+     * 
+ * + * KEY_TYPE_UNSPECIFIED = 0; + */ + KEY_TYPE_UNSPECIFIED(0), + /** + *
+     * `PGP ASCII Armored` public key.
+     * 
+ * + * PGP_ASCII_ARMORED = 1; + */ + PGP_ASCII_ARMORED(1), + /** + *
+     * `PKIX PEM` public key.
+     * 
+ * + * PKIX_PEM = 2; + */ + PKIX_PEM(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * `KeyType` is not set.
+     * 
+ * + * KEY_TYPE_UNSPECIFIED = 0; + */ + public static final int KEY_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * `PGP ASCII Armored` public key.
+     * 
+ * + * PGP_ASCII_ARMORED = 1; + */ + public static final int PGP_ASCII_ARMORED_VALUE = 1; + /** + *
+     * `PKIX PEM` public key.
+     * 
+ * + * PKIX_PEM = 2; + */ + public static final int PKIX_PEM_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static KeyType valueOf(int value) { + return forNumber(value); + } + + public static KeyType forNumber(int value) { + switch (value) { + case 0: return KEY_TYPE_UNSPECIFIED; + case 1: return PGP_ASCII_ARMORED; + case 2: return PKIX_PEM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + KeyType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public KeyType findValueByNumber(int number) { + return KeyType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildSignature.getDescriptor().getEnumTypes().get(0); + } + + private static final KeyType[] VALUES = values(); + + public static KeyType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private KeyType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.build.BuildSignature.KeyType) + } + + public static final int PUBLIC_KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object publicKey_; + /** + *
+   * Public key of the builder which can be used to verify that the related
+   * findings are valid and unchanged. If `key_type` is empty, this defaults
+   * to PEM encoded public keys.
+   * This field may be empty if `key_id` references an external key.
+   * For Cloud Container Builder based signatures, this is a PEM encoded public
+   * key. To verify the Cloud Container Builder signature, place the contents of
+   * this field into a file (public.pem). The signature field is base64-decoded
+   * into its binary representation in signature.bin, and the provenance bytes
+   * from `BuildDetails` are base64-decoded into a binary representation in
+   * signed.bin. OpenSSL can then verify the signature:
+   * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+   * 
+ * + * string public_key = 1; + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } + } + /** + *
+   * Public key of the builder which can be used to verify that the related
+   * findings are valid and unchanged. If `key_type` is empty, this defaults
+   * to PEM encoded public keys.
+   * This field may be empty if `key_id` references an external key.
+   * For Cloud Container Builder based signatures, this is a PEM encoded public
+   * key. To verify the Cloud Container Builder signature, place the contents of
+   * this field into a file (public.pem). The signature field is base64-decoded
+   * into its binary representation in signature.bin, and the provenance bytes
+   * from `BuildDetails` are base64-decoded into a binary representation in
+   * signed.bin. OpenSSL can then verify the signature:
+   * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+   * 
+ * + * string public_key = 1; + */ + public com.google.protobuf.ByteString + getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString signature_; + /** + *
+   * Signature of the related `BuildProvenance`. In JSON, this is base-64
+   * encoded.
+   * 
+ * + * bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + + public static final int KEY_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object keyId_; + /** + *
+   * An ID for the key used to sign. This could be either an Id for the key
+   * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+   * CN for a cert), or a reference to an external key (such as a reference to a
+   * key in Cloud Key Management Service).
+   * 
+ * + * string key_id = 3; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } + } + /** + *
+   * An ID for the key used to sign. This could be either an Id for the key
+   * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+   * CN for a cert), or a reference to an external key (such as a reference to a
+   * key in Cloud Key Management Service).
+   * 
+ * + * string key_id = 3; + */ + public com.google.protobuf.ByteString + getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_TYPE_FIELD_NUMBER = 4; + private int keyType_; + /** + *
+   * The type of the key, either stored in `public_key` or referenced in
+   * `key_id`
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public int getKeyTypeValue() { + return keyType_; + } + /** + *
+   * The type of the key, either stored in `public_key` or referenced in
+   * `key_id`
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public io.grafeas.v1beta1.build.BuildSignature.KeyType getKeyType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.build.BuildSignature.KeyType result = io.grafeas.v1beta1.build.BuildSignature.KeyType.valueOf(keyType_); + return result == null ? io.grafeas.v1beta1.build.BuildSignature.KeyType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getPublicKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, publicKey_); + } + if (!signature_.isEmpty()) { + output.writeBytes(2, signature_); + } + if (!getKeyIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, keyId_); + } + if (keyType_ != io.grafeas.v1beta1.build.BuildSignature.KeyType.KEY_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, keyType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPublicKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, publicKey_); + } + if (!signature_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, signature_); + } + if (!getKeyIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, keyId_); + } + if (keyType_ != io.grafeas.v1beta1.build.BuildSignature.KeyType.KEY_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, keyType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.build.BuildSignature)) { + return super.equals(obj); + } + io.grafeas.v1beta1.build.BuildSignature other = (io.grafeas.v1beta1.build.BuildSignature) obj; + + boolean result = true; + result = result && getPublicKey() + .equals(other.getPublicKey()); + result = result && getSignature() + .equals(other.getSignature()); + result = result && getKeyId() + .equals(other.getKeyId()); + result = result && keyType_ == other.keyType_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PUBLIC_KEY_FIELD_NUMBER; + hash = (53 * hash) + getPublicKey().hashCode(); + hash = (37 * hash) + SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getSignature().hashCode(); + hash = (37 * hash) + KEY_ID_FIELD_NUMBER; + hash = (53 * hash) + getKeyId().hashCode(); + hash = (37 * hash) + KEY_TYPE_FIELD_NUMBER; + hash = (53 * hash) + keyType_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.BuildSignature parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.BuildSignature parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.BuildSignature parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.build.BuildSignature prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message encapsulating the signature of the verified build.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.BuildSignature} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.build.BuildSignature) + io.grafeas.v1beta1.build.BuildSignatureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_BuildSignature_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_BuildSignature_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.BuildSignature.class, io.grafeas.v1beta1.build.BuildSignature.Builder.class); + } + + // Construct using io.grafeas.v1beta1.build.BuildSignature.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + publicKey_ = ""; + + signature_ = com.google.protobuf.ByteString.EMPTY; + + keyId_ = ""; + + keyType_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_BuildSignature_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.BuildSignature getDefaultInstanceForType() { + return io.grafeas.v1beta1.build.BuildSignature.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.build.BuildSignature build() { + io.grafeas.v1beta1.build.BuildSignature result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.BuildSignature buildPartial() { + io.grafeas.v1beta1.build.BuildSignature result = new io.grafeas.v1beta1.build.BuildSignature(this); + result.publicKey_ = publicKey_; + result.signature_ = signature_; + result.keyId_ = keyId_; + result.keyType_ = keyType_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.build.BuildSignature) { + return mergeFrom((io.grafeas.v1beta1.build.BuildSignature)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.build.BuildSignature other) { + if (other == io.grafeas.v1beta1.build.BuildSignature.getDefaultInstance()) return this; + if (!other.getPublicKey().isEmpty()) { + publicKey_ = other.publicKey_; + onChanged(); + } + if (other.getSignature() != com.google.protobuf.ByteString.EMPTY) { + setSignature(other.getSignature()); + } + if (!other.getKeyId().isEmpty()) { + keyId_ = other.keyId_; + onChanged(); + } + if (other.keyType_ != 0) { + setKeyTypeValue(other.getKeyTypeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.build.BuildSignature parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.build.BuildSignature) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object publicKey_ = ""; + /** + *
+     * Public key of the builder which can be used to verify that the related
+     * findings are valid and unchanged. If `key_type` is empty, this defaults
+     * to PEM encoded public keys.
+     * This field may be empty if `key_id` references an external key.
+     * For Cloud Container Builder based signatures, this is a PEM encoded public
+     * key. To verify the Cloud Container Builder signature, place the contents of
+     * this field into a file (public.pem). The signature field is base64-decoded
+     * into its binary representation in signature.bin, and the provenance bytes
+     * from `BuildDetails` are base64-decoded into a binary representation in
+     * signed.bin. OpenSSL can then verify the signature:
+     * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+     * 
+ * + * string public_key = 1; + */ + public java.lang.String getPublicKey() { + java.lang.Object ref = publicKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + publicKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Public key of the builder which can be used to verify that the related
+     * findings are valid and unchanged. If `key_type` is empty, this defaults
+     * to PEM encoded public keys.
+     * This field may be empty if `key_id` references an external key.
+     * For Cloud Container Builder based signatures, this is a PEM encoded public
+     * key. To verify the Cloud Container Builder signature, place the contents of
+     * this field into a file (public.pem). The signature field is base64-decoded
+     * into its binary representation in signature.bin, and the provenance bytes
+     * from `BuildDetails` are base64-decoded into a binary representation in
+     * signed.bin. OpenSSL can then verify the signature:
+     * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+     * 
+ * + * string public_key = 1; + */ + public com.google.protobuf.ByteString + getPublicKeyBytes() { + java.lang.Object ref = publicKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + publicKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Public key of the builder which can be used to verify that the related
+     * findings are valid and unchanged. If `key_type` is empty, this defaults
+     * to PEM encoded public keys.
+     * This field may be empty if `key_id` references an external key.
+     * For Cloud Container Builder based signatures, this is a PEM encoded public
+     * key. To verify the Cloud Container Builder signature, place the contents of
+     * this field into a file (public.pem). The signature field is base64-decoded
+     * into its binary representation in signature.bin, and the provenance bytes
+     * from `BuildDetails` are base64-decoded into a binary representation in
+     * signed.bin. OpenSSL can then verify the signature:
+     * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+     * 
+ * + * string public_key = 1; + */ + public Builder setPublicKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + publicKey_ = value; + onChanged(); + return this; + } + /** + *
+     * Public key of the builder which can be used to verify that the related
+     * findings are valid and unchanged. If `key_type` is empty, this defaults
+     * to PEM encoded public keys.
+     * This field may be empty if `key_id` references an external key.
+     * For Cloud Container Builder based signatures, this is a PEM encoded public
+     * key. To verify the Cloud Container Builder signature, place the contents of
+     * this field into a file (public.pem). The signature field is base64-decoded
+     * into its binary representation in signature.bin, and the provenance bytes
+     * from `BuildDetails` are base64-decoded into a binary representation in
+     * signed.bin. OpenSSL can then verify the signature:
+     * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+     * 
+ * + * string public_key = 1; + */ + public Builder clearPublicKey() { + + publicKey_ = getDefaultInstance().getPublicKey(); + onChanged(); + return this; + } + /** + *
+     * Public key of the builder which can be used to verify that the related
+     * findings are valid and unchanged. If `key_type` is empty, this defaults
+     * to PEM encoded public keys.
+     * This field may be empty if `key_id` references an external key.
+     * For Cloud Container Builder based signatures, this is a PEM encoded public
+     * key. To verify the Cloud Container Builder signature, place the contents of
+     * this field into a file (public.pem). The signature field is base64-decoded
+     * into its binary representation in signature.bin, and the provenance bytes
+     * from `BuildDetails` are base64-decoded into a binary representation in
+     * signed.bin. OpenSSL can then verify the signature:
+     * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+     * 
+ * + * string public_key = 1; + */ + public Builder setPublicKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + publicKey_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * Signature of the related `BuildProvenance`. In JSON, this is base-64
+     * encoded.
+     * 
+ * + * bytes signature = 2; + */ + public com.google.protobuf.ByteString getSignature() { + return signature_; + } + /** + *
+     * Signature of the related `BuildProvenance`. In JSON, this is base-64
+     * encoded.
+     * 
+ * + * bytes signature = 2; + */ + public Builder setSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + signature_ = value; + onChanged(); + return this; + } + /** + *
+     * Signature of the related `BuildProvenance`. In JSON, this is base-64
+     * encoded.
+     * 
+ * + * bytes signature = 2; + */ + public Builder clearSignature() { + + signature_ = getDefaultInstance().getSignature(); + onChanged(); + return this; + } + + private java.lang.Object keyId_ = ""; + /** + *
+     * An ID for the key used to sign. This could be either an Id for the key
+     * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+     * CN for a cert), or a reference to an external key (such as a reference to a
+     * key in Cloud Key Management Service).
+     * 
+ * + * string key_id = 3; + */ + public java.lang.String getKeyId() { + java.lang.Object ref = keyId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + keyId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * An ID for the key used to sign. This could be either an Id for the key
+     * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+     * CN for a cert), or a reference to an external key (such as a reference to a
+     * key in Cloud Key Management Service).
+     * 
+ * + * string key_id = 3; + */ + public com.google.protobuf.ByteString + getKeyIdBytes() { + java.lang.Object ref = keyId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + keyId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * An ID for the key used to sign. This could be either an Id for the key
+     * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+     * CN for a cert), or a reference to an external key (such as a reference to a
+     * key in Cloud Key Management Service).
+     * 
+ * + * string key_id = 3; + */ + public Builder setKeyId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + keyId_ = value; + onChanged(); + return this; + } + /** + *
+     * An ID for the key used to sign. This could be either an Id for the key
+     * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+     * CN for a cert), or a reference to an external key (such as a reference to a
+     * key in Cloud Key Management Service).
+     * 
+ * + * string key_id = 3; + */ + public Builder clearKeyId() { + + keyId_ = getDefaultInstance().getKeyId(); + onChanged(); + return this; + } + /** + *
+     * An ID for the key used to sign. This could be either an Id for the key
+     * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+     * CN for a cert), or a reference to an external key (such as a reference to a
+     * key in Cloud Key Management Service).
+     * 
+ * + * string key_id = 3; + */ + public Builder setKeyIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + keyId_ = value; + onChanged(); + return this; + } + + private int keyType_ = 0; + /** + *
+     * The type of the key, either stored in `public_key` or referenced in
+     * `key_id`
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public int getKeyTypeValue() { + return keyType_; + } + /** + *
+     * The type of the key, either stored in `public_key` or referenced in
+     * `key_id`
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public Builder setKeyTypeValue(int value) { + keyType_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of the key, either stored in `public_key` or referenced in
+     * `key_id`
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public io.grafeas.v1beta1.build.BuildSignature.KeyType getKeyType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.build.BuildSignature.KeyType result = io.grafeas.v1beta1.build.BuildSignature.KeyType.valueOf(keyType_); + return result == null ? io.grafeas.v1beta1.build.BuildSignature.KeyType.UNRECOGNIZED : result; + } + /** + *
+     * The type of the key, either stored in `public_key` or referenced in
+     * `key_id`
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public Builder setKeyType(io.grafeas.v1beta1.build.BuildSignature.KeyType value) { + if (value == null) { + throw new NullPointerException(); + } + + keyType_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The type of the key, either stored in `public_key` or referenced in
+     * `key_id`
+     * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + public Builder clearKeyType() { + + keyType_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.build.BuildSignature) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.build.BuildSignature) + private static final io.grafeas.v1beta1.build.BuildSignature DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.build.BuildSignature(); + } + + public static io.grafeas.v1beta1.build.BuildSignature getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildSignature parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuildSignature(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.BuildSignature getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignatureOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignatureOrBuilder.java new file mode 100644 index 000000000000..0d26da36f634 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/BuildSignatureOrBuilder.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +public interface BuildSignatureOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.build.BuildSignature) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Public key of the builder which can be used to verify that the related
+   * findings are valid and unchanged. If `key_type` is empty, this defaults
+   * to PEM encoded public keys.
+   * This field may be empty if `key_id` references an external key.
+   * For Cloud Container Builder based signatures, this is a PEM encoded public
+   * key. To verify the Cloud Container Builder signature, place the contents of
+   * this field into a file (public.pem). The signature field is base64-decoded
+   * into its binary representation in signature.bin, and the provenance bytes
+   * from `BuildDetails` are base64-decoded into a binary representation in
+   * signed.bin. OpenSSL can then verify the signature:
+   * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+   * 
+ * + * string public_key = 1; + */ + java.lang.String getPublicKey(); + /** + *
+   * Public key of the builder which can be used to verify that the related
+   * findings are valid and unchanged. If `key_type` is empty, this defaults
+   * to PEM encoded public keys.
+   * This field may be empty if `key_id` references an external key.
+   * For Cloud Container Builder based signatures, this is a PEM encoded public
+   * key. To verify the Cloud Container Builder signature, place the contents of
+   * this field into a file (public.pem). The signature field is base64-decoded
+   * into its binary representation in signature.bin, and the provenance bytes
+   * from `BuildDetails` are base64-decoded into a binary representation in
+   * signed.bin. OpenSSL can then verify the signature:
+   * `openssl sha256 -verify public.pem -signature signature.bin signed.bin`
+   * 
+ * + * string public_key = 1; + */ + com.google.protobuf.ByteString + getPublicKeyBytes(); + + /** + *
+   * Signature of the related `BuildProvenance`. In JSON, this is base-64
+   * encoded.
+   * 
+ * + * bytes signature = 2; + */ + com.google.protobuf.ByteString getSignature(); + + /** + *
+   * An ID for the key used to sign. This could be either an Id for the key
+   * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+   * CN for a cert), or a reference to an external key (such as a reference to a
+   * key in Cloud Key Management Service).
+   * 
+ * + * string key_id = 3; + */ + java.lang.String getKeyId(); + /** + *
+   * An ID for the key used to sign. This could be either an Id for the key
+   * stored in `public_key` (such as the Id or fingerprint for a PGP key, or the
+   * CN for a cert), or a reference to an external key (such as a reference to a
+   * key in Cloud Key Management Service).
+   * 
+ * + * string key_id = 3; + */ + com.google.protobuf.ByteString + getKeyIdBytes(); + + /** + *
+   * The type of the key, either stored in `public_key` or referenced in
+   * `key_id`
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + int getKeyTypeValue(); + /** + *
+   * The type of the key, either stored in `public_key` or referenced in
+   * `key_id`
+   * 
+ * + * .grafeas.v1beta1.build.BuildSignature.KeyType key_type = 4; + */ + io.grafeas.v1beta1.build.BuildSignature.KeyType getKeyType(); +} 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 new file mode 100644 index 000000000000..a84ef132010d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/Details.java @@ -0,0 +1,869 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +/** + *
+ * Details of a build occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.build.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + provenanceBytes_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.provenance.BuildProvenance.Builder subBuilder = null; + if (provenance_ != null) { + subBuilder = provenance_.toBuilder(); + } + provenance_ = input.readMessage(io.grafeas.v1beta1.provenance.BuildProvenance.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provenance_); + provenance_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + provenanceBytes_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.Details.class, io.grafeas.v1beta1.build.Details.Builder.class); + } + + public static final int PROVENANCE_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.provenance.BuildProvenance provenance_; + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public boolean hasProvenance() { + return provenance_ != null; + } + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public io.grafeas.v1beta1.provenance.BuildProvenance getProvenance() { + return provenance_ == null ? io.grafeas.v1beta1.provenance.BuildProvenance.getDefaultInstance() : provenance_; + } + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder getProvenanceOrBuilder() { + return getProvenance(); + } + + public static final int PROVENANCE_BYTES_FIELD_NUMBER = 2; + private volatile java.lang.Object provenanceBytes_; + /** + *
+   * Serialized JSON representation of the provenance, used in generating the
+   * `BuildSignature` in the corresponding Result. After verifying the
+   * signature, `provenance_bytes` can be unmarshalled and compared to the
+   * provenance to confirm that it is unchanged. A base64-encoded string
+   * representation of the provenance bytes is used for the signature in order
+   * to interoperate with openssl which expects this format for signature
+   * verification.
+   * The serialized form is captured both to avoid ambiguity in how the
+   * provenance is marshalled to json as well to prevent incompatibilities with
+   * future changes.
+   * 
+ * + * string provenance_bytes = 2; + */ + public java.lang.String getProvenanceBytes() { + java.lang.Object ref = provenanceBytes_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provenanceBytes_ = s; + return s; + } + } + /** + *
+   * Serialized JSON representation of the provenance, used in generating the
+   * `BuildSignature` in the corresponding Result. After verifying the
+   * signature, `provenance_bytes` can be unmarshalled and compared to the
+   * provenance to confirm that it is unchanged. A base64-encoded string
+   * representation of the provenance bytes is used for the signature in order
+   * to interoperate with openssl which expects this format for signature
+   * verification.
+   * The serialized form is captured both to avoid ambiguity in how the
+   * provenance is marshalled to json as well to prevent incompatibilities with
+   * future changes.
+   * 
+ * + * string provenance_bytes = 2; + */ + public com.google.protobuf.ByteString + getProvenanceBytesBytes() { + java.lang.Object ref = provenanceBytes_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provenanceBytes_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (provenance_ != null) { + output.writeMessage(1, getProvenance()); + } + if (!getProvenanceBytesBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, provenanceBytes_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (provenance_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getProvenance()); + } + if (!getProvenanceBytesBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, provenanceBytes_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.build.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.build.Details other = (io.grafeas.v1beta1.build.Details) obj; + + boolean result = true; + result = result && (hasProvenance() == other.hasProvenance()); + if (hasProvenance()) { + result = result && getProvenance() + .equals(other.getProvenance()); + } + result = result && getProvenanceBytes() + .equals(other.getProvenanceBytes()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasProvenance()) { + hash = (37 * hash) + PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getProvenance().hashCode(); + } + hash = (37 * hash) + PROVENANCE_BYTES_FIELD_NUMBER; + hash = (53 * hash) + getProvenanceBytes().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.build.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.build.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.build.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of a build occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.build.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.build.Details) + io.grafeas.v1beta1.build.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.build.Details.class, io.grafeas.v1beta1.build.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.build.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (provenanceBuilder_ == null) { + provenance_ = null; + } else { + provenance_ = null; + provenanceBuilder_ = null; + } + provenanceBytes_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.build.BuildOuterClass.internal_static_grafeas_v1beta1_build_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.build.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Details build() { + io.grafeas.v1beta1.build.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Details buildPartial() { + io.grafeas.v1beta1.build.Details result = new io.grafeas.v1beta1.build.Details(this); + if (provenanceBuilder_ == null) { + result.provenance_ = provenance_; + } else { + result.provenance_ = provenanceBuilder_.build(); + } + result.provenanceBytes_ = provenanceBytes_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.build.Details) { + return mergeFrom((io.grafeas.v1beta1.build.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.build.Details other) { + if (other == io.grafeas.v1beta1.build.Details.getDefaultInstance()) return this; + if (other.hasProvenance()) { + mergeProvenance(other.getProvenance()); + } + if (!other.getProvenanceBytes().isEmpty()) { + provenanceBytes_ = other.provenanceBytes_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.build.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.build.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.provenance.BuildProvenance provenance_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.BuildProvenance, io.grafeas.v1beta1.provenance.BuildProvenance.Builder, io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder> provenanceBuilder_; + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public boolean hasProvenance() { + return provenanceBuilder_ != null || provenance_ != null; + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public io.grafeas.v1beta1.provenance.BuildProvenance getProvenance() { + if (provenanceBuilder_ == null) { + return provenance_ == null ? io.grafeas.v1beta1.provenance.BuildProvenance.getDefaultInstance() : provenance_; + } else { + return provenanceBuilder_.getMessage(); + } + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public Builder setProvenance(io.grafeas.v1beta1.provenance.BuildProvenance value) { + if (provenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + provenance_ = value; + onChanged(); + } else { + provenanceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public Builder setProvenance( + io.grafeas.v1beta1.provenance.BuildProvenance.Builder builderForValue) { + if (provenanceBuilder_ == null) { + provenance_ = builderForValue.build(); + onChanged(); + } else { + provenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public Builder mergeProvenance(io.grafeas.v1beta1.provenance.BuildProvenance value) { + if (provenanceBuilder_ == null) { + if (provenance_ != null) { + provenance_ = + io.grafeas.v1beta1.provenance.BuildProvenance.newBuilder(provenance_).mergeFrom(value).buildPartial(); + } else { + provenance_ = value; + } + onChanged(); + } else { + provenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public Builder clearProvenance() { + if (provenanceBuilder_ == null) { + provenance_ = null; + onChanged(); + } else { + provenance_ = null; + provenanceBuilder_ = null; + } + + return this; + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public io.grafeas.v1beta1.provenance.BuildProvenance.Builder getProvenanceBuilder() { + + onChanged(); + return getProvenanceFieldBuilder().getBuilder(); + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + public io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder getProvenanceOrBuilder() { + if (provenanceBuilder_ != null) { + return provenanceBuilder_.getMessageOrBuilder(); + } else { + return provenance_ == null ? + io.grafeas.v1beta1.provenance.BuildProvenance.getDefaultInstance() : provenance_; + } + } + /** + *
+     * The actual provenance for the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.BuildProvenance, io.grafeas.v1beta1.provenance.BuildProvenance.Builder, io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder> + getProvenanceFieldBuilder() { + if (provenanceBuilder_ == null) { + provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.BuildProvenance, io.grafeas.v1beta1.provenance.BuildProvenance.Builder, io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder>( + getProvenance(), + getParentForChildren(), + isClean()); + provenance_ = null; + } + return provenanceBuilder_; + } + + private java.lang.Object provenanceBytes_ = ""; + /** + *
+     * Serialized JSON representation of the provenance, used in generating the
+     * `BuildSignature` in the corresponding Result. After verifying the
+     * signature, `provenance_bytes` can be unmarshalled and compared to the
+     * provenance to confirm that it is unchanged. A base64-encoded string
+     * representation of the provenance bytes is used for the signature in order
+     * to interoperate with openssl which expects this format for signature
+     * verification.
+     * The serialized form is captured both to avoid ambiguity in how the
+     * provenance is marshalled to json as well to prevent incompatibilities with
+     * future changes.
+     * 
+ * + * string provenance_bytes = 2; + */ + public java.lang.String getProvenanceBytes() { + java.lang.Object ref = provenanceBytes_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + provenanceBytes_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Serialized JSON representation of the provenance, used in generating the
+     * `BuildSignature` in the corresponding Result. After verifying the
+     * signature, `provenance_bytes` can be unmarshalled and compared to the
+     * provenance to confirm that it is unchanged. A base64-encoded string
+     * representation of the provenance bytes is used for the signature in order
+     * to interoperate with openssl which expects this format for signature
+     * verification.
+     * The serialized form is captured both to avoid ambiguity in how the
+     * provenance is marshalled to json as well to prevent incompatibilities with
+     * future changes.
+     * 
+ * + * string provenance_bytes = 2; + */ + public com.google.protobuf.ByteString + getProvenanceBytesBytes() { + java.lang.Object ref = provenanceBytes_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + provenanceBytes_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Serialized JSON representation of the provenance, used in generating the
+     * `BuildSignature` in the corresponding Result. After verifying the
+     * signature, `provenance_bytes` can be unmarshalled and compared to the
+     * provenance to confirm that it is unchanged. A base64-encoded string
+     * representation of the provenance bytes is used for the signature in order
+     * to interoperate with openssl which expects this format for signature
+     * verification.
+     * The serialized form is captured both to avoid ambiguity in how the
+     * provenance is marshalled to json as well to prevent incompatibilities with
+     * future changes.
+     * 
+ * + * string provenance_bytes = 2; + */ + public Builder setProvenanceBytes( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + provenanceBytes_ = value; + onChanged(); + return this; + } + /** + *
+     * Serialized JSON representation of the provenance, used in generating the
+     * `BuildSignature` in the corresponding Result. After verifying the
+     * signature, `provenance_bytes` can be unmarshalled and compared to the
+     * provenance to confirm that it is unchanged. A base64-encoded string
+     * representation of the provenance bytes is used for the signature in order
+     * to interoperate with openssl which expects this format for signature
+     * verification.
+     * The serialized form is captured both to avoid ambiguity in how the
+     * provenance is marshalled to json as well to prevent incompatibilities with
+     * future changes.
+     * 
+ * + * string provenance_bytes = 2; + */ + public Builder clearProvenanceBytes() { + + provenanceBytes_ = getDefaultInstance().getProvenanceBytes(); + onChanged(); + return this; + } + /** + *
+     * Serialized JSON representation of the provenance, used in generating the
+     * `BuildSignature` in the corresponding Result. After verifying the
+     * signature, `provenance_bytes` can be unmarshalled and compared to the
+     * provenance to confirm that it is unchanged. A base64-encoded string
+     * representation of the provenance bytes is used for the signature in order
+     * to interoperate with openssl which expects this format for signature
+     * verification.
+     * The serialized form is captured both to avoid ambiguity in how the
+     * provenance is marshalled to json as well to prevent incompatibilities with
+     * future changes.
+     * 
+ * + * string provenance_bytes = 2; + */ + public Builder setProvenanceBytesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + provenanceBytes_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.build.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.build.Details) + private static final io.grafeas.v1beta1.build.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.build.Details(); + } + + public static io.grafeas.v1beta1.build.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.build.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/DetailsOrBuilder.java new file mode 100644 index 000000000000..40f8bb689f7c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/DetailsOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/build/build.proto + +package io.grafeas.v1beta1.build; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.build.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + boolean hasProvenance(); + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + io.grafeas.v1beta1.provenance.BuildProvenance getProvenance(); + /** + *
+   * The actual provenance for the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + */ + io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder getProvenanceOrBuilder(); + + /** + *
+   * Serialized JSON representation of the provenance, used in generating the
+   * `BuildSignature` in the corresponding Result. After verifying the
+   * signature, `provenance_bytes` can be unmarshalled and compared to the
+   * provenance to confirm that it is unchanged. A base64-encoded string
+   * representation of the provenance bytes is used for the signature in order
+   * to interoperate with openssl which expects this format for signature
+   * verification.
+   * The serialized form is captured both to avoid ambiguity in how the
+   * provenance is marshalled to json as well to prevent incompatibilities with
+   * future changes.
+   * 
+ * + * string provenance_bytes = 2; + */ + java.lang.String getProvenanceBytes(); + /** + *
+   * Serialized JSON representation of the provenance, used in generating the
+   * `BuildSignature` in the corresponding Result. After verifying the
+   * signature, `provenance_bytes` can be unmarshalled and compared to the
+   * provenance to confirm that it is unchanged. A base64-encoded string
+   * representation of the provenance bytes is used for the signature in order
+   * to interoperate with openssl which expects this format for signature
+   * verification.
+   * The serialized form is captured both to avoid ambiguity in how the
+   * provenance is marshalled to json as well to prevent incompatibilities with
+   * future changes.
+   * 
+ * + * string provenance_bytes = 2; + */ + com.google.protobuf.ByteString + getProvenanceBytesBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/NoteName.java new file mode 100644 index 000000000000..4694312921d2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.build; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/build/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/OccurrenceName.java new file mode 100644 index 000000000000..788f083c49f5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.build; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/build/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/ProjectName.java new file mode 100644 index 000000000000..3634ca3dc88a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.build; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/build/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/ScanConfigName.java new file mode 100644 index 000000000000..9afea94ea408 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/build/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.build; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..8a0483622ea9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/Common.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/common/common.proto + +package io.grafeas.v1beta1.common; + +public final class Common { + private Common() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_RelatedUrl_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_RelatedUrl_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n=google/devtools/containeranalysis/v1be" + + "ta1/common/common.proto\022\017grafeas.v1beta1" + + "\"(\n\nRelatedUrl\022\013\n\003url\030\001 \001(\t\022\r\n\005label\030\002 \001" + + "(\t*\213\001\n\010NoteKind\022\031\n\025NOTE_KIND_UNSPECIFIED" + + "\020\000\022\021\n\rVULNERABILITY\020\001\022\t\n\005BUILD\020\002\022\t\n\005IMAG" + + "E\020\003\022\013\n\007PACKAGE\020\004\022\016\n\nDEPLOYMENT\020\005\022\r\n\tDISC" + + "OVERY\020\006\022\017\n\013ATTESTATION\020\007B{\n\031io.grafeas.v" + + "1beta1.commonP\001ZVgoogle.golang.org/genpr" + + "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); + internal_static_grafeas_v1beta1_RelatedUrl_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_RelatedUrl_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_RelatedUrl_descriptor, + new java.lang.String[] { "Url", "Label", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteKind.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteKind.java new file mode 100644 index 000000000000..75adc0675ce3 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteKind.java @@ -0,0 +1,225 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/common/common.proto + +package io.grafeas.v1beta1.common; + +/** + *
+ * Kind represents the kinds of notes supported.
+ * 
+ * + * Protobuf enum {@code grafeas.v1beta1.NoteKind} + */ +public enum NoteKind + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unknown.
+   * 
+ * + * NOTE_KIND_UNSPECIFIED = 0; + */ + NOTE_KIND_UNSPECIFIED(0), + /** + *
+   * The note and occurrence represent a package vulnerability.
+   * 
+ * + * VULNERABILITY = 1; + */ + VULNERABILITY(1), + /** + *
+   * The note and occurrence assert build provenance.
+   * 
+ * + * BUILD = 2; + */ + BUILD(2), + /** + *
+   * This represents an image basis relationship.
+   * 
+ * + * IMAGE = 3; + */ + IMAGE(3), + /** + *
+   * This represents a package installed via a package manager.
+   * 
+ * + * PACKAGE = 4; + */ + PACKAGE(4), + /** + *
+   * The note and occurrence track deployment events.
+   * 
+ * + * DEPLOYMENT = 5; + */ + DEPLOYMENT(5), + /** + *
+   * The note and occurrence track the initial discovery status of a resource.
+   * 
+ * + * DISCOVERY = 6; + */ + DISCOVERY(6), + /** + *
+   * This represents a logical "role" that can attest to artifacts.
+   * 
+ * + * ATTESTATION = 7; + */ + ATTESTATION(7), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unknown.
+   * 
+ * + * NOTE_KIND_UNSPECIFIED = 0; + */ + public static final int NOTE_KIND_UNSPECIFIED_VALUE = 0; + /** + *
+   * The note and occurrence represent a package vulnerability.
+   * 
+ * + * VULNERABILITY = 1; + */ + public static final int VULNERABILITY_VALUE = 1; + /** + *
+   * The note and occurrence assert build provenance.
+   * 
+ * + * BUILD = 2; + */ + public static final int BUILD_VALUE = 2; + /** + *
+   * This represents an image basis relationship.
+   * 
+ * + * IMAGE = 3; + */ + public static final int IMAGE_VALUE = 3; + /** + *
+   * This represents a package installed via a package manager.
+   * 
+ * + * PACKAGE = 4; + */ + public static final int PACKAGE_VALUE = 4; + /** + *
+   * The note and occurrence track deployment events.
+   * 
+ * + * DEPLOYMENT = 5; + */ + public static final int DEPLOYMENT_VALUE = 5; + /** + *
+   * The note and occurrence track the initial discovery status of a resource.
+   * 
+ * + * DISCOVERY = 6; + */ + public static final int DISCOVERY_VALUE = 6; + /** + *
+   * This represents a logical "role" that can attest to artifacts.
+   * 
+ * + * ATTESTATION = 7; + */ + public static final int ATTESTATION_VALUE = 7; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static NoteKind valueOf(int value) { + return forNumber(value); + } + + public static NoteKind forNumber(int value) { + switch (value) { + case 0: return NOTE_KIND_UNSPECIFIED; + case 1: return VULNERABILITY; + case 2: return BUILD; + case 3: return IMAGE; + case 4: return PACKAGE; + case 5: return DEPLOYMENT; + case 6: return DISCOVERY; + case 7: return ATTESTATION; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NoteKind> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public NoteKind findValueByNumber(int number) { + return NoteKind.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.common.Common.getDescriptor().getEnumTypes().get(0); + } + + private static final NoteKind[] VALUES = values(); + + public static NoteKind valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private NoteKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.NoteKind) +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteName.java new file mode 100644 index 000000000000..812442fa6567 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.common; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/common/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/OccurrenceName.java new file mode 100644 index 000000000000..0d3e7fc3d95d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.common; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/common/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/ProjectName.java new file mode 100644 index 000000000000..fe49649dd52c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.common; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-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 new file mode 100644 index 000000000000..16133571d457 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrl.java @@ -0,0 +1,732 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/common/common.proto + +package io.grafeas.v1beta1.common; + +/** + *
+ * Metadata for any related URL information.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.RelatedUrl} + */ +public final class RelatedUrl extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.RelatedUrl) + RelatedUrlOrBuilder { +private static final long serialVersionUID = 0L; + // Use RelatedUrl.newBuilder() to construct. + private RelatedUrl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RelatedUrl() { + url_ = ""; + label_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RelatedUrl( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.common.Common.internal_static_grafeas_v1beta1_RelatedUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.common.Common.internal_static_grafeas_v1beta1_RelatedUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.common.RelatedUrl.class, io.grafeas.v1beta1.common.RelatedUrl.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + *
+   * Specific URL associated with the resource.
+   * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + *
+   * Specific URL associated with the resource.
+   * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 2; + private volatile java.lang.Object label_; + /** + *
+   * Label to describe usage of the URL.
+   * 
+ * + * string label = 2; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } + } + /** + *
+   * Label to describe usage of the URL.
+   * 
+ * + * string label = 2; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, label_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, label_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.common.RelatedUrl)) { + return super.equals(obj); + } + io.grafeas.v1beta1.common.RelatedUrl other = (io.grafeas.v1beta1.common.RelatedUrl) obj; + + boolean result = true; + result = result && getUrl() + .equals(other.getUrl()); + result = result && getLabel() + .equals(other.getLabel()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.common.RelatedUrl parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.common.RelatedUrl prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Metadata for any related URL information.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.RelatedUrl} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.RelatedUrl) + io.grafeas.v1beta1.common.RelatedUrlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.common.Common.internal_static_grafeas_v1beta1_RelatedUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.common.Common.internal_static_grafeas_v1beta1_RelatedUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.common.RelatedUrl.class, io.grafeas.v1beta1.common.RelatedUrl.Builder.class); + } + + // Construct using io.grafeas.v1beta1.common.RelatedUrl.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + label_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.common.Common.internal_static_grafeas_v1beta1_RelatedUrl_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.common.RelatedUrl getDefaultInstanceForType() { + return io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.common.RelatedUrl build() { + io.grafeas.v1beta1.common.RelatedUrl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.common.RelatedUrl buildPartial() { + io.grafeas.v1beta1.common.RelatedUrl result = new io.grafeas.v1beta1.common.RelatedUrl(this); + result.url_ = url_; + result.label_ = label_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.common.RelatedUrl) { + return mergeFrom((io.grafeas.v1beta1.common.RelatedUrl)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.common.RelatedUrl other) { + if (other == io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.common.RelatedUrl parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.common.RelatedUrl) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+     * Specific URL associated with the resource.
+     * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Specific URL associated with the resource.
+     * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Specific URL associated with the resource.
+     * 
+ * + * string url = 1; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+     * Specific URL associated with the resource.
+     * 
+ * + * string url = 1; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+     * Specific URL associated with the resource.
+     * 
+ * + * string url = 1; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+     * Label to describe usage of the URL.
+     * 
+ * + * string label = 2; + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Label to describe usage of the URL.
+     * 
+ * + * string label = 2; + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Label to describe usage of the URL.
+     * 
+ * + * string label = 2; + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+     * Label to describe usage of the URL.
+     * 
+ * + * string label = 2; + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+     * Label to describe usage of the URL.
+     * 
+ * + * string label = 2; + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.RelatedUrl) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.RelatedUrl) + private static final io.grafeas.v1beta1.common.RelatedUrl DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.common.RelatedUrl(); + } + + public static io.grafeas.v1beta1.common.RelatedUrl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelatedUrl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelatedUrl(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.common.RelatedUrl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrlOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrlOrBuilder.java new file mode 100644 index 000000000000..fde0e7bb3ed8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/RelatedUrlOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/common/common.proto + +package io.grafeas.v1beta1.common; + +public interface RelatedUrlOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.RelatedUrl) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Specific URL associated with the resource.
+   * 
+ * + * string url = 1; + */ + java.lang.String getUrl(); + /** + *
+   * Specific URL associated with the resource.
+   * 
+ * + * string url = 1; + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * Label to describe usage of the URL.
+   * 
+ * + * string label = 2; + */ + java.lang.String getLabel(); + /** + *
+   * Label to describe usage of the URL.
+   * 
+ * + * string label = 2; + */ + com.google.protobuf.ByteString + getLabelBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/ScanConfigName.java new file mode 100644 index 000000000000..018251fb7fcf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/common/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.common; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..84fe0163ea9a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployable.java @@ -0,0 +1,646 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +/** + *
+ * An artifact that can be deployed in some runtime.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Deployable} + */ +public final class Deployable extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.deployment.Deployable) + DeployableOrBuilder { +private static final long serialVersionUID = 0L; + // Use Deployable.newBuilder() to construct. + private Deployable(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Deployable() { + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Deployable( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + resourceUri_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + resourceUri_.add(s); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + resourceUri_ = resourceUri_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployable_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Deployable.class, io.grafeas.v1beta1.deployment.Deployable.Builder.class); + } + + public static final int RESOURCE_URI_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList resourceUri_; + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + public com.google.protobuf.ProtocolStringList + getResourceUriList() { + return resourceUri_; + } + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + public int getResourceUriCount() { + return resourceUri_.size(); + } + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + public java.lang.String getResourceUri(int index) { + return resourceUri_.get(index); + } + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + public com.google.protobuf.ByteString + getResourceUriBytes(int index) { + return resourceUri_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < resourceUri_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceUri_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < resourceUri_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceUri_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceUriList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.deployment.Deployable)) { + return super.equals(obj); + } + io.grafeas.v1beta1.deployment.Deployable other = (io.grafeas.v1beta1.deployment.Deployable) obj; + + boolean result = true; + result = result && getResourceUriList() + .equals(other.getResourceUriList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getResourceUriCount() > 0) { + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUriList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployable parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployable parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployable parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.deployment.Deployable prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An artifact that can be deployed in some runtime.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Deployable} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.deployment.Deployable) + io.grafeas.v1beta1.deployment.DeployableOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployable_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployable_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Deployable.class, io.grafeas.v1beta1.deployment.Deployable.Builder.class); + } + + // Construct using io.grafeas.v1beta1.deployment.Deployable.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployable_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployable getDefaultInstanceForType() { + return io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployable build() { + io.grafeas.v1beta1.deployment.Deployable result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployable buildPartial() { + io.grafeas.v1beta1.deployment.Deployable result = new io.grafeas.v1beta1.deployment.Deployable(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + resourceUri_ = resourceUri_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.resourceUri_ = resourceUri_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.deployment.Deployable) { + return mergeFrom((io.grafeas.v1beta1.deployment.Deployable)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.deployment.Deployable other) { + if (other == io.grafeas.v1beta1.deployment.Deployable.getDefaultInstance()) return this; + if (!other.resourceUri_.isEmpty()) { + if (resourceUri_.isEmpty()) { + resourceUri_ = other.resourceUri_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureResourceUriIsMutable(); + resourceUri_.addAll(other.resourceUri_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.deployment.Deployable parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.deployment.Deployable) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureResourceUriIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + resourceUri_ = new com.google.protobuf.LazyStringArrayList(resourceUri_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public com.google.protobuf.ProtocolStringList + getResourceUriList() { + return resourceUri_.getUnmodifiableView(); + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public int getResourceUriCount() { + return resourceUri_.size(); + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public java.lang.String getResourceUri(int index) { + return resourceUri_.get(index); + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public com.google.protobuf.ByteString + getResourceUriBytes(int index) { + return resourceUri_.getByteString(index); + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public Builder setResourceUri( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceUriIsMutable(); + resourceUri_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public Builder addResourceUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceUriIsMutable(); + resourceUri_.add(value); + onChanged(); + return this; + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public Builder addAllResourceUri( + java.lang.Iterable values) { + ensureResourceUriIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceUri_); + onChanged(); + return this; + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public Builder clearResourceUri() { + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * Resource URI for the artifact being deployed.
+     * 
+ * + * repeated string resource_uri = 1; + */ + public Builder addResourceUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceUriIsMutable(); + resourceUri_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.deployment.Deployable) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.deployment.Deployable) + private static final io.grafeas.v1beta1.deployment.Deployable DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.deployment.Deployable(); + } + + public static io.grafeas.v1beta1.deployment.Deployable getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Deployable parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Deployable(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployable getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeployableOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeployableOrBuilder.java new file mode 100644 index 000000000000..2e5e4122884f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeployableOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +public interface DeployableOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.deployment.Deployable) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + java.util.List + getResourceUriList(); + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + int getResourceUriCount(); + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + java.lang.String getResourceUri(int index); + /** + *
+   * Resource URI for the artifact being deployed.
+   * 
+ * + * repeated string resource_uri = 1; + */ + com.google.protobuf.ByteString + getResourceUriBytes(int index); +} 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 new file mode 100644 index 000000000000..f8372c739a24 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Deployment.java @@ -0,0 +1,1850 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +/** + *
+ * The period during which some deployable was active in a runtime.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Deployment} + */ +public final class Deployment extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.deployment.Deployment) + DeploymentOrBuilder { +private static final long serialVersionUID = 0L; + // Use Deployment.newBuilder() to construct. + private Deployment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Deployment() { + userEmail_ = ""; + config_ = ""; + address_ = ""; + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + platform_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Deployment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + userEmail_ = s; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (deployTime_ != null) { + subBuilder = deployTime_.toBuilder(); + } + deployTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deployTime_); + deployTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (undeployTime_ != null) { + subBuilder = undeployTime_.toBuilder(); + } + undeployTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(undeployTime_); + undeployTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + config_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + address_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + resourceUri_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + resourceUri_.add(s); + break; + } + case 56: { + int rawValue = input.readEnum(); + + platform_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + resourceUri_ = resourceUri_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Deployment.class, io.grafeas.v1beta1.deployment.Deployment.Builder.class); + } + + /** + *
+   * Types of platforms.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.deployment.Deployment.Platform} + */ + public enum Platform + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * PLATFORM_UNSPECIFIED = 0; + */ + PLATFORM_UNSPECIFIED(0), + /** + *
+     * Google Container Engine.
+     * 
+ * + * GKE = 1; + */ + GKE(1), + /** + *
+     * Google App Engine: Flexible Environment.
+     * 
+ * + * FLEX = 2; + */ + FLEX(2), + /** + *
+     * Custom user-defined platform.
+     * 
+ * + * CUSTOM = 3; + */ + CUSTOM(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * PLATFORM_UNSPECIFIED = 0; + */ + public static final int PLATFORM_UNSPECIFIED_VALUE = 0; + /** + *
+     * Google Container Engine.
+     * 
+ * + * GKE = 1; + */ + public static final int GKE_VALUE = 1; + /** + *
+     * Google App Engine: Flexible Environment.
+     * 
+ * + * FLEX = 2; + */ + public static final int FLEX_VALUE = 2; + /** + *
+     * Custom user-defined platform.
+     * 
+ * + * CUSTOM = 3; + */ + public static final int CUSTOM_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Platform valueOf(int value) { + return forNumber(value); + } + + public static Platform forNumber(int value) { + switch (value) { + case 0: return PLATFORM_UNSPECIFIED; + case 1: return GKE; + case 2: return FLEX; + case 3: return CUSTOM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Platform> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Platform findValueByNumber(int number) { + return Platform.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.Deployment.getDescriptor().getEnumTypes().get(0); + } + + private static final Platform[] VALUES = values(); + + public static Platform valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Platform(int value) { + this.value = 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_; + /** + *
+   * Identity of the user that triggered this deployment.
+   * 
+ * + * string user_email = 1; + */ + public java.lang.String getUserEmail() { + java.lang.Object ref = userEmail_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userEmail_ = s; + return s; + } + } + /** + *
+   * Identity of the user that triggered this deployment.
+   * 
+ * + * string user_email = 1; + */ + public com.google.protobuf.ByteString + getUserEmailBytes() { + java.lang.Object ref = userEmail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DEPLOY_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp deployTime_; + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public boolean hasDeployTime() { + return deployTime_ != null; + } + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public com.google.protobuf.Timestamp getDeployTime() { + return deployTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deployTime_; + } + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder() { + return getDeployTime(); + } + + public static final int UNDEPLOY_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp undeployTime_; + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public boolean hasUndeployTime() { + return undeployTime_ != null; + } + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public com.google.protobuf.Timestamp getUndeployTime() { + return undeployTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : undeployTime_; + } + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUndeployTimeOrBuilder() { + return getUndeployTime(); + } + + public static final int CONFIG_FIELD_NUMBER = 4; + private volatile java.lang.Object config_; + /** + *
+   * Configuration used to create this deployment.
+   * 
+ * + * string config = 4; + */ + public java.lang.String getConfig() { + java.lang.Object ref = config_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + config_ = s; + return s; + } + } + /** + *
+   * Configuration used to create this deployment.
+   * 
+ * + * string config = 4; + */ + public com.google.protobuf.ByteString + getConfigBytes() { + java.lang.Object ref = config_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + config_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDRESS_FIELD_NUMBER = 5; + private volatile java.lang.Object address_; + /** + *
+   * Address of the runtime element hosting this deployment.
+   * 
+ * + * string address = 5; + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + *
+   * Address of the runtime element hosting this deployment.
+   * 
+ * + * string address = 5; + */ + public com.google.protobuf.ByteString + getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_URI_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList resourceUri_; + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + public com.google.protobuf.ProtocolStringList + getResourceUriList() { + return resourceUri_; + } + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + public int getResourceUriCount() { + return resourceUri_.size(); + } + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + public java.lang.String getResourceUri(int index) { + return resourceUri_.get(index); + } + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + public com.google.protobuf.ByteString + getResourceUriBytes(int index) { + return resourceUri_.getByteString(index); + } + + public static final int PLATFORM_FIELD_NUMBER = 7; + private int platform_; + /** + *
+   * Platform hosting this deployment.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public int getPlatformValue() { + return platform_; + } + /** + *
+   * Platform hosting this deployment.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public io.grafeas.v1beta1.deployment.Deployment.Platform getPlatform() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.deployment.Deployment.Platform result = io.grafeas.v1beta1.deployment.Deployment.Platform.valueOf(platform_); + return result == null ? io.grafeas.v1beta1.deployment.Deployment.Platform.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUserEmailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, userEmail_); + } + if (deployTime_ != null) { + output.writeMessage(2, getDeployTime()); + } + if (undeployTime_ != null) { + output.writeMessage(3, getUndeployTime()); + } + if (!getConfigBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, config_); + } + if (!getAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, address_); + } + for (int i = 0; i < resourceUri_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, resourceUri_.getRaw(i)); + } + if (platform_ != io.grafeas.v1beta1.deployment.Deployment.Platform.PLATFORM_UNSPECIFIED.getNumber()) { + output.writeEnum(7, platform_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUserEmailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, userEmail_); + } + if (deployTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getDeployTime()); + } + if (undeployTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUndeployTime()); + } + if (!getConfigBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, config_); + } + if (!getAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, address_); + } + { + int dataSize = 0; + for (int i = 0; i < resourceUri_.size(); i++) { + dataSize += computeStringSizeNoTag(resourceUri_.getRaw(i)); + } + size += dataSize; + size += 1 * getResourceUriList().size(); + } + if (platform_ != io.grafeas.v1beta1.deployment.Deployment.Platform.PLATFORM_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(7, platform_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.deployment.Deployment)) { + return super.equals(obj); + } + io.grafeas.v1beta1.deployment.Deployment other = (io.grafeas.v1beta1.deployment.Deployment) obj; + + boolean result = true; + result = result && getUserEmail() + .equals(other.getUserEmail()); + result = result && (hasDeployTime() == other.hasDeployTime()); + if (hasDeployTime()) { + result = result && getDeployTime() + .equals(other.getDeployTime()); + } + result = result && (hasUndeployTime() == other.hasUndeployTime()); + if (hasUndeployTime()) { + result = result && getUndeployTime() + .equals(other.getUndeployTime()); + } + result = result && getConfig() + .equals(other.getConfig()); + result = result && getAddress() + .equals(other.getAddress()); + result = result && getResourceUriList() + .equals(other.getResourceUriList()); + result = result && platform_ == other.platform_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USER_EMAIL_FIELD_NUMBER; + hash = (53 * hash) + getUserEmail().hashCode(); + if (hasDeployTime()) { + hash = (37 * hash) + DEPLOY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getDeployTime().hashCode(); + } + if (hasUndeployTime()) { + hash = (37 * hash) + UNDEPLOY_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUndeployTime().hashCode(); + } + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + hash = (37 * hash) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + if (getResourceUriCount() > 0) { + hash = (37 * hash) + RESOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getResourceUriList().hashCode(); + } + hash = (37 * hash) + PLATFORM_FIELD_NUMBER; + hash = (53 * hash) + platform_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployment parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Deployment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.deployment.Deployment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The period during which some deployable was active in a runtime.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Deployment} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.deployment.Deployment) + io.grafeas.v1beta1.deployment.DeploymentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Deployment.class, io.grafeas.v1beta1.deployment.Deployment.Builder.class); + } + + // Construct using io.grafeas.v1beta1.deployment.Deployment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + userEmail_ = ""; + + if (deployTimeBuilder_ == null) { + deployTime_ = null; + } else { + deployTime_ = null; + deployTimeBuilder_ = null; + } + if (undeployTimeBuilder_ == null) { + undeployTime_ = null; + } else { + undeployTime_ = null; + undeployTimeBuilder_ = null; + } + config_ = ""; + + address_ = ""; + + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + platform_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Deployment_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployment getDefaultInstanceForType() { + return io.grafeas.v1beta1.deployment.Deployment.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployment build() { + io.grafeas.v1beta1.deployment.Deployment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_; + } else { + result.deployTime_ = deployTimeBuilder_.build(); + } + if (undeployTimeBuilder_ == null) { + result.undeployTime_ = undeployTime_; + } else { + result.undeployTime_ = undeployTimeBuilder_.build(); + } + result.config_ = config_; + result.address_ = address_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + resourceUri_ = resourceUri_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.resourceUri_ = resourceUri_; + result.platform_ = platform_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.deployment.Deployment) { + return mergeFrom((io.grafeas.v1beta1.deployment.Deployment)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.deployment.Deployment other) { + if (other == io.grafeas.v1beta1.deployment.Deployment.getDefaultInstance()) return this; + if (!other.getUserEmail().isEmpty()) { + userEmail_ = other.userEmail_; + onChanged(); + } + if (other.hasDeployTime()) { + mergeDeployTime(other.getDeployTime()); + } + if (other.hasUndeployTime()) { + mergeUndeployTime(other.getUndeployTime()); + } + if (!other.getConfig().isEmpty()) { + config_ = other.config_; + onChanged(); + } + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + onChanged(); + } + if (!other.resourceUri_.isEmpty()) { + if (resourceUri_.isEmpty()) { + resourceUri_ = other.resourceUri_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureResourceUriIsMutable(); + resourceUri_.addAll(other.resourceUri_); + } + onChanged(); + } + if (other.platform_ != 0) { + setPlatformValue(other.getPlatformValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.deployment.Deployment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.deployment.Deployment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object userEmail_ = ""; + /** + *
+     * Identity of the user that triggered this deployment.
+     * 
+ * + * string user_email = 1; + */ + public java.lang.String getUserEmail() { + java.lang.Object ref = userEmail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userEmail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Identity of the user that triggered this deployment.
+     * 
+ * + * string user_email = 1; + */ + public com.google.protobuf.ByteString + getUserEmailBytes() { + java.lang.Object ref = userEmail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userEmail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Identity of the user that triggered this deployment.
+     * 
+ * + * string user_email = 1; + */ + public Builder setUserEmail( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userEmail_ = value; + onChanged(); + return this; + } + /** + *
+     * Identity of the user that triggered this deployment.
+     * 
+ * + * string user_email = 1; + */ + public Builder clearUserEmail() { + + userEmail_ = getDefaultInstance().getUserEmail(); + onChanged(); + return this; + } + /** + *
+     * Identity of the user that triggered this deployment.
+     * 
+ * + * string user_email = 1; + */ + public Builder setUserEmailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userEmail_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp deployTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> deployTimeBuilder_; + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public boolean hasDeployTime() { + return deployTimeBuilder_ != null || deployTime_ != null; + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public com.google.protobuf.Timestamp getDeployTime() { + if (deployTimeBuilder_ == null) { + return deployTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : deployTime_; + } else { + return deployTimeBuilder_.getMessage(); + } + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public Builder setDeployTime(com.google.protobuf.Timestamp value) { + if (deployTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployTime_ = value; + onChanged(); + } else { + deployTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public Builder setDeployTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (deployTimeBuilder_ == null) { + deployTime_ = builderForValue.build(); + onChanged(); + } else { + deployTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public Builder mergeDeployTime(com.google.protobuf.Timestamp value) { + if (deployTimeBuilder_ == null) { + if (deployTime_ != null) { + deployTime_ = + com.google.protobuf.Timestamp.newBuilder(deployTime_).mergeFrom(value).buildPartial(); + } else { + deployTime_ = value; + } + onChanged(); + } else { + deployTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public Builder clearDeployTime() { + if (deployTimeBuilder_ == null) { + deployTime_ = null; + onChanged(); + } else { + deployTime_ = null; + deployTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getDeployTimeBuilder() { + + onChanged(); + return getDeployTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder() { + if (deployTimeBuilder_ != null) { + return deployTimeBuilder_.getMessageOrBuilder(); + } else { + return deployTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : deployTime_; + } + } + /** + *
+     * Beginning of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getDeployTimeFieldBuilder() { + if (deployTimeBuilder_ == null) { + deployTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getDeployTime(), + getParentForChildren(), + isClean()); + deployTime_ = null; + } + return deployTimeBuilder_; + } + + private com.google.protobuf.Timestamp undeployTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> undeployTimeBuilder_; + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public boolean hasUndeployTime() { + return undeployTimeBuilder_ != null || undeployTime_ != null; + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public com.google.protobuf.Timestamp getUndeployTime() { + if (undeployTimeBuilder_ == null) { + return undeployTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : undeployTime_; + } else { + return undeployTimeBuilder_.getMessage(); + } + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public Builder setUndeployTime(com.google.protobuf.Timestamp value) { + if (undeployTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + undeployTime_ = value; + onChanged(); + } else { + undeployTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public Builder setUndeployTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (undeployTimeBuilder_ == null) { + undeployTime_ = builderForValue.build(); + onChanged(); + } else { + undeployTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public Builder mergeUndeployTime(com.google.protobuf.Timestamp value) { + if (undeployTimeBuilder_ == null) { + if (undeployTime_ != null) { + undeployTime_ = + com.google.protobuf.Timestamp.newBuilder(undeployTime_).mergeFrom(value).buildPartial(); + } else { + undeployTime_ = value; + } + onChanged(); + } else { + undeployTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public Builder clearUndeployTime() { + if (undeployTimeBuilder_ == null) { + undeployTime_ = null; + onChanged(); + } else { + undeployTime_ = null; + undeployTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getUndeployTimeBuilder() { + + onChanged(); + return getUndeployTimeFieldBuilder().getBuilder(); + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getUndeployTimeOrBuilder() { + if (undeployTimeBuilder_ != null) { + return undeployTimeBuilder_.getMessageOrBuilder(); + } else { + return undeployTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : undeployTime_; + } + } + /** + *
+     * End of the lifetime of this deployment.
+     * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getUndeployTimeFieldBuilder() { + if (undeployTimeBuilder_ == null) { + undeployTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getUndeployTime(), + getParentForChildren(), + isClean()); + undeployTime_ = null; + } + return undeployTimeBuilder_; + } + + private java.lang.Object config_ = ""; + /** + *
+     * Configuration used to create this deployment.
+     * 
+ * + * string config = 4; + */ + public java.lang.String getConfig() { + java.lang.Object ref = config_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + config_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Configuration used to create this deployment.
+     * 
+ * + * string config = 4; + */ + public com.google.protobuf.ByteString + getConfigBytes() { + java.lang.Object ref = config_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + config_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Configuration used to create this deployment.
+     * 
+ * + * string config = 4; + */ + public Builder setConfig( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + config_ = value; + onChanged(); + return this; + } + /** + *
+     * Configuration used to create this deployment.
+     * 
+ * + * string config = 4; + */ + public Builder clearConfig() { + + config_ = getDefaultInstance().getConfig(); + onChanged(); + return this; + } + /** + *
+     * Configuration used to create this deployment.
+     * 
+ * + * string config = 4; + */ + public Builder setConfigBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + config_ = value; + onChanged(); + return this; + } + + private java.lang.Object address_ = ""; + /** + *
+     * Address of the runtime element hosting this deployment.
+     * 
+ * + * string address = 5; + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Address of the runtime element hosting this deployment.
+     * 
+ * + * string address = 5; + */ + public com.google.protobuf.ByteString + getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Address of the runtime element hosting this deployment.
+     * 
+ * + * string address = 5; + */ + public Builder setAddress( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + address_ = value; + onChanged(); + return this; + } + /** + *
+     * Address of the runtime element hosting this deployment.
+     * 
+ * + * string address = 5; + */ + public Builder clearAddress() { + + address_ = getDefaultInstance().getAddress(); + onChanged(); + return this; + } + /** + *
+     * Address of the runtime element hosting this deployment.
+     * 
+ * + * string address = 5; + */ + public Builder setAddressBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + address_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureResourceUriIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + resourceUri_ = new com.google.protobuf.LazyStringArrayList(resourceUri_); + bitField0_ |= 0x00000020; + } + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public com.google.protobuf.ProtocolStringList + getResourceUriList() { + return resourceUri_.getUnmodifiableView(); + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public int getResourceUriCount() { + return resourceUri_.size(); + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public java.lang.String getResourceUri(int index) { + return resourceUri_.get(index); + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public com.google.protobuf.ByteString + getResourceUriBytes(int index) { + return resourceUri_.getByteString(index); + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public Builder setResourceUri( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceUriIsMutable(); + resourceUri_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public Builder addResourceUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureResourceUriIsMutable(); + resourceUri_.add(value); + onChanged(); + return this; + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public Builder addAllResourceUri( + java.lang.Iterable values) { + ensureResourceUriIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, resourceUri_); + onChanged(); + return this; + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public Builder clearResourceUri() { + resourceUri_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
+     * Output only. Resource URI for the artifact being deployed taken from
+     * the deployable field with the same name.
+     * 
+ * + * repeated string resource_uri = 6; + */ + public Builder addResourceUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureResourceUriIsMutable(); + resourceUri_.add(value); + onChanged(); + return this; + } + + private int platform_ = 0; + /** + *
+     * Platform hosting this deployment.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public int getPlatformValue() { + return platform_; + } + /** + *
+     * Platform hosting this deployment.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public Builder setPlatformValue(int value) { + platform_ = value; + onChanged(); + return this; + } + /** + *
+     * Platform hosting this deployment.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public io.grafeas.v1beta1.deployment.Deployment.Platform getPlatform() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.deployment.Deployment.Platform result = io.grafeas.v1beta1.deployment.Deployment.Platform.valueOf(platform_); + return result == null ? io.grafeas.v1beta1.deployment.Deployment.Platform.UNRECOGNIZED : result; + } + /** + *
+     * Platform hosting this deployment.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public Builder setPlatform(io.grafeas.v1beta1.deployment.Deployment.Platform value) { + if (value == null) { + throw new NullPointerException(); + } + + platform_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Platform hosting this deployment.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + public Builder clearPlatform() { + + platform_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.deployment.Deployment) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.deployment.Deployment) + private static final io.grafeas.v1beta1.deployment.Deployment DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.deployment.Deployment(); + } + + public static io.grafeas.v1beta1.deployment.Deployment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Deployment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Deployment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Deployment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOrBuilder.java new file mode 100644 index 000000000000..5cfdcf165c34 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOrBuilder.java @@ -0,0 +1,169 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +public interface DeploymentOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.deployment.Deployment) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Identity of the user that triggered this deployment.
+   * 
+ * + * string user_email = 1; + */ + java.lang.String getUserEmail(); + /** + *
+   * Identity of the user that triggered this deployment.
+   * 
+ * + * string user_email = 1; + */ + com.google.protobuf.ByteString + getUserEmailBytes(); + + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + boolean hasDeployTime(); + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + com.google.protobuf.Timestamp getDeployTime(); + /** + *
+   * Beginning of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp deploy_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getDeployTimeOrBuilder(); + + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + boolean hasUndeployTime(); + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + com.google.protobuf.Timestamp getUndeployTime(); + /** + *
+   * End of the lifetime of this deployment.
+   * 
+ * + * .google.protobuf.Timestamp undeploy_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getUndeployTimeOrBuilder(); + + /** + *
+   * Configuration used to create this deployment.
+   * 
+ * + * string config = 4; + */ + java.lang.String getConfig(); + /** + *
+   * Configuration used to create this deployment.
+   * 
+ * + * string config = 4; + */ + com.google.protobuf.ByteString + getConfigBytes(); + + /** + *
+   * Address of the runtime element hosting this deployment.
+   * 
+ * + * string address = 5; + */ + java.lang.String getAddress(); + /** + *
+   * Address of the runtime element hosting this deployment.
+   * 
+ * + * string address = 5; + */ + com.google.protobuf.ByteString + getAddressBytes(); + + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + java.util.List + getResourceUriList(); + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + int getResourceUriCount(); + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + java.lang.String getResourceUri(int index); + /** + *
+   * Output only. Resource URI for the artifact being deployed taken from
+   * the deployable field with the same name.
+   * 
+ * + * repeated string resource_uri = 6; + */ + com.google.protobuf.ByteString + getResourceUriBytes(int index); + + /** + *
+   * Platform hosting this deployment.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + int getPlatformValue(); + /** + *
+   * Platform hosting this deployment.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment.Platform platform = 7; + */ + io.grafeas.v1beta1.deployment.Deployment.Platform getPlatform(); +} 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 new file mode 100644 index 000000000000..f764e2732bda --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DeploymentOuterClass.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +public final class DeploymentOuterClass { + private DeploymentOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_deployment_Deployable_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_deployment_Deployable_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_deployment_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_deployment_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_deployment_Deployment_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_deployment_Deployment_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nEgoogle/devtools/containeranalysis/v1be" + + "ta1/deployment/deployment.proto\022\032grafeas" + + ".v1beta1.deployment\032\037google/protobuf/tim" + + "estamp.proto\"\"\n\nDeployable\022\024\n\014resource_u" + + "ri\030\001 \003(\t\"E\n\007Details\022:\n\ndeployment\030\001 \001(\0132" + + "&.grafeas.v1beta1.deployment.Deployment\"" + + "\303\002\n\nDeployment\022\022\n\nuser_email\030\001 \001(\t\022/\n\013de" + + "ploy_time\030\002 \001(\0132\032.google.protobuf.Timest" + + "amp\0221\n\rundeploy_time\030\003 \001(\0132\032.google.prot" + + "obuf.Timestamp\022\016\n\006config\030\004 \001(\t\022\017\n\007addres" + + "s\030\005 \001(\t\022\024\n\014resource_uri\030\006 \003(\t\022A\n\010platfor" + + "m\030\007 \001(\0162/.grafeas.v1beta1.deployment.Dep" + + "loyment.Platform\"C\n\010Platform\022\030\n\024PLATFORM" + + "_UNSPECIFIED\020\000\022\007\n\003GKE\020\001\022\010\n\004FLEX\020\002\022\n\n\006CUS" + + "TOM\020\003B\207\001\n\035io.grafeas.v1beta1.deploymentP" + + "\001Z^google.golang.org/genproto/googleapis" + + "/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); + internal_static_grafeas_v1beta1_deployment_Deployable_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_deployment_Deployable_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_deployment_Deployable_descriptor, + new java.lang.String[] { "ResourceUri", }); + internal_static_grafeas_v1beta1_deployment_Details_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_deployment_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_deployment_Details_descriptor, + new java.lang.String[] { "Deployment", }); + internal_static_grafeas_v1beta1_deployment_Deployment_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_deployment_Deployment_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_deployment_Deployment_descriptor, + new java.lang.String[] { "UserEmail", "DeployTime", "UndeployTime", "Config", "Address", "ResourceUri", "Platform", }); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..b3aa81941d9d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/Details.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +/** + *
+ * Details of a deployment occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.deployment.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.deployment.Deployment.Builder subBuilder = null; + if (deployment_ != null) { + subBuilder = deployment_.toBuilder(); + } + deployment_ = input.readMessage(io.grafeas.v1beta1.deployment.Deployment.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(deployment_); + deployment_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Details.class, io.grafeas.v1beta1.deployment.Details.Builder.class); + } + + public static final int DEPLOYMENT_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.deployment.Deployment deployment_; + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public boolean hasDeployment() { + return deployment_ != null; + } + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public io.grafeas.v1beta1.deployment.Deployment getDeployment() { + return deployment_ == null ? io.grafeas.v1beta1.deployment.Deployment.getDefaultInstance() : deployment_; + } + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public io.grafeas.v1beta1.deployment.DeploymentOrBuilder getDeploymentOrBuilder() { + return getDeployment(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (deployment_ != null) { + output.writeMessage(1, getDeployment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (deployment_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDeployment()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.deployment.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.deployment.Details other = (io.grafeas.v1beta1.deployment.Details) obj; + + boolean result = true; + result = result && (hasDeployment() == other.hasDeployment()); + if (hasDeployment()) { + result = result && getDeployment() + .equals(other.getDeployment()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDeployment()) { + hash = (37 * hash) + DEPLOYMENT_FIELD_NUMBER; + hash = (53 * hash) + getDeployment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.deployment.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.deployment.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.deployment.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of a deployment occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.deployment.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.deployment.Details) + io.grafeas.v1beta1.deployment.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.deployment.Details.class, io.grafeas.v1beta1.deployment.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.deployment.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (deploymentBuilder_ == null) { + deployment_ = null; + } else { + deployment_ = null; + deploymentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.deployment.DeploymentOuterClass.internal_static_grafeas_v1beta1_deployment_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.deployment.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Details build() { + io.grafeas.v1beta1.deployment.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Details buildPartial() { + io.grafeas.v1beta1.deployment.Details result = new io.grafeas.v1beta1.deployment.Details(this); + if (deploymentBuilder_ == null) { + result.deployment_ = deployment_; + } else { + result.deployment_ = deploymentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.deployment.Details) { + return mergeFrom((io.grafeas.v1beta1.deployment.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.deployment.Details other) { + if (other == io.grafeas.v1beta1.deployment.Details.getDefaultInstance()) return this; + if (other.hasDeployment()) { + mergeDeployment(other.getDeployment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.deployment.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.deployment.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.deployment.Deployment deployment_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployment, io.grafeas.v1beta1.deployment.Deployment.Builder, io.grafeas.v1beta1.deployment.DeploymentOrBuilder> deploymentBuilder_; + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public boolean hasDeployment() { + return deploymentBuilder_ != null || deployment_ != null; + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public io.grafeas.v1beta1.deployment.Deployment getDeployment() { + if (deploymentBuilder_ == null) { + return deployment_ == null ? io.grafeas.v1beta1.deployment.Deployment.getDefaultInstance() : deployment_; + } else { + return deploymentBuilder_.getMessage(); + } + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public Builder setDeployment(io.grafeas.v1beta1.deployment.Deployment value) { + if (deploymentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + deployment_ = value; + onChanged(); + } else { + deploymentBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public Builder setDeployment( + io.grafeas.v1beta1.deployment.Deployment.Builder builderForValue) { + if (deploymentBuilder_ == null) { + deployment_ = builderForValue.build(); + onChanged(); + } else { + deploymentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public Builder mergeDeployment(io.grafeas.v1beta1.deployment.Deployment value) { + if (deploymentBuilder_ == null) { + if (deployment_ != null) { + deployment_ = + io.grafeas.v1beta1.deployment.Deployment.newBuilder(deployment_).mergeFrom(value).buildPartial(); + } else { + deployment_ = value; + } + onChanged(); + } else { + deploymentBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public Builder clearDeployment() { + if (deploymentBuilder_ == null) { + deployment_ = null; + onChanged(); + } else { + deployment_ = null; + deploymentBuilder_ = null; + } + + return this; + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public io.grafeas.v1beta1.deployment.Deployment.Builder getDeploymentBuilder() { + + onChanged(); + return getDeploymentFieldBuilder().getBuilder(); + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + public io.grafeas.v1beta1.deployment.DeploymentOrBuilder getDeploymentOrBuilder() { + if (deploymentBuilder_ != null) { + return deploymentBuilder_.getMessageOrBuilder(); + } else { + return deployment_ == null ? + io.grafeas.v1beta1.deployment.Deployment.getDefaultInstance() : deployment_; + } + } + /** + *
+     * Deployment history for the resource.
+     * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployment, io.grafeas.v1beta1.deployment.Deployment.Builder, io.grafeas.v1beta1.deployment.DeploymentOrBuilder> + getDeploymentFieldBuilder() { + if (deploymentBuilder_ == null) { + deploymentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.deployment.Deployment, io.grafeas.v1beta1.deployment.Deployment.Builder, io.grafeas.v1beta1.deployment.DeploymentOrBuilder>( + getDeployment(), + getParentForChildren(), + isClean()); + deployment_ = null; + } + return deploymentBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.deployment.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.deployment.Details) + private static final io.grafeas.v1beta1.deployment.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.deployment.Details(); + } + + public static io.grafeas.v1beta1.deployment.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.deployment.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DetailsOrBuilder.java new file mode 100644 index 000000000000..5d509fa5b188 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/DetailsOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/deployment/deployment.proto + +package io.grafeas.v1beta1.deployment; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.deployment.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + boolean hasDeployment(); + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + io.grafeas.v1beta1.deployment.Deployment getDeployment(); + /** + *
+   * Deployment history for the resource.
+   * 
+ * + * .grafeas.v1beta1.deployment.Deployment deployment = 1; + */ + io.grafeas.v1beta1.deployment.DeploymentOrBuilder getDeploymentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/NoteName.java new file mode 100644 index 000000000000..54f37ff75125 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.deployment; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/OccurrenceName.java new file mode 100644 index 000000000000..eb52dc3acf71 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.deployment; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ProjectName.java new file mode 100644 index 000000000000..7cb49a48ebd1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.deployment; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ScanConfigName.java new file mode 100644 index 000000000000..0c9ec152c080 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/deployment/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.deployment; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..5ba18f01ac50 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Details.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +/** + *
+ * Details of a discovery occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.discovery.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.discovery.Discovered.Builder subBuilder = null; + if (discovered_ != null) { + subBuilder = discovered_.toBuilder(); + } + discovered_ = input.readMessage(io.grafeas.v1beta1.discovery.Discovered.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(discovered_); + discovered_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Details.class, io.grafeas.v1beta1.discovery.Details.Builder.class); + } + + public static final int DISCOVERED_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.discovery.Discovered discovered_; + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public boolean hasDiscovered() { + return discovered_ != null; + } + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public io.grafeas.v1beta1.discovery.Discovered getDiscovered() { + return discovered_ == null ? io.grafeas.v1beta1.discovery.Discovered.getDefaultInstance() : discovered_; + } + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public io.grafeas.v1beta1.discovery.DiscoveredOrBuilder getDiscoveredOrBuilder() { + return getDiscovered(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (discovered_ != null) { + output.writeMessage(1, getDiscovered()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (discovered_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDiscovered()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.discovery.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.discovery.Details other = (io.grafeas.v1beta1.discovery.Details) obj; + + boolean result = true; + result = result && (hasDiscovered() == other.hasDiscovered()); + if (hasDiscovered()) { + result = result && getDiscovered() + .equals(other.getDiscovered()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDiscovered()) { + hash = (37 * hash) + DISCOVERED_FIELD_NUMBER; + hash = (53 * hash) + getDiscovered().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.discovery.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.discovery.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of a discovery occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.discovery.Details) + io.grafeas.v1beta1.discovery.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Details.class, io.grafeas.v1beta1.discovery.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.discovery.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (discoveredBuilder_ == null) { + discovered_ = null; + } else { + discovered_ = null; + discoveredBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.discovery.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Details build() { + io.grafeas.v1beta1.discovery.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Details buildPartial() { + io.grafeas.v1beta1.discovery.Details result = new io.grafeas.v1beta1.discovery.Details(this); + if (discoveredBuilder_ == null) { + result.discovered_ = discovered_; + } else { + result.discovered_ = discoveredBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.discovery.Details) { + return mergeFrom((io.grafeas.v1beta1.discovery.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.discovery.Details other) { + if (other == io.grafeas.v1beta1.discovery.Details.getDefaultInstance()) return this; + if (other.hasDiscovered()) { + mergeDiscovered(other.getDiscovered()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.discovery.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.discovery.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.discovery.Discovered discovered_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovered, io.grafeas.v1beta1.discovery.Discovered.Builder, io.grafeas.v1beta1.discovery.DiscoveredOrBuilder> discoveredBuilder_; + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public boolean hasDiscovered() { + return discoveredBuilder_ != null || discovered_ != null; + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public io.grafeas.v1beta1.discovery.Discovered getDiscovered() { + if (discoveredBuilder_ == null) { + return discovered_ == null ? io.grafeas.v1beta1.discovery.Discovered.getDefaultInstance() : discovered_; + } else { + return discoveredBuilder_.getMessage(); + } + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public Builder setDiscovered(io.grafeas.v1beta1.discovery.Discovered value) { + if (discoveredBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + discovered_ = value; + onChanged(); + } else { + discoveredBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public Builder setDiscovered( + io.grafeas.v1beta1.discovery.Discovered.Builder builderForValue) { + if (discoveredBuilder_ == null) { + discovered_ = builderForValue.build(); + onChanged(); + } else { + discoveredBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public Builder mergeDiscovered(io.grafeas.v1beta1.discovery.Discovered value) { + if (discoveredBuilder_ == null) { + if (discovered_ != null) { + discovered_ = + io.grafeas.v1beta1.discovery.Discovered.newBuilder(discovered_).mergeFrom(value).buildPartial(); + } else { + discovered_ = value; + } + onChanged(); + } else { + discoveredBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public Builder clearDiscovered() { + if (discoveredBuilder_ == null) { + discovered_ = null; + onChanged(); + } else { + discovered_ = null; + discoveredBuilder_ = null; + } + + return this; + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public io.grafeas.v1beta1.discovery.Discovered.Builder getDiscoveredBuilder() { + + onChanged(); + return getDiscoveredFieldBuilder().getBuilder(); + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + public io.grafeas.v1beta1.discovery.DiscoveredOrBuilder getDiscoveredOrBuilder() { + if (discoveredBuilder_ != null) { + return discoveredBuilder_.getMessageOrBuilder(); + } else { + return discovered_ == null ? + io.grafeas.v1beta1.discovery.Discovered.getDefaultInstance() : discovered_; + } + } + /** + *
+     * Analysis status for the discovered resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovered, io.grafeas.v1beta1.discovery.Discovered.Builder, io.grafeas.v1beta1.discovery.DiscoveredOrBuilder> + getDiscoveredFieldBuilder() { + if (discoveredBuilder_ == null) { + discoveredBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.discovery.Discovered, io.grafeas.v1beta1.discovery.Discovered.Builder, io.grafeas.v1beta1.discovery.DiscoveredOrBuilder>( + getDiscovered(), + getParentForChildren(), + isClean()); + discovered_ = null; + } + return discoveredBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.discovery.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.discovery.Details) + private static final io.grafeas.v1beta1.discovery.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.discovery.Details(); + } + + public static io.grafeas.v1beta1.discovery.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DetailsOrBuilder.java new file mode 100644 index 000000000000..964527e051b7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DetailsOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.discovery.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + boolean hasDiscovered(); + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + io.grafeas.v1beta1.discovery.Discovered getDiscovered(); + /** + *
+   * Analysis status for the discovered resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered discovered = 1; + */ + io.grafeas.v1beta1.discovery.DiscoveredOrBuilder getDiscoveredOrBuilder(); +} 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 new file mode 100644 index 000000000000..f0f208598831 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovered.java @@ -0,0 +1,1454 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +/** + *
+ * Provides information about the analysis status of a discovered resource.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Discovered} + */ +public final class Discovered extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.discovery.Discovered) + DiscoveredOrBuilder { +private static final long serialVersionUID = 0L; + // Use Discovered.newBuilder() to construct. + private Discovered(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Discovered() { + continuousAnalysis_ = 0; + analysisStatus_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Discovered( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + continuousAnalysis_ = rawValue; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastAnalysisTime_ != null) { + subBuilder = lastAnalysisTime_.toBuilder(); + } + lastAnalysisTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastAnalysisTime_); + lastAnalysisTime_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + int rawValue = input.readEnum(); + + analysisStatus_ = rawValue; + break; + } + case 34: { + com.google.rpc.Status.Builder subBuilder = null; + if (analysisStatusError_ != null) { + subBuilder = analysisStatusError_.toBuilder(); + } + analysisStatusError_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(analysisStatusError_); + analysisStatusError_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovered_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovered_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Discovered.class, io.grafeas.v1beta1.discovery.Discovered.Builder.class); + } + + /** + *
+   * Whether the resource is continuously analyzed.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis} + */ + public enum ContinuousAnalysis + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * CONTINUOUS_ANALYSIS_UNSPECIFIED = 0; + */ + CONTINUOUS_ANALYSIS_UNSPECIFIED(0), + /** + *
+     * The resource is continuously analyzed.
+     * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + *
+     * The resource is ignored for continuous analysis.
+     * 
+ * + * INACTIVE = 2; + */ + INACTIVE(2), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * CONTINUOUS_ANALYSIS_UNSPECIFIED = 0; + */ + public static final int CONTINUOUS_ANALYSIS_UNSPECIFIED_VALUE = 0; + /** + *
+     * The resource is continuously analyzed.
+     * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + *
+     * The resource is ignored for continuous analysis.
+     * 
+ * + * INACTIVE = 2; + */ + public static final int INACTIVE_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContinuousAnalysis valueOf(int value) { + return forNumber(value); + } + + public static ContinuousAnalysis forNumber(int value) { + switch (value) { + case 0: return CONTINUOUS_ANALYSIS_UNSPECIFIED; + case 1: return ACTIVE; + case 2: return INACTIVE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ContinuousAnalysis> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ContinuousAnalysis findValueByNumber(int number) { + return ContinuousAnalysis.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.Discovered.getDescriptor().getEnumTypes().get(0); + } + + private static final ContinuousAnalysis[] VALUES = values(); + + public static ContinuousAnalysis valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ContinuousAnalysis(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis) + } + + /** + *
+   * Analysis status for a resource. Currently for initial analysis only (not
+   * updated in continuous analysis).
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.discovery.Discovered.AnalysisStatus} + */ + public enum AnalysisStatus + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * ANALYSIS_STATUS_UNSPECIFIED = 0; + */ + ANALYSIS_STATUS_UNSPECIFIED(0), + /** + *
+     * Resource is known but no action has been taken yet.
+     * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + *
+     * Resource is being analyzed.
+     * 
+ * + * SCANNING = 2; + */ + SCANNING(2), + /** + *
+     * Analysis has finished successfully.
+     * 
+ * + * FINISHED_SUCCESS = 3; + */ + FINISHED_SUCCESS(3), + /** + *
+     * Analysis has finished unsuccessfully, the analysis itself is in a bad
+     * state.
+     * 
+ * + * FINISHED_FAILED = 4; + */ + FINISHED_FAILED(4), + /** + *
+     * The resource is known not to be supported
+     * 
+ * + * FINISHED_UNSUPPORTED = 5; + */ + FINISHED_UNSUPPORTED(5), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * ANALYSIS_STATUS_UNSPECIFIED = 0; + */ + public static final int ANALYSIS_STATUS_UNSPECIFIED_VALUE = 0; + /** + *
+     * Resource is known but no action has been taken yet.
+     * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + *
+     * Resource is being analyzed.
+     * 
+ * + * SCANNING = 2; + */ + public static final int SCANNING_VALUE = 2; + /** + *
+     * Analysis has finished successfully.
+     * 
+ * + * FINISHED_SUCCESS = 3; + */ + public static final int FINISHED_SUCCESS_VALUE = 3; + /** + *
+     * Analysis has finished unsuccessfully, the analysis itself is in a bad
+     * state.
+     * 
+ * + * FINISHED_FAILED = 4; + */ + public static final int FINISHED_FAILED_VALUE = 4; + /** + *
+     * The resource is known not to be supported
+     * 
+ * + * FINISHED_UNSUPPORTED = 5; + */ + public static final int FINISHED_UNSUPPORTED_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AnalysisStatus valueOf(int value) { + return forNumber(value); + } + + public static AnalysisStatus forNumber(int value) { + switch (value) { + case 0: return ANALYSIS_STATUS_UNSPECIFIED; + case 1: return PENDING; + case 2: return SCANNING; + case 3: return FINISHED_SUCCESS; + case 4: return FINISHED_FAILED; + case 5: return FINISHED_UNSUPPORTED; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AnalysisStatus> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AnalysisStatus findValueByNumber(int number) { + return AnalysisStatus.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.Discovered.getDescriptor().getEnumTypes().get(1); + } + + private static final AnalysisStatus[] VALUES = values(); + + public static AnalysisStatus valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AnalysisStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.discovery.Discovered.AnalysisStatus) + } + + public static final int CONTINUOUS_ANALYSIS_FIELD_NUMBER = 1; + private int continuousAnalysis_; + /** + *
+   * Whether the resource is continuously analyzed.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public int getContinuousAnalysisValue() { + return continuousAnalysis_; + } + /** + *
+   * Whether the resource is continuously analyzed.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis getContinuousAnalysis() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis result = io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.valueOf(continuousAnalysis_); + return result == null ? io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.UNRECOGNIZED : result; + } + + public static final int LAST_ANALYSIS_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp lastAnalysisTime_; + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public boolean hasLastAnalysisTime() { + return lastAnalysisTime_ != null; + } + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public com.google.protobuf.Timestamp getLastAnalysisTime() { + return lastAnalysisTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastAnalysisTime_; + } + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getLastAnalysisTimeOrBuilder() { + return getLastAnalysisTime(); + } + + public static final int ANALYSIS_STATUS_FIELD_NUMBER = 3; + private int analysisStatus_; + /** + *
+   * The status of discovery for the resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public int getAnalysisStatusValue() { + return analysisStatus_; + } + /** + *
+   * The status of discovery for the resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus getAnalysisStatus() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus result = io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.valueOf(analysisStatus_); + return result == null ? io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.UNRECOGNIZED : result; + } + + public static final int ANALYSIS_STATUS_ERROR_FIELD_NUMBER = 4; + private com.google.rpc.Status analysisStatusError_; + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public boolean hasAnalysisStatusError() { + return analysisStatusError_ != null; + } + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public com.google.rpc.Status getAnalysisStatusError() { + return analysisStatusError_ == null ? com.google.rpc.Status.getDefaultInstance() : analysisStatusError_; + } + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public com.google.rpc.StatusOrBuilder getAnalysisStatusErrorOrBuilder() { + return getAnalysisStatusError(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (continuousAnalysis_ != io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.CONTINUOUS_ANALYSIS_UNSPECIFIED.getNumber()) { + output.writeEnum(1, continuousAnalysis_); + } + if (lastAnalysisTime_ != null) { + output.writeMessage(2, getLastAnalysisTime()); + } + if (analysisStatus_ != io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.ANALYSIS_STATUS_UNSPECIFIED.getNumber()) { + output.writeEnum(3, analysisStatus_); + } + if (analysisStatusError_ != null) { + output.writeMessage(4, getAnalysisStatusError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (continuousAnalysis_ != io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.CONTINUOUS_ANALYSIS_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, continuousAnalysis_); + } + if (lastAnalysisTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getLastAnalysisTime()); + } + if (analysisStatus_ != io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.ANALYSIS_STATUS_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, analysisStatus_); + } + if (analysisStatusError_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getAnalysisStatusError()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.discovery.Discovered)) { + return super.equals(obj); + } + io.grafeas.v1beta1.discovery.Discovered other = (io.grafeas.v1beta1.discovery.Discovered) obj; + + boolean result = true; + result = result && continuousAnalysis_ == other.continuousAnalysis_; + result = result && (hasLastAnalysisTime() == other.hasLastAnalysisTime()); + if (hasLastAnalysisTime()) { + result = result && getLastAnalysisTime() + .equals(other.getLastAnalysisTime()); + } + result = result && analysisStatus_ == other.analysisStatus_; + result = result && (hasAnalysisStatusError() == other.hasAnalysisStatusError()); + if (hasAnalysisStatusError()) { + result = result && getAnalysisStatusError() + .equals(other.getAnalysisStatusError()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTINUOUS_ANALYSIS_FIELD_NUMBER; + hash = (53 * hash) + continuousAnalysis_; + if (hasLastAnalysisTime()) { + hash = (37 * hash) + LAST_ANALYSIS_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastAnalysisTime().hashCode(); + } + hash = (37 * hash) + ANALYSIS_STATUS_FIELD_NUMBER; + hash = (53 * hash) + analysisStatus_; + if (hasAnalysisStatusError()) { + hash = (37 * hash) + ANALYSIS_STATUS_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getAnalysisStatusError().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovered parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovered parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovered parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.discovery.Discovered prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides information about the analysis status of a discovered resource.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Discovered} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.discovery.Discovered) + io.grafeas.v1beta1.discovery.DiscoveredOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovered_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovered_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Discovered.class, io.grafeas.v1beta1.discovery.Discovered.Builder.class); + } + + // Construct using io.grafeas.v1beta1.discovery.Discovered.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + continuousAnalysis_ = 0; + + if (lastAnalysisTimeBuilder_ == null) { + lastAnalysisTime_ = null; + } else { + lastAnalysisTime_ = null; + lastAnalysisTimeBuilder_ = null; + } + analysisStatus_ = 0; + + if (analysisStatusErrorBuilder_ == null) { + analysisStatusError_ = null; + } else { + analysisStatusError_ = null; + analysisStatusErrorBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovered_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovered getDefaultInstanceForType() { + return io.grafeas.v1beta1.discovery.Discovered.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovered build() { + io.grafeas.v1beta1.discovery.Discovered result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovered buildPartial() { + io.grafeas.v1beta1.discovery.Discovered result = new io.grafeas.v1beta1.discovery.Discovered(this); + result.continuousAnalysis_ = continuousAnalysis_; + if (lastAnalysisTimeBuilder_ == null) { + result.lastAnalysisTime_ = lastAnalysisTime_; + } else { + result.lastAnalysisTime_ = lastAnalysisTimeBuilder_.build(); + } + result.analysisStatus_ = analysisStatus_; + if (analysisStatusErrorBuilder_ == null) { + result.analysisStatusError_ = analysisStatusError_; + } else { + result.analysisStatusError_ = analysisStatusErrorBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.discovery.Discovered) { + return mergeFrom((io.grafeas.v1beta1.discovery.Discovered)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.discovery.Discovered other) { + if (other == io.grafeas.v1beta1.discovery.Discovered.getDefaultInstance()) return this; + if (other.continuousAnalysis_ != 0) { + setContinuousAnalysisValue(other.getContinuousAnalysisValue()); + } + if (other.hasLastAnalysisTime()) { + mergeLastAnalysisTime(other.getLastAnalysisTime()); + } + if (other.analysisStatus_ != 0) { + setAnalysisStatusValue(other.getAnalysisStatusValue()); + } + if (other.hasAnalysisStatusError()) { + mergeAnalysisStatusError(other.getAnalysisStatusError()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.discovery.Discovered parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.discovery.Discovered) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int continuousAnalysis_ = 0; + /** + *
+     * Whether the resource is continuously analyzed.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public int getContinuousAnalysisValue() { + return continuousAnalysis_; + } + /** + *
+     * Whether the resource is continuously analyzed.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public Builder setContinuousAnalysisValue(int value) { + continuousAnalysis_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether the resource is continuously analyzed.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis getContinuousAnalysis() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis result = io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.valueOf(continuousAnalysis_); + return result == null ? io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis.UNRECOGNIZED : result; + } + /** + *
+     * Whether the resource is continuously analyzed.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public Builder setContinuousAnalysis(io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis value) { + if (value == null) { + throw new NullPointerException(); + } + + continuousAnalysis_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Whether the resource is continuously analyzed.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + public Builder clearContinuousAnalysis() { + + continuousAnalysis_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp lastAnalysisTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> lastAnalysisTimeBuilder_; + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public boolean hasLastAnalysisTime() { + return lastAnalysisTimeBuilder_ != null || lastAnalysisTime_ != null; + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public com.google.protobuf.Timestamp getLastAnalysisTime() { + if (lastAnalysisTimeBuilder_ == null) { + return lastAnalysisTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : lastAnalysisTime_; + } else { + return lastAnalysisTimeBuilder_.getMessage(); + } + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public Builder setLastAnalysisTime(com.google.protobuf.Timestamp value) { + if (lastAnalysisTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastAnalysisTime_ = value; + onChanged(); + } else { + lastAnalysisTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public Builder setLastAnalysisTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastAnalysisTimeBuilder_ == null) { + lastAnalysisTime_ = builderForValue.build(); + onChanged(); + } else { + lastAnalysisTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public Builder mergeLastAnalysisTime(com.google.protobuf.Timestamp value) { + if (lastAnalysisTimeBuilder_ == null) { + if (lastAnalysisTime_ != null) { + lastAnalysisTime_ = + com.google.protobuf.Timestamp.newBuilder(lastAnalysisTime_).mergeFrom(value).buildPartial(); + } else { + lastAnalysisTime_ = value; + } + onChanged(); + } else { + lastAnalysisTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public Builder clearLastAnalysisTime() { + if (lastAnalysisTimeBuilder_ == null) { + lastAnalysisTime_ = null; + onChanged(); + } else { + lastAnalysisTime_ = null; + lastAnalysisTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getLastAnalysisTimeBuilder() { + + onChanged(); + return getLastAnalysisTimeFieldBuilder().getBuilder(); + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getLastAnalysisTimeOrBuilder() { + if (lastAnalysisTimeBuilder_ != null) { + return lastAnalysisTimeBuilder_.getMessageOrBuilder(); + } else { + return lastAnalysisTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : lastAnalysisTime_; + } + } + /** + *
+     * The last time continuous analysis was done for this resource.
+     * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getLastAnalysisTimeFieldBuilder() { + if (lastAnalysisTimeBuilder_ == null) { + lastAnalysisTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getLastAnalysisTime(), + getParentForChildren(), + isClean()); + lastAnalysisTime_ = null; + } + return lastAnalysisTimeBuilder_; + } + + private int analysisStatus_ = 0; + /** + *
+     * The status of discovery for the resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public int getAnalysisStatusValue() { + return analysisStatus_; + } + /** + *
+     * The status of discovery for the resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public Builder setAnalysisStatusValue(int value) { + analysisStatus_ = value; + onChanged(); + return this; + } + /** + *
+     * The status of discovery for the resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus getAnalysisStatus() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus result = io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.valueOf(analysisStatus_); + return result == null ? io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus.UNRECOGNIZED : result; + } + /** + *
+     * The status of discovery for the resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public Builder setAnalysisStatus(io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus value) { + if (value == null) { + throw new NullPointerException(); + } + + analysisStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The status of discovery for the resource.
+     * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + public Builder clearAnalysisStatus() { + + analysisStatus_ = 0; + onChanged(); + return this; + } + + private com.google.rpc.Status analysisStatusError_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> analysisStatusErrorBuilder_; + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public boolean hasAnalysisStatusError() { + return analysisStatusErrorBuilder_ != null || analysisStatusError_ != null; + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public com.google.rpc.Status getAnalysisStatusError() { + if (analysisStatusErrorBuilder_ == null) { + return analysisStatusError_ == null ? com.google.rpc.Status.getDefaultInstance() : analysisStatusError_; + } else { + return analysisStatusErrorBuilder_.getMessage(); + } + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public Builder setAnalysisStatusError(com.google.rpc.Status value) { + if (analysisStatusErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + analysisStatusError_ = value; + onChanged(); + } else { + analysisStatusErrorBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public Builder setAnalysisStatusError( + com.google.rpc.Status.Builder builderForValue) { + if (analysisStatusErrorBuilder_ == null) { + analysisStatusError_ = builderForValue.build(); + onChanged(); + } else { + analysisStatusErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public Builder mergeAnalysisStatusError(com.google.rpc.Status value) { + if (analysisStatusErrorBuilder_ == null) { + if (analysisStatusError_ != null) { + analysisStatusError_ = + com.google.rpc.Status.newBuilder(analysisStatusError_).mergeFrom(value).buildPartial(); + } else { + analysisStatusError_ = value; + } + onChanged(); + } else { + analysisStatusErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public Builder clearAnalysisStatusError() { + if (analysisStatusErrorBuilder_ == null) { + analysisStatusError_ = null; + onChanged(); + } else { + analysisStatusError_ = null; + analysisStatusErrorBuilder_ = null; + } + + return this; + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public com.google.rpc.Status.Builder getAnalysisStatusErrorBuilder() { + + onChanged(); + return getAnalysisStatusErrorFieldBuilder().getBuilder(); + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + public com.google.rpc.StatusOrBuilder getAnalysisStatusErrorOrBuilder() { + if (analysisStatusErrorBuilder_ != null) { + return analysisStatusErrorBuilder_.getMessageOrBuilder(); + } else { + return analysisStatusError_ == null ? + com.google.rpc.Status.getDefaultInstance() : analysisStatusError_; + } + } + /** + *
+     * When an error is encountered this will contain a LocalizedMessage under
+     * details to show to the user. The LocalizedMessage is output only and
+     * populated by the API.
+     * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getAnalysisStatusErrorFieldBuilder() { + if (analysisStatusErrorBuilder_ == null) { + analysisStatusErrorBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>( + getAnalysisStatusError(), + getParentForChildren(), + isClean()); + analysisStatusError_ = null; + } + return analysisStatusErrorBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.discovery.Discovered) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.discovery.Discovered) + private static final io.grafeas.v1beta1.discovery.Discovered DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.discovery.Discovered(); + } + + public static io.grafeas.v1beta1.discovery.Discovered getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Discovered parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Discovered(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovered getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveredOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveredOrBuilder.java new file mode 100644 index 000000000000..4a46c2693b75 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveredOrBuilder.java @@ -0,0 +1,99 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +public interface DiscoveredOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.discovery.Discovered) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Whether the resource is continuously analyzed.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + int getContinuousAnalysisValue(); + /** + *
+   * Whether the resource is continuously analyzed.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis continuous_analysis = 1; + */ + io.grafeas.v1beta1.discovery.Discovered.ContinuousAnalysis getContinuousAnalysis(); + + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + boolean hasLastAnalysisTime(); + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + com.google.protobuf.Timestamp getLastAnalysisTime(); + /** + *
+   * The last time continuous analysis was done for this resource.
+   * 
+ * + * .google.protobuf.Timestamp last_analysis_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getLastAnalysisTimeOrBuilder(); + + /** + *
+   * The status of discovery for the resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + int getAnalysisStatusValue(); + /** + *
+   * The status of discovery for the resource.
+   * 
+ * + * .grafeas.v1beta1.discovery.Discovered.AnalysisStatus analysis_status = 3; + */ + io.grafeas.v1beta1.discovery.Discovered.AnalysisStatus getAnalysisStatus(); + + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + boolean hasAnalysisStatusError(); + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + com.google.rpc.Status getAnalysisStatusError(); + /** + *
+   * When an error is encountered this will contain a LocalizedMessage under
+   * details to show to the user. The LocalizedMessage is output only and
+   * populated by the API.
+   * 
+ * + * .google.rpc.Status analysis_status_error = 4; + */ + com.google.rpc.StatusOrBuilder getAnalysisStatusErrorOrBuilder(); +} 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 new file mode 100644 index 000000000000..bddb7dfbfe57 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/Discovery.java @@ -0,0 +1,539 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +/** + *
+ * A note that indicates a type of analysis a provider would perform. This note
+ * exists in a provider's project. A `Discovery` occurrence is created in a
+ * consumer's project at the start of analysis.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Discovery} + */ +public final class Discovery extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.discovery.Discovery) + DiscoveryOrBuilder { +private static final long serialVersionUID = 0L; + // Use Discovery.newBuilder() to construct. + private Discovery(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Discovery() { + analysisKind_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Discovery( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + analysisKind_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Discovery.class, io.grafeas.v1beta1.discovery.Discovery.Builder.class); + } + + public static final int ANALYSIS_KIND_FIELD_NUMBER = 1; + private int analysisKind_; + /** + *
+   * The kind of analysis that is handled by this discovery.
+   * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public int getAnalysisKindValue() { + return analysisKind_; + } + /** + *
+   * The kind of analysis that is handled by this discovery.
+   * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public io.grafeas.v1beta1.common.NoteKind getAnalysisKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(analysisKind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (analysisKind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(1, analysisKind_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (analysisKind_ != io.grafeas.v1beta1.common.NoteKind.NOTE_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, analysisKind_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.discovery.Discovery)) { + return super.equals(obj); + } + io.grafeas.v1beta1.discovery.Discovery other = (io.grafeas.v1beta1.discovery.Discovery) obj; + + boolean result = true; + result = result && analysisKind_ == other.analysisKind_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ANALYSIS_KIND_FIELD_NUMBER; + hash = (53 * hash) + analysisKind_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovery parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovery parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.discovery.Discovery parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.discovery.Discovery prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A note that indicates a type of analysis a provider would perform. This note
+   * exists in a provider's project. A `Discovery` occurrence is created in a
+   * consumer's project at the start of analysis.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.discovery.Discovery} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.discovery.Discovery) + io.grafeas.v1beta1.discovery.DiscoveryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovery_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovery_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.discovery.Discovery.class, io.grafeas.v1beta1.discovery.Discovery.Builder.class); + } + + // Construct using io.grafeas.v1beta1.discovery.Discovery.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + analysisKind_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.discovery.DiscoveryOuterClass.internal_static_grafeas_v1beta1_discovery_Discovery_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovery getDefaultInstanceForType() { + return io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovery build() { + io.grafeas.v1beta1.discovery.Discovery result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovery buildPartial() { + io.grafeas.v1beta1.discovery.Discovery result = new io.grafeas.v1beta1.discovery.Discovery(this); + result.analysisKind_ = analysisKind_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.discovery.Discovery) { + return mergeFrom((io.grafeas.v1beta1.discovery.Discovery)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.discovery.Discovery other) { + if (other == io.grafeas.v1beta1.discovery.Discovery.getDefaultInstance()) return this; + if (other.analysisKind_ != 0) { + setAnalysisKindValue(other.getAnalysisKindValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.discovery.Discovery parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.discovery.Discovery) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int analysisKind_ = 0; + /** + *
+     * The kind of analysis that is handled by this discovery.
+     * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public int getAnalysisKindValue() { + return analysisKind_; + } + /** + *
+     * The kind of analysis that is handled by this discovery.
+     * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public Builder setAnalysisKindValue(int value) { + analysisKind_ = value; + onChanged(); + return this; + } + /** + *
+     * The kind of analysis that is handled by this discovery.
+     * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public io.grafeas.v1beta1.common.NoteKind getAnalysisKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.common.NoteKind result = io.grafeas.v1beta1.common.NoteKind.valueOf(analysisKind_); + return result == null ? io.grafeas.v1beta1.common.NoteKind.UNRECOGNIZED : result; + } + /** + *
+     * The kind of analysis that is handled by this discovery.
+     * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public Builder setAnalysisKind(io.grafeas.v1beta1.common.NoteKind value) { + if (value == null) { + throw new NullPointerException(); + } + + analysisKind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The kind of analysis that is handled by this discovery.
+     * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + public Builder clearAnalysisKind() { + + analysisKind_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.discovery.Discovery) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.discovery.Discovery) + private static final io.grafeas.v1beta1.discovery.Discovery DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.discovery.Discovery(); + } + + public static io.grafeas.v1beta1.discovery.Discovery getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Discovery parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Discovery(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.discovery.Discovery getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOrBuilder.java new file mode 100644 index 000000000000..58011312b922 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +public interface DiscoveryOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.discovery.Discovery) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The kind of analysis that is handled by this discovery.
+   * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + int getAnalysisKindValue(); + /** + *
+   * The kind of analysis that is handled by this discovery.
+   * 
+ * + * .grafeas.v1beta1.NoteKind analysis_kind = 1; + */ + io.grafeas.v1beta1.common.NoteKind getAnalysisKind(); +} 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 new file mode 100644 index 000000000000..44162fbcea21 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/DiscoveryOuterClass.java @@ -0,0 +1,107 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/discovery/discovery.proto + +package io.grafeas.v1beta1.discovery; + +public final class DiscoveryOuterClass { + private DiscoveryOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_discovery_Discovery_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_discovery_Discovery_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_discovery_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_discovery_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_discovery_Discovered_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_discovery_Discovered_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nCgoogle/devtools/containeranalysis/v1be" + + "ta1/discovery/discovery.proto\022\031grafeas.v" + + "1beta1.discovery\032=google/devtools/contai" + + "neranalysis/v1beta1/common/common.proto\032" + + "\037google/protobuf/timestamp.proto\032\027google" + + "/rpc/status.proto\"=\n\tDiscovery\0220\n\ranalys" + + "is_kind\030\001 \001(\0162\031.grafeas.v1beta1.NoteKind" + + "\"D\n\007Details\0229\n\ndiscovered\030\001 \001(\0132%.grafea" + + "s.v1beta1.discovery.Discovered\"\206\004\n\nDisco" + + "vered\022U\n\023continuous_analysis\030\001 \001(\01628.gra" + + "feas.v1beta1.discovery.Discovered.Contin" + + "uousAnalysis\0226\n\022last_analysis_time\030\002 \001(\013" + + "2\032.google.protobuf.Timestamp\022M\n\017analysis" + + "_status\030\003 \001(\01624.grafeas.v1beta1.discover" + + "y.Discovered.AnalysisStatus\0221\n\025analysis_" + + "status_error\030\004 \001(\0132\022.google.rpc.Status\"S" + + "\n\022ContinuousAnalysis\022#\n\037CONTINUOUS_ANALY" + + "SIS_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\014\n\010INACTIV" + + "E\020\002\"\221\001\n\016AnalysisStatus\022\037\n\033ANALYSIS_STATU" + + "S_UNSPECIFIED\020\000\022\013\n\007PENDING\020\001\022\014\n\010SCANNING" + + "\020\002\022\024\n\020FINISHED_SUCCESS\020\003\022\023\n\017FINISHED_FAI" + + "LED\020\004\022\030\n\024FINISHED_UNSUPPORTED\020\005B\204\001\n\034io.g" + + "rafeas.v1beta1.discoveryP\001Z\\google.golan" + + "g.org/genproto/googleapis/devtools/conta" + + "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); + internal_static_grafeas_v1beta1_discovery_Discovery_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_discovery_Discovery_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_discovery_Discovery_descriptor, + new java.lang.String[] { "AnalysisKind", }); + internal_static_grafeas_v1beta1_discovery_Details_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_discovery_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_discovery_Details_descriptor, + new java.lang.String[] { "Discovered", }); + internal_static_grafeas_v1beta1_discovery_Discovered_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_discovery_Discovered_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_discovery_Discovered_descriptor, + new java.lang.String[] { "ContinuousAnalysis", "LastAnalysisTime", "AnalysisStatus", "AnalysisStatusError", }); + io.grafeas.v1beta1.common.Common.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/NoteName.java new file mode 100644 index 000000000000..5f72776048cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.discovery; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/OccurrenceName.java new file mode 100644 index 000000000000..754d5465ddd1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.discovery; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ProjectName.java new file mode 100644 index 000000000000..195d8ff50e5e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.discovery; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ScanConfigName.java new file mode 100644 index 000000000000..faa24b599969 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/discovery/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.discovery; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..8db569cd14f9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Basis.java @@ -0,0 +1,821 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +/** + *
+ * Basis describes the base image portion (Note) of the DockerImage
+ * relationship. Linked occurrences are derived from this or an
+ * equivalent image via:
+ *   FROM <Basis.resource_url>
+ * Or an equivalent reference, e.g. a tag of the resource_url.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Basis} + */ +public final class Basis extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.image.Basis) + BasisOrBuilder { +private static final long serialVersionUID = 0L; + // Use Basis.newBuilder() to construct. + private Basis(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Basis() { + resourceUrl_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Basis( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUrl_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.image.Fingerprint.Builder subBuilder = null; + if (fingerprint_ != null) { + subBuilder = fingerprint_.toBuilder(); + } + fingerprint_ = input.readMessage(io.grafeas.v1beta1.image.Fingerprint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fingerprint_); + fingerprint_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Basis_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Basis_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Basis.class, io.grafeas.v1beta1.image.Basis.Builder.class); + } + + public static final int RESOURCE_URL_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceUrl_; + /** + *
+   * The resource_url for the resource representing the basis of
+   * associated occurrence images.
+   * 
+ * + * string resource_url = 1; + */ + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } + } + /** + *
+   * The resource_url for the resource representing the basis of
+   * associated occurrence images.
+   * 
+ * + * string resource_url = 1; + */ + public com.google.protobuf.ByteString + getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINGERPRINT_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.image.Fingerprint fingerprint_; + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public boolean hasFingerprint() { + return fingerprint_ != null; + } + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public io.grafeas.v1beta1.image.Fingerprint getFingerprint() { + return fingerprint_ == null ? io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder() { + return getFingerprint(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getResourceUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceUrl_); + } + if (fingerprint_ != null) { + output.writeMessage(2, getFingerprint()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceUrl_); + } + if (fingerprint_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFingerprint()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.image.Basis)) { + return super.equals(obj); + } + io.grafeas.v1beta1.image.Basis other = (io.grafeas.v1beta1.image.Basis) obj; + + boolean result = true; + result = result && getResourceUrl() + .equals(other.getResourceUrl()); + result = result && (hasFingerprint() == other.hasFingerprint()); + if (hasFingerprint()) { + result = result && getFingerprint() + .equals(other.getFingerprint()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER; + hash = (53 * hash) + getResourceUrl().hashCode(); + if (hasFingerprint()) { + hash = (37 * hash) + FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getFingerprint().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.image.Basis parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Basis parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Basis parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Basis parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Basis parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Basis parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.image.Basis prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Basis describes the base image portion (Note) of the DockerImage
+   * relationship. Linked occurrences are derived from this or an
+   * equivalent image via:
+   *   FROM <Basis.resource_url>
+   * Or an equivalent reference, e.g. a tag of the resource_url.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Basis} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.image.Basis) + io.grafeas.v1beta1.image.BasisOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Basis_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Basis_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Basis.class, io.grafeas.v1beta1.image.Basis.Builder.class); + } + + // Construct using io.grafeas.v1beta1.image.Basis.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + resourceUrl_ = ""; + + if (fingerprintBuilder_ == null) { + fingerprint_ = null; + } else { + fingerprint_ = null; + fingerprintBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Basis_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Basis getDefaultInstanceForType() { + return io.grafeas.v1beta1.image.Basis.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Basis build() { + io.grafeas.v1beta1.image.Basis result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Basis buildPartial() { + io.grafeas.v1beta1.image.Basis result = new io.grafeas.v1beta1.image.Basis(this); + result.resourceUrl_ = resourceUrl_; + if (fingerprintBuilder_ == null) { + result.fingerprint_ = fingerprint_; + } else { + result.fingerprint_ = fingerprintBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.image.Basis) { + return mergeFrom((io.grafeas.v1beta1.image.Basis)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.image.Basis other) { + if (other == io.grafeas.v1beta1.image.Basis.getDefaultInstance()) return this; + if (!other.getResourceUrl().isEmpty()) { + resourceUrl_ = other.resourceUrl_; + onChanged(); + } + if (other.hasFingerprint()) { + mergeFingerprint(other.getFingerprint()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.image.Basis parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.image.Basis) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resourceUrl_ = ""; + /** + *
+     * The resource_url for the resource representing the basis of
+     * associated occurrence images.
+     * 
+ * + * string resource_url = 1; + */ + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The resource_url for the resource representing the basis of
+     * associated occurrence images.
+     * 
+ * + * string resource_url = 1; + */ + public com.google.protobuf.ByteString + getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The resource_url for the resource representing the basis of
+     * associated occurrence images.
+     * 
+ * + * string resource_url = 1; + */ + public Builder setResourceUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUrl_ = value; + onChanged(); + return this; + } + /** + *
+     * The resource_url for the resource representing the basis of
+     * associated occurrence images.
+     * 
+ * + * string resource_url = 1; + */ + public Builder clearResourceUrl() { + + resourceUrl_ = getDefaultInstance().getResourceUrl(); + onChanged(); + return this; + } + /** + *
+     * The resource_url for the resource representing the basis of
+     * associated occurrence images.
+     * 
+ * + * string resource_url = 1; + */ + public Builder setResourceUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUrl_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.image.Fingerprint fingerprint_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder> fingerprintBuilder_; + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public boolean hasFingerprint() { + return fingerprintBuilder_ != null || fingerprint_ != null; + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public io.grafeas.v1beta1.image.Fingerprint getFingerprint() { + if (fingerprintBuilder_ == null) { + return fingerprint_ == null ? io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } else { + return fingerprintBuilder_.getMessage(); + } + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public Builder setFingerprint(io.grafeas.v1beta1.image.Fingerprint value) { + if (fingerprintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fingerprint_ = value; + onChanged(); + } else { + fingerprintBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public Builder setFingerprint( + io.grafeas.v1beta1.image.Fingerprint.Builder builderForValue) { + if (fingerprintBuilder_ == null) { + fingerprint_ = builderForValue.build(); + onChanged(); + } else { + fingerprintBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public Builder mergeFingerprint(io.grafeas.v1beta1.image.Fingerprint value) { + if (fingerprintBuilder_ == null) { + if (fingerprint_ != null) { + fingerprint_ = + io.grafeas.v1beta1.image.Fingerprint.newBuilder(fingerprint_).mergeFrom(value).buildPartial(); + } else { + fingerprint_ = value; + } + onChanged(); + } else { + fingerprintBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public Builder clearFingerprint() { + if (fingerprintBuilder_ == null) { + fingerprint_ = null; + onChanged(); + } else { + fingerprint_ = null; + fingerprintBuilder_ = null; + } + + return this; + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public io.grafeas.v1beta1.image.Fingerprint.Builder getFingerprintBuilder() { + + onChanged(); + return getFingerprintFieldBuilder().getBuilder(); + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + public io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder() { + if (fingerprintBuilder_ != null) { + return fingerprintBuilder_.getMessageOrBuilder(); + } else { + return fingerprint_ == null ? + io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } + } + /** + *
+     * The fingerprint of the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder> + getFingerprintFieldBuilder() { + if (fingerprintBuilder_ == null) { + fingerprintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder>( + getFingerprint(), + getParentForChildren(), + isClean()); + fingerprint_ = null; + } + return fingerprintBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.image.Basis) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.image.Basis) + private static final io.grafeas.v1beta1.image.Basis DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.image.Basis(); + } + + public static io.grafeas.v1beta1.image.Basis getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Basis parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Basis(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Basis getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/BasisOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/BasisOrBuilder.java new file mode 100644 index 000000000000..ae4cfe847d5d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/BasisOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public interface BasisOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.image.Basis) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The resource_url for the resource representing the basis of
+   * associated occurrence images.
+   * 
+ * + * string resource_url = 1; + */ + java.lang.String getResourceUrl(); + /** + *
+   * The resource_url for the resource representing the basis of
+   * associated occurrence images.
+   * 
+ * + * string resource_url = 1; + */ + com.google.protobuf.ByteString + getResourceUrlBytes(); + + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + boolean hasFingerprint(); + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + io.grafeas.v1beta1.image.Fingerprint getFingerprint(); + /** + *
+   * The fingerprint of the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 2; + */ + io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder(); +} 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 new file mode 100644 index 000000000000..f21fe5d0432d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Derived.java @@ -0,0 +1,1381 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +/** + *
+ * Derived describes the derived image portion (Occurrence) of the DockerImage
+ * relationship. This image would be produced from a Dockerfile with FROM
+ * <DockerImage.Basis in attached Note>.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Derived} + */ +public final class Derived extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.image.Derived) + DerivedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Derived.newBuilder() to construct. + private Derived(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Derived() { + distance_ = 0; + layerInfo_ = java.util.Collections.emptyList(); + baseResourceUrl_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Derived( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.image.Fingerprint.Builder subBuilder = null; + if (fingerprint_ != null) { + subBuilder = fingerprint_.toBuilder(); + } + fingerprint_ = input.readMessage(io.grafeas.v1beta1.image.Fingerprint.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fingerprint_); + fingerprint_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + distance_ = input.readInt32(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + layerInfo_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + layerInfo_.add( + input.readMessage(io.grafeas.v1beta1.image.Layer.parser(), extensionRegistry)); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + baseResourceUrl_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + layerInfo_ = java.util.Collections.unmodifiableList(layerInfo_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Derived_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Derived_fieldAccessorTable + .ensureFieldAccessorsInitialized( + 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_; + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public boolean hasFingerprint() { + return fingerprint_ != null; + } + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public io.grafeas.v1beta1.image.Fingerprint getFingerprint() { + return fingerprint_ == null ? io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder() { + return getFingerprint(); + } + + public static final int DISTANCE_FIELD_NUMBER = 2; + private int distance_; + /** + *
+   * Output only. The number of layers by which this image differs from the
+   * associated image basis.
+   * 
+ * + * int32 distance = 2; + */ + public int getDistance() { + return distance_; + } + + public static final int LAYER_INFO_FIELD_NUMBER = 3; + private java.util.List layerInfo_; + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public java.util.List getLayerInfoList() { + return layerInfo_; + } + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public java.util.List + getLayerInfoOrBuilderList() { + return layerInfo_; + } + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public int getLayerInfoCount() { + return layerInfo_.size(); + } + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.Layer getLayerInfo(int index) { + return layerInfo_.get(index); + } + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.LayerOrBuilder getLayerInfoOrBuilder( + int index) { + return layerInfo_.get(index); + } + + public static final int BASE_RESOURCE_URL_FIELD_NUMBER = 4; + private volatile java.lang.Object baseResourceUrl_; + /** + *
+   * Output only. This contains the base image URL for the derived image
+   * occurrence.
+   * 
+ * + * string base_resource_url = 4; + */ + public java.lang.String getBaseResourceUrl() { + java.lang.Object ref = baseResourceUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseResourceUrl_ = s; + return s; + } + } + /** + *
+   * Output only. This contains the base image URL for the derived image
+   * occurrence.
+   * 
+ * + * string base_resource_url = 4; + */ + public com.google.protobuf.ByteString + getBaseResourceUrlBytes() { + java.lang.Object ref = baseResourceUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + baseResourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (fingerprint_ != null) { + output.writeMessage(1, getFingerprint()); + } + if (distance_ != 0) { + output.writeInt32(2, distance_); + } + for (int i = 0; i < layerInfo_.size(); i++) { + output.writeMessage(3, layerInfo_.get(i)); + } + if (!getBaseResourceUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, baseResourceUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (fingerprint_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getFingerprint()); + } + if (distance_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, distance_); + } + for (int i = 0; i < layerInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, layerInfo_.get(i)); + } + if (!getBaseResourceUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, baseResourceUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.image.Derived)) { + return super.equals(obj); + } + io.grafeas.v1beta1.image.Derived other = (io.grafeas.v1beta1.image.Derived) obj; + + boolean result = true; + result = result && (hasFingerprint() == other.hasFingerprint()); + if (hasFingerprint()) { + result = result && getFingerprint() + .equals(other.getFingerprint()); + } + result = result && (getDistance() + == other.getDistance()); + result = result && getLayerInfoList() + .equals(other.getLayerInfoList()); + result = result && getBaseResourceUrl() + .equals(other.getBaseResourceUrl()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasFingerprint()) { + hash = (37 * hash) + FINGERPRINT_FIELD_NUMBER; + hash = (53 * hash) + getFingerprint().hashCode(); + } + hash = (37 * hash) + DISTANCE_FIELD_NUMBER; + hash = (53 * hash) + getDistance(); + if (getLayerInfoCount() > 0) { + hash = (37 * hash) + LAYER_INFO_FIELD_NUMBER; + hash = (53 * hash) + getLayerInfoList().hashCode(); + } + hash = (37 * hash) + BASE_RESOURCE_URL_FIELD_NUMBER; + hash = (53 * hash) + getBaseResourceUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.image.Derived parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Derived parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Derived parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Derived parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Derived parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Derived parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.image.Derived prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Derived describes the derived image portion (Occurrence) of the DockerImage
+   * relationship. This image would be produced from a Dockerfile with FROM
+   * <DockerImage.Basis in attached Note>.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Derived} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.image.Derived) + io.grafeas.v1beta1.image.DerivedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Derived_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Derived_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Derived.class, io.grafeas.v1beta1.image.Derived.Builder.class); + } + + // Construct using io.grafeas.v1beta1.image.Derived.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLayerInfoFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (fingerprintBuilder_ == null) { + fingerprint_ = null; + } else { + fingerprint_ = null; + fingerprintBuilder_ = null; + } + distance_ = 0; + + if (layerInfoBuilder_ == null) { + layerInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + layerInfoBuilder_.clear(); + } + baseResourceUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Derived_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Derived getDefaultInstanceForType() { + return io.grafeas.v1beta1.image.Derived.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Derived build() { + io.grafeas.v1beta1.image.Derived result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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 { + result.fingerprint_ = fingerprintBuilder_.build(); + } + result.distance_ = distance_; + if (layerInfoBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + layerInfo_ = java.util.Collections.unmodifiableList(layerInfo_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.layerInfo_ = layerInfo_; + } else { + result.layerInfo_ = layerInfoBuilder_.build(); + } + result.baseResourceUrl_ = baseResourceUrl_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.image.Derived) { + return mergeFrom((io.grafeas.v1beta1.image.Derived)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.image.Derived other) { + if (other == io.grafeas.v1beta1.image.Derived.getDefaultInstance()) return this; + if (other.hasFingerprint()) { + mergeFingerprint(other.getFingerprint()); + } + if (other.getDistance() != 0) { + setDistance(other.getDistance()); + } + if (layerInfoBuilder_ == null) { + if (!other.layerInfo_.isEmpty()) { + if (layerInfo_.isEmpty()) { + layerInfo_ = other.layerInfo_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureLayerInfoIsMutable(); + layerInfo_.addAll(other.layerInfo_); + } + onChanged(); + } + } else { + if (!other.layerInfo_.isEmpty()) { + if (layerInfoBuilder_.isEmpty()) { + layerInfoBuilder_.dispose(); + layerInfoBuilder_ = null; + layerInfo_ = other.layerInfo_; + bitField0_ = (bitField0_ & ~0x00000004); + layerInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLayerInfoFieldBuilder() : null; + } else { + layerInfoBuilder_.addAllMessages(other.layerInfo_); + } + } + } + if (!other.getBaseResourceUrl().isEmpty()) { + baseResourceUrl_ = other.baseResourceUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.image.Derived parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.image.Derived) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private io.grafeas.v1beta1.image.Fingerprint fingerprint_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder> fingerprintBuilder_; + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public boolean hasFingerprint() { + return fingerprintBuilder_ != null || fingerprint_ != null; + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public io.grafeas.v1beta1.image.Fingerprint getFingerprint() { + if (fingerprintBuilder_ == null) { + return fingerprint_ == null ? io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } else { + return fingerprintBuilder_.getMessage(); + } + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public Builder setFingerprint(io.grafeas.v1beta1.image.Fingerprint value) { + if (fingerprintBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fingerprint_ = value; + onChanged(); + } else { + fingerprintBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public Builder setFingerprint( + io.grafeas.v1beta1.image.Fingerprint.Builder builderForValue) { + if (fingerprintBuilder_ == null) { + fingerprint_ = builderForValue.build(); + onChanged(); + } else { + fingerprintBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public Builder mergeFingerprint(io.grafeas.v1beta1.image.Fingerprint value) { + if (fingerprintBuilder_ == null) { + if (fingerprint_ != null) { + fingerprint_ = + io.grafeas.v1beta1.image.Fingerprint.newBuilder(fingerprint_).mergeFrom(value).buildPartial(); + } else { + fingerprint_ = value; + } + onChanged(); + } else { + fingerprintBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public Builder clearFingerprint() { + if (fingerprintBuilder_ == null) { + fingerprint_ = null; + onChanged(); + } else { + fingerprint_ = null; + fingerprintBuilder_ = null; + } + + return this; + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public io.grafeas.v1beta1.image.Fingerprint.Builder getFingerprintBuilder() { + + onChanged(); + return getFingerprintFieldBuilder().getBuilder(); + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + public io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder() { + if (fingerprintBuilder_ != null) { + return fingerprintBuilder_.getMessageOrBuilder(); + } else { + return fingerprint_ == null ? + io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance() : fingerprint_; + } + } + /** + *
+     * The fingerprint of the derived image.
+     * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder> + getFingerprintFieldBuilder() { + if (fingerprintBuilder_ == null) { + fingerprintBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Fingerprint, io.grafeas.v1beta1.image.Fingerprint.Builder, io.grafeas.v1beta1.image.FingerprintOrBuilder>( + getFingerprint(), + getParentForChildren(), + isClean()); + fingerprint_ = null; + } + return fingerprintBuilder_; + } + + private int distance_ ; + /** + *
+     * Output only. The number of layers by which this image differs from the
+     * associated image basis.
+     * 
+ * + * int32 distance = 2; + */ + public int getDistance() { + return distance_; + } + /** + *
+     * Output only. The number of layers by which this image differs from the
+     * associated image basis.
+     * 
+ * + * int32 distance = 2; + */ + public Builder setDistance(int value) { + + distance_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The number of layers by which this image differs from the
+     * associated image basis.
+     * 
+ * + * int32 distance = 2; + */ + public Builder clearDistance() { + + distance_ = 0; + onChanged(); + return this; + } + + private java.util.List layerInfo_ = + java.util.Collections.emptyList(); + private void ensureLayerInfoIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + layerInfo_ = new java.util.ArrayList(layerInfo_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.image.Layer, io.grafeas.v1beta1.image.Layer.Builder, io.grafeas.v1beta1.image.LayerOrBuilder> layerInfoBuilder_; + + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public java.util.List getLayerInfoList() { + if (layerInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(layerInfo_); + } else { + return layerInfoBuilder_.getMessageList(); + } + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public int getLayerInfoCount() { + if (layerInfoBuilder_ == null) { + return layerInfo_.size(); + } else { + return layerInfoBuilder_.getCount(); + } + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.Layer getLayerInfo(int index) { + if (layerInfoBuilder_ == null) { + return layerInfo_.get(index); + } else { + return layerInfoBuilder_.getMessage(index); + } + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder setLayerInfo( + int index, io.grafeas.v1beta1.image.Layer value) { + if (layerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayerInfoIsMutable(); + layerInfo_.set(index, value); + onChanged(); + } else { + layerInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder setLayerInfo( + int index, io.grafeas.v1beta1.image.Layer.Builder builderForValue) { + if (layerInfoBuilder_ == null) { + ensureLayerInfoIsMutable(); + layerInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + layerInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder addLayerInfo(io.grafeas.v1beta1.image.Layer value) { + if (layerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayerInfoIsMutable(); + layerInfo_.add(value); + onChanged(); + } else { + layerInfoBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder addLayerInfo( + int index, io.grafeas.v1beta1.image.Layer value) { + if (layerInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLayerInfoIsMutable(); + layerInfo_.add(index, value); + onChanged(); + } else { + layerInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder addLayerInfo( + io.grafeas.v1beta1.image.Layer.Builder builderForValue) { + if (layerInfoBuilder_ == null) { + ensureLayerInfoIsMutable(); + layerInfo_.add(builderForValue.build()); + onChanged(); + } else { + layerInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder addLayerInfo( + int index, io.grafeas.v1beta1.image.Layer.Builder builderForValue) { + if (layerInfoBuilder_ == null) { + ensureLayerInfoIsMutable(); + layerInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + layerInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder addAllLayerInfo( + java.lang.Iterable values) { + if (layerInfoBuilder_ == null) { + ensureLayerInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, layerInfo_); + onChanged(); + } else { + layerInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder clearLayerInfo() { + if (layerInfoBuilder_ == null) { + layerInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + layerInfoBuilder_.clear(); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public Builder removeLayerInfo(int index) { + if (layerInfoBuilder_ == null) { + ensureLayerInfoIsMutable(); + layerInfo_.remove(index); + onChanged(); + } else { + layerInfoBuilder_.remove(index); + } + return this; + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.Layer.Builder getLayerInfoBuilder( + int index) { + return getLayerInfoFieldBuilder().getBuilder(index); + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.LayerOrBuilder getLayerInfoOrBuilder( + int index) { + if (layerInfoBuilder_ == null) { + return layerInfo_.get(index); } else { + return layerInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public java.util.List + getLayerInfoOrBuilderList() { + if (layerInfoBuilder_ != null) { + return layerInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(layerInfo_); + } + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.Layer.Builder addLayerInfoBuilder() { + return getLayerInfoFieldBuilder().addBuilder( + io.grafeas.v1beta1.image.Layer.getDefaultInstance()); + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public io.grafeas.v1beta1.image.Layer.Builder addLayerInfoBuilder( + int index) { + return getLayerInfoFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.image.Layer.getDefaultInstance()); + } + /** + *
+     * This contains layer-specific metadata, if populated it has length
+     * "distance" and is ordered with [distance] being the layer immediately
+     * following the base image and [1] being the final layer.
+     * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + public java.util.List + getLayerInfoBuilderList() { + return getLayerInfoFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.image.Layer, io.grafeas.v1beta1.image.Layer.Builder, io.grafeas.v1beta1.image.LayerOrBuilder> + getLayerInfoFieldBuilder() { + if (layerInfoBuilder_ == null) { + layerInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.image.Layer, io.grafeas.v1beta1.image.Layer.Builder, io.grafeas.v1beta1.image.LayerOrBuilder>( + layerInfo_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + layerInfo_ = null; + } + return layerInfoBuilder_; + } + + private java.lang.Object baseResourceUrl_ = ""; + /** + *
+     * Output only. This contains the base image URL for the derived image
+     * occurrence.
+     * 
+ * + * string base_resource_url = 4; + */ + public java.lang.String getBaseResourceUrl() { + java.lang.Object ref = baseResourceUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + baseResourceUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. This contains the base image URL for the derived image
+     * occurrence.
+     * 
+ * + * string base_resource_url = 4; + */ + public com.google.protobuf.ByteString + getBaseResourceUrlBytes() { + java.lang.Object ref = baseResourceUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + baseResourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. This contains the base image URL for the derived image
+     * occurrence.
+     * 
+ * + * string base_resource_url = 4; + */ + public Builder setBaseResourceUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + baseResourceUrl_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. This contains the base image URL for the derived image
+     * occurrence.
+     * 
+ * + * string base_resource_url = 4; + */ + public Builder clearBaseResourceUrl() { + + baseResourceUrl_ = getDefaultInstance().getBaseResourceUrl(); + onChanged(); + return this; + } + /** + *
+     * Output only. This contains the base image URL for the derived image
+     * occurrence.
+     * 
+ * + * string base_resource_url = 4; + */ + public Builder setBaseResourceUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + baseResourceUrl_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.image.Derived) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.image.Derived) + private static final io.grafeas.v1beta1.image.Derived DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.image.Derived(); + } + + public static io.grafeas.v1beta1.image.Derived getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Derived parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Derived(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Derived getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DerivedOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DerivedOrBuilder.java new file mode 100644 index 000000000000..9b87b9257b5f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DerivedOrBuilder.java @@ -0,0 +1,118 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public interface DerivedOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.image.Derived) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + boolean hasFingerprint(); + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + io.grafeas.v1beta1.image.Fingerprint getFingerprint(); + /** + *
+   * The fingerprint of the derived image.
+   * 
+ * + * .grafeas.v1beta1.image.Fingerprint fingerprint = 1; + */ + io.grafeas.v1beta1.image.FingerprintOrBuilder getFingerprintOrBuilder(); + + /** + *
+   * Output only. The number of layers by which this image differs from the
+   * associated image basis.
+   * 
+ * + * int32 distance = 2; + */ + int getDistance(); + + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + java.util.List + getLayerInfoList(); + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + io.grafeas.v1beta1.image.Layer getLayerInfo(int index); + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + int getLayerInfoCount(); + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + java.util.List + getLayerInfoOrBuilderList(); + /** + *
+   * This contains layer-specific metadata, if populated it has length
+   * "distance" and is ordered with [distance] being the layer immediately
+   * following the base image and [1] being the final layer.
+   * 
+ * + * repeated .grafeas.v1beta1.image.Layer layer_info = 3; + */ + io.grafeas.v1beta1.image.LayerOrBuilder getLayerInfoOrBuilder( + int index); + + /** + *
+   * Output only. This contains the base image URL for the derived image
+   * occurrence.
+   * 
+ * + * string base_resource_url = 4; + */ + java.lang.String getBaseResourceUrl(); + /** + *
+   * Output only. This contains the base image URL for the derived image
+   * occurrence.
+   * 
+ * + * string base_resource_url = 4; + */ + com.google.protobuf.ByteString + getBaseResourceUrlBytes(); +} 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 new file mode 100644 index 000000000000..57a8a7455417 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Details.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +/** + *
+ * Details of an image occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.image.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.image.Derived.Builder subBuilder = null; + if (derivedImage_ != null) { + subBuilder = derivedImage_.toBuilder(); + } + derivedImage_ = input.readMessage(io.grafeas.v1beta1.image.Derived.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(derivedImage_); + derivedImage_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Details.class, io.grafeas.v1beta1.image.Details.Builder.class); + } + + public static final int DERIVED_IMAGE_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.image.Derived derivedImage_; + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public boolean hasDerivedImage() { + return derivedImage_ != null; + } + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public io.grafeas.v1beta1.image.Derived getDerivedImage() { + return derivedImage_ == null ? io.grafeas.v1beta1.image.Derived.getDefaultInstance() : derivedImage_; + } + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public io.grafeas.v1beta1.image.DerivedOrBuilder getDerivedImageOrBuilder() { + return getDerivedImage(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (derivedImage_ != null) { + output.writeMessage(1, getDerivedImage()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (derivedImage_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getDerivedImage()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.image.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.image.Details other = (io.grafeas.v1beta1.image.Details) obj; + + boolean result = true; + result = result && (hasDerivedImage() == other.hasDerivedImage()); + if (hasDerivedImage()) { + result = result && getDerivedImage() + .equals(other.getDerivedImage()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasDerivedImage()) { + hash = (37 * hash) + DERIVED_IMAGE_FIELD_NUMBER; + hash = (53 * hash) + getDerivedImage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.image.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.image.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of an image occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.image.Details) + io.grafeas.v1beta1.image.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Details.class, io.grafeas.v1beta1.image.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.image.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (derivedImageBuilder_ == null) { + derivedImage_ = null; + } else { + derivedImage_ = null; + derivedImageBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.image.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Details build() { + io.grafeas.v1beta1.image.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Details buildPartial() { + io.grafeas.v1beta1.image.Details result = new io.grafeas.v1beta1.image.Details(this); + if (derivedImageBuilder_ == null) { + result.derivedImage_ = derivedImage_; + } else { + result.derivedImage_ = derivedImageBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.image.Details) { + return mergeFrom((io.grafeas.v1beta1.image.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.image.Details other) { + if (other == io.grafeas.v1beta1.image.Details.getDefaultInstance()) return this; + if (other.hasDerivedImage()) { + mergeDerivedImage(other.getDerivedImage()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.image.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.image.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.image.Derived derivedImage_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Derived, io.grafeas.v1beta1.image.Derived.Builder, io.grafeas.v1beta1.image.DerivedOrBuilder> derivedImageBuilder_; + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public boolean hasDerivedImage() { + return derivedImageBuilder_ != null || derivedImage_ != null; + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public io.grafeas.v1beta1.image.Derived getDerivedImage() { + if (derivedImageBuilder_ == null) { + return derivedImage_ == null ? io.grafeas.v1beta1.image.Derived.getDefaultInstance() : derivedImage_; + } else { + return derivedImageBuilder_.getMessage(); + } + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public Builder setDerivedImage(io.grafeas.v1beta1.image.Derived value) { + if (derivedImageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + derivedImage_ = value; + onChanged(); + } else { + derivedImageBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public Builder setDerivedImage( + io.grafeas.v1beta1.image.Derived.Builder builderForValue) { + if (derivedImageBuilder_ == null) { + derivedImage_ = builderForValue.build(); + onChanged(); + } else { + derivedImageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public Builder mergeDerivedImage(io.grafeas.v1beta1.image.Derived value) { + if (derivedImageBuilder_ == null) { + if (derivedImage_ != null) { + derivedImage_ = + io.grafeas.v1beta1.image.Derived.newBuilder(derivedImage_).mergeFrom(value).buildPartial(); + } else { + derivedImage_ = value; + } + onChanged(); + } else { + derivedImageBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public Builder clearDerivedImage() { + if (derivedImageBuilder_ == null) { + derivedImage_ = null; + onChanged(); + } else { + derivedImage_ = null; + derivedImageBuilder_ = null; + } + + return this; + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public io.grafeas.v1beta1.image.Derived.Builder getDerivedImageBuilder() { + + onChanged(); + return getDerivedImageFieldBuilder().getBuilder(); + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + public io.grafeas.v1beta1.image.DerivedOrBuilder getDerivedImageOrBuilder() { + if (derivedImageBuilder_ != null) { + return derivedImageBuilder_.getMessageOrBuilder(); + } else { + return derivedImage_ == null ? + io.grafeas.v1beta1.image.Derived.getDefaultInstance() : derivedImage_; + } + } + /** + *
+     * The child image derived from the base image.
+     * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Derived, io.grafeas.v1beta1.image.Derived.Builder, io.grafeas.v1beta1.image.DerivedOrBuilder> + getDerivedImageFieldBuilder() { + if (derivedImageBuilder_ == null) { + derivedImageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.image.Derived, io.grafeas.v1beta1.image.Derived.Builder, io.grafeas.v1beta1.image.DerivedOrBuilder>( + getDerivedImage(), + getParentForChildren(), + isClean()); + derivedImage_ = null; + } + return derivedImageBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.image.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.image.Details) + private static final io.grafeas.v1beta1.image.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.image.Details(); + } + + public static io.grafeas.v1beta1.image.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DetailsOrBuilder.java new file mode 100644 index 000000000000..b3d1c73387b0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/DetailsOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.image.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + boolean hasDerivedImage(); + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + io.grafeas.v1beta1.image.Derived getDerivedImage(); + /** + *
+   * The child image derived from the base image.
+   * 
+ * + * .grafeas.v1beta1.image.Derived derived_image = 1; + */ + io.grafeas.v1beta1.image.DerivedOrBuilder getDerivedImageOrBuilder(); +} 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 new file mode 100644 index 000000000000..c2f96123cdfd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Fingerprint.java @@ -0,0 +1,980 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +/** + *
+ * A set of properties that uniquely identify a given Docker image.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Fingerprint} + */ +public final class Fingerprint extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.image.Fingerprint) + FingerprintOrBuilder { +private static final long serialVersionUID = 0L; + // Use Fingerprint.newBuilder() to construct. + private Fingerprint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Fingerprint() { + v1Name_ = ""; + v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; + v2Name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Fingerprint( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + v1Name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + v2Blob_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + v2Blob_.add(s); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + v2Name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + v2Blob_ = v2Blob_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Fingerprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Fingerprint.class, 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_; + /** + *
+   * The layer-id of the final layer in the Docker image's v1 representation.
+   * 
+ * + * string v1_name = 1; + */ + public java.lang.String getV1Name() { + java.lang.Object ref = v1Name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + v1Name_ = s; + return s; + } + } + /** + *
+   * The layer-id of the final layer in the Docker image's v1 representation.
+   * 
+ * + * string v1_name = 1; + */ + public com.google.protobuf.ByteString + getV1NameBytes() { + java.lang.Object ref = v1Name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + v1Name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int V2_BLOB_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList v2Blob_; + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + public com.google.protobuf.ProtocolStringList + getV2BlobList() { + return v2Blob_; + } + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + public int getV2BlobCount() { + return v2Blob_.size(); + } + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + public java.lang.String getV2Blob(int index) { + return v2Blob_.get(index); + } + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + public com.google.protobuf.ByteString + getV2BlobBytes(int index) { + return v2Blob_.getByteString(index); + } + + public static final int V2_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object v2Name_; + /** + *
+   * Output only. The name of the image's v2 blobs computed via:
+   *   [bottom] := v2_blob[bottom]
+   *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+   * Only the name of the final blob is kept.
+   * 
+ * + * string v2_name = 3; + */ + public java.lang.String getV2Name() { + java.lang.Object ref = v2Name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + v2Name_ = s; + return s; + } + } + /** + *
+   * Output only. The name of the image's v2 blobs computed via:
+   *   [bottom] := v2_blob[bottom]
+   *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+   * Only the name of the final blob is kept.
+   * 
+ * + * string v2_name = 3; + */ + public com.google.protobuf.ByteString + getV2NameBytes() { + java.lang.Object ref = v2Name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + v2Name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getV1NameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, v1Name_); + } + for (int i = 0; i < v2Blob_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, v2Blob_.getRaw(i)); + } + if (!getV2NameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, v2Name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getV1NameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, v1Name_); + } + { + int dataSize = 0; + for (int i = 0; i < v2Blob_.size(); i++) { + dataSize += computeStringSizeNoTag(v2Blob_.getRaw(i)); + } + size += dataSize; + size += 1 * getV2BlobList().size(); + } + if (!getV2NameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, v2Name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.image.Fingerprint)) { + return super.equals(obj); + } + io.grafeas.v1beta1.image.Fingerprint other = (io.grafeas.v1beta1.image.Fingerprint) obj; + + boolean result = true; + result = result && getV1Name() + .equals(other.getV1Name()); + result = result && getV2BlobList() + .equals(other.getV2BlobList()); + result = result && getV2Name() + .equals(other.getV2Name()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + V1_NAME_FIELD_NUMBER; + hash = (53 * hash) + getV1Name().hashCode(); + if (getV2BlobCount() > 0) { + hash = (37 * hash) + V2_BLOB_FIELD_NUMBER; + hash = (53 * hash) + getV2BlobList().hashCode(); + } + hash = (37 * hash) + V2_NAME_FIELD_NUMBER; + hash = (53 * hash) + getV2Name().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Fingerprint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Fingerprint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Fingerprint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.image.Fingerprint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A set of properties that uniquely identify a given Docker image.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Fingerprint} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.image.Fingerprint) + io.grafeas.v1beta1.image.FingerprintOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Fingerprint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Fingerprint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Fingerprint.class, io.grafeas.v1beta1.image.Fingerprint.Builder.class); + } + + // Construct using io.grafeas.v1beta1.image.Fingerprint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + v1Name_ = ""; + + v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + v2Name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Fingerprint_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Fingerprint getDefaultInstanceForType() { + return io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Fingerprint build() { + io.grafeas.v1beta1.image.Fingerprint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000002)) { + v2Blob_ = v2Blob_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.v2Blob_ = v2Blob_; + result.v2Name_ = v2Name_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.image.Fingerprint) { + return mergeFrom((io.grafeas.v1beta1.image.Fingerprint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.image.Fingerprint other) { + if (other == io.grafeas.v1beta1.image.Fingerprint.getDefaultInstance()) return this; + if (!other.getV1Name().isEmpty()) { + v1Name_ = other.v1Name_; + onChanged(); + } + if (!other.v2Blob_.isEmpty()) { + if (v2Blob_.isEmpty()) { + v2Blob_ = other.v2Blob_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureV2BlobIsMutable(); + v2Blob_.addAll(other.v2Blob_); + } + onChanged(); + } + if (!other.getV2Name().isEmpty()) { + v2Name_ = other.v2Name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.image.Fingerprint parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.image.Fingerprint) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object v1Name_ = ""; + /** + *
+     * The layer-id of the final layer in the Docker image's v1 representation.
+     * 
+ * + * string v1_name = 1; + */ + public java.lang.String getV1Name() { + java.lang.Object ref = v1Name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + v1Name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The layer-id of the final layer in the Docker image's v1 representation.
+     * 
+ * + * string v1_name = 1; + */ + public com.google.protobuf.ByteString + getV1NameBytes() { + java.lang.Object ref = v1Name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + v1Name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The layer-id of the final layer in the Docker image's v1 representation.
+     * 
+ * + * string v1_name = 1; + */ + public Builder setV1Name( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + v1Name_ = value; + onChanged(); + return this; + } + /** + *
+     * The layer-id of the final layer in the Docker image's v1 representation.
+     * 
+ * + * string v1_name = 1; + */ + public Builder clearV1Name() { + + v1Name_ = getDefaultInstance().getV1Name(); + onChanged(); + return this; + } + /** + *
+     * The layer-id of the final layer in the Docker image's v1 representation.
+     * 
+ * + * string v1_name = 1; + */ + public Builder setV1NameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + v1Name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureV2BlobIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + v2Blob_ = new com.google.protobuf.LazyStringArrayList(v2Blob_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public com.google.protobuf.ProtocolStringList + getV2BlobList() { + return v2Blob_.getUnmodifiableView(); + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public int getV2BlobCount() { + return v2Blob_.size(); + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public java.lang.String getV2Blob(int index) { + return v2Blob_.get(index); + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public com.google.protobuf.ByteString + getV2BlobBytes(int index) { + return v2Blob_.getByteString(index); + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public Builder setV2Blob( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureV2BlobIsMutable(); + v2Blob_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public Builder addV2Blob( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureV2BlobIsMutable(); + v2Blob_.add(value); + onChanged(); + return this; + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public Builder addAllV2Blob( + java.lang.Iterable values) { + ensureV2BlobIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, v2Blob_); + onChanged(); + return this; + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public Builder clearV2Blob() { + v2Blob_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * The ordered list of v2 blobs that represent a given image.
+     * 
+ * + * repeated string v2_blob = 2; + */ + public Builder addV2BlobBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureV2BlobIsMutable(); + v2Blob_.add(value); + onChanged(); + return this; + } + + private java.lang.Object v2Name_ = ""; + /** + *
+     * Output only. The name of the image's v2 blobs computed via:
+     *   [bottom] := v2_blob[bottom]
+     *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+     * Only the name of the final blob is kept.
+     * 
+ * + * string v2_name = 3; + */ + public java.lang.String getV2Name() { + java.lang.Object ref = v2Name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + v2Name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The name of the image's v2 blobs computed via:
+     *   [bottom] := v2_blob[bottom]
+     *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+     * Only the name of the final blob is kept.
+     * 
+ * + * string v2_name = 3; + */ + public com.google.protobuf.ByteString + getV2NameBytes() { + java.lang.Object ref = v2Name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + v2Name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The name of the image's v2 blobs computed via:
+     *   [bottom] := v2_blob[bottom]
+     *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+     * Only the name of the final blob is kept.
+     * 
+ * + * string v2_name = 3; + */ + public Builder setV2Name( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + v2Name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the image's v2 blobs computed via:
+     *   [bottom] := v2_blob[bottom]
+     *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+     * Only the name of the final blob is kept.
+     * 
+ * + * string v2_name = 3; + */ + public Builder clearV2Name() { + + v2Name_ = getDefaultInstance().getV2Name(); + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the image's v2 blobs computed via:
+     *   [bottom] := v2_blob[bottom]
+     *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+     * Only the name of the final blob is kept.
+     * 
+ * + * string v2_name = 3; + */ + public Builder setV2NameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + v2Name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.image.Fingerprint) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.image.Fingerprint) + private static final io.grafeas.v1beta1.image.Fingerprint DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.image.Fingerprint(); + } + + public static io.grafeas.v1beta1.image.Fingerprint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Fingerprint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Fingerprint(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Fingerprint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/FingerprintOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/FingerprintOrBuilder.java new file mode 100644 index 000000000000..6a581eb1cfb4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/FingerprintOrBuilder.java @@ -0,0 +1,86 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public interface FingerprintOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.image.Fingerprint) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The layer-id of the final layer in the Docker image's v1 representation.
+   * 
+ * + * string v1_name = 1; + */ + java.lang.String getV1Name(); + /** + *
+   * The layer-id of the final layer in the Docker image's v1 representation.
+   * 
+ * + * string v1_name = 1; + */ + com.google.protobuf.ByteString + getV1NameBytes(); + + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + java.util.List + getV2BlobList(); + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + int getV2BlobCount(); + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + java.lang.String getV2Blob(int index); + /** + *
+   * The ordered list of v2 blobs that represent a given image.
+   * 
+ * + * repeated string v2_blob = 2; + */ + com.google.protobuf.ByteString + getV2BlobBytes(int index); + + /** + *
+   * Output only. The name of the image's v2 blobs computed via:
+   *   [bottom] := v2_blob[bottom]
+   *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+   * Only the name of the final blob is kept.
+   * 
+ * + * string v2_name = 3; + */ + java.lang.String getV2Name(); + /** + *
+   * Output only. The name of the image's v2 blobs computed via:
+   *   [bottom] := v2_blob[bottom]
+   *   [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
+   * Only the name of the final blob is kept.
+   * 
+ * + * string v2_name = 3; + */ + com.google.protobuf.ByteString + getV2NameBytes(); +} 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 new file mode 100644 index 000000000000..b7c22e9d4fa0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Image.java @@ -0,0 +1,121 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public final class Image { + private Image() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_image_Layer_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_image_Layer_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_image_Fingerprint_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_image_Fingerprint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_image_Basis_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_image_Basis_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_image_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_image_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_image_Derived_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_image_Derived_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n;google/devtools/containeranalysis/v1be" + + "ta1/image/image.proto\022\025grafeas.v1beta1.i" + + "mage\"\310\002\n\005Layer\0229\n\tdirective\030\001 \001(\0162&.graf" + + "eas.v1beta1.image.Layer.Directive\022\021\n\targ" + + "uments\030\002 \001(\t\"\360\001\n\tDirective\022\031\n\025DIRECTIVE_" + + "UNSPECIFIED\020\000\022\016\n\nMAINTAINER\020\001\022\007\n\003RUN\020\002\022\007" + + "\n\003CMD\020\003\022\t\n\005LABEL\020\004\022\n\n\006EXPOSE\020\005\022\007\n\003ENV\020\006\022" + + "\007\n\003ADD\020\007\022\010\n\004COPY\020\010\022\016\n\nENTRYPOINT\020\t\022\n\n\006VO" + + "LUME\020\n\022\010\n\004USER\020\013\022\013\n\007WORKDIR\020\014\022\007\n\003ARG\020\r\022\013" + + "\n\007ONBUILD\020\016\022\016\n\nSTOPSIGNAL\020\017\022\017\n\013HEALTHCHE" + + "CK\020\020\022\t\n\005SHELL\020\021\"@\n\013Fingerprint\022\017\n\007v1_nam" + + "e\030\001 \001(\t\022\017\n\007v2_blob\030\002 \003(\t\022\017\n\007v2_name\030\003 \001(" + + "\t\"V\n\005Basis\022\024\n\014resource_url\030\001 \001(\t\0227\n\013fing" + + "erprint\030\002 \001(\0132\".grafeas.v1beta1.image.Fi" + + "ngerprint\"@\n\007Details\0225\n\rderived_image\030\001 " + + "\001(\0132\036.grafeas.v1beta1.image.Derived\"\241\001\n\007" + + "Derived\0227\n\013fingerprint\030\001 \001(\0132\".grafeas.v" + + "1beta1.image.Fingerprint\022\020\n\010distance\030\002 \001" + + "(\005\0220\n\nlayer_info\030\003 \003(\0132\034.grafeas.v1beta1" + + ".image.Layer\022\031\n\021base_resource_url\030\004 \001(\tB" + + "x\n\030io.grafeas.v1beta1.imageP\001ZTgoogle.go" + + "lang.org/genproto/googleapis/devtools/co" + + "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); + internal_static_grafeas_v1beta1_image_Layer_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_image_Layer_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_image_Layer_descriptor, + new java.lang.String[] { "Directive", "Arguments", }); + internal_static_grafeas_v1beta1_image_Fingerprint_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_image_Fingerprint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_image_Fingerprint_descriptor, + new java.lang.String[] { "V1Name", "V2Blob", "V2Name", }); + internal_static_grafeas_v1beta1_image_Basis_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_image_Basis_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_image_Basis_descriptor, + new java.lang.String[] { "ResourceUrl", "Fingerprint", }); + internal_static_grafeas_v1beta1_image_Details_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_image_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_image_Details_descriptor, + new java.lang.String[] { "DerivedImage", }); + internal_static_grafeas_v1beta1_image_Derived_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1beta1_image_Derived_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_image_Derived_descriptor, + new java.lang.String[] { "Fingerprint", "Distance", "LayerInfo", "BaseResourceUrl", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..f1855924a867 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/Layer.java @@ -0,0 +1,1080 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +/** + *
+ * Layer holds metadata specific to a layer of a Docker image.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Layer} + */ +public final class Layer extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.image.Layer) + LayerOrBuilder { +private static final long serialVersionUID = 0L; + // Use Layer.newBuilder() to construct. + private Layer(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Layer() { + directive_ = 0; + arguments_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Layer( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + directive_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + arguments_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Layer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Layer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Layer.class, io.grafeas.v1beta1.image.Layer.Builder.class); + } + + /** + *
+   * Instructions from Dockerfile.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.image.Layer.Directive} + */ + public enum Directive + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Default value for unsupported/missing directive.
+     * 
+ * + * DIRECTIVE_UNSPECIFIED = 0; + */ + DIRECTIVE_UNSPECIFIED(0), + /** + *
+     * https://docs.docker.com/reference/builder/#maintainer
+     * 
+ * + * MAINTAINER = 1; + */ + MAINTAINER(1), + /** + *
+     * https://docs.docker.com/reference/builder/#run
+     * 
+ * + * RUN = 2; + */ + RUN(2), + /** + *
+     * https://docs.docker.com/reference/builder/#cmd
+     * 
+ * + * CMD = 3; + */ + CMD(3), + /** + *
+     * https://docs.docker.com/reference/builder/#label
+     * 
+ * + * LABEL = 4; + */ + LABEL(4), + /** + *
+     * https://docs.docker.com/reference/builder/#expose
+     * 
+ * + * EXPOSE = 5; + */ + EXPOSE(5), + /** + *
+     * https://docs.docker.com/reference/builder/#env
+     * 
+ * + * ENV = 6; + */ + ENV(6), + /** + *
+     * https://docs.docker.com/reference/builder/#add
+     * 
+ * + * ADD = 7; + */ + ADD(7), + /** + *
+     * https://docs.docker.com/reference/builder/#copy
+     * 
+ * + * COPY = 8; + */ + COPY(8), + /** + *
+     * https://docs.docker.com/reference/builder/#entrypoint
+     * 
+ * + * ENTRYPOINT = 9; + */ + ENTRYPOINT(9), + /** + *
+     * https://docs.docker.com/reference/builder/#volume
+     * 
+ * + * VOLUME = 10; + */ + VOLUME(10), + /** + *
+     * https://docs.docker.com/reference/builder/#user
+     * 
+ * + * USER = 11; + */ + USER(11), + /** + *
+     * https://docs.docker.com/reference/builder/#workdir
+     * 
+ * + * WORKDIR = 12; + */ + WORKDIR(12), + /** + *
+     * https://docs.docker.com/reference/builder/#arg
+     * 
+ * + * ARG = 13; + */ + ARG(13), + /** + *
+     * https://docs.docker.com/reference/builder/#onbuild
+     * 
+ * + * ONBUILD = 14; + */ + ONBUILD(14), + /** + *
+     * https://docs.docker.com/reference/builder/#stopsignal
+     * 
+ * + * STOPSIGNAL = 15; + */ + STOPSIGNAL(15), + /** + *
+     * https://docs.docker.com/reference/builder/#healthcheck
+     * 
+ * + * HEALTHCHECK = 16; + */ + HEALTHCHECK(16), + /** + *
+     * https://docs.docker.com/reference/builder/#shell
+     * 
+ * + * SHELL = 17; + */ + SHELL(17), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Default value for unsupported/missing directive.
+     * 
+ * + * DIRECTIVE_UNSPECIFIED = 0; + */ + public static final int DIRECTIVE_UNSPECIFIED_VALUE = 0; + /** + *
+     * https://docs.docker.com/reference/builder/#maintainer
+     * 
+ * + * MAINTAINER = 1; + */ + public static final int MAINTAINER_VALUE = 1; + /** + *
+     * https://docs.docker.com/reference/builder/#run
+     * 
+ * + * RUN = 2; + */ + public static final int RUN_VALUE = 2; + /** + *
+     * https://docs.docker.com/reference/builder/#cmd
+     * 
+ * + * CMD = 3; + */ + public static final int CMD_VALUE = 3; + /** + *
+     * https://docs.docker.com/reference/builder/#label
+     * 
+ * + * LABEL = 4; + */ + public static final int LABEL_VALUE = 4; + /** + *
+     * https://docs.docker.com/reference/builder/#expose
+     * 
+ * + * EXPOSE = 5; + */ + public static final int EXPOSE_VALUE = 5; + /** + *
+     * https://docs.docker.com/reference/builder/#env
+     * 
+ * + * ENV = 6; + */ + public static final int ENV_VALUE = 6; + /** + *
+     * https://docs.docker.com/reference/builder/#add
+     * 
+ * + * ADD = 7; + */ + public static final int ADD_VALUE = 7; + /** + *
+     * https://docs.docker.com/reference/builder/#copy
+     * 
+ * + * COPY = 8; + */ + public static final int COPY_VALUE = 8; + /** + *
+     * https://docs.docker.com/reference/builder/#entrypoint
+     * 
+ * + * ENTRYPOINT = 9; + */ + public static final int ENTRYPOINT_VALUE = 9; + /** + *
+     * https://docs.docker.com/reference/builder/#volume
+     * 
+ * + * VOLUME = 10; + */ + public static final int VOLUME_VALUE = 10; + /** + *
+     * https://docs.docker.com/reference/builder/#user
+     * 
+ * + * USER = 11; + */ + public static final int USER_VALUE = 11; + /** + *
+     * https://docs.docker.com/reference/builder/#workdir
+     * 
+ * + * WORKDIR = 12; + */ + public static final int WORKDIR_VALUE = 12; + /** + *
+     * https://docs.docker.com/reference/builder/#arg
+     * 
+ * + * ARG = 13; + */ + public static final int ARG_VALUE = 13; + /** + *
+     * https://docs.docker.com/reference/builder/#onbuild
+     * 
+ * + * ONBUILD = 14; + */ + public static final int ONBUILD_VALUE = 14; + /** + *
+     * https://docs.docker.com/reference/builder/#stopsignal
+     * 
+ * + * STOPSIGNAL = 15; + */ + public static final int STOPSIGNAL_VALUE = 15; + /** + *
+     * https://docs.docker.com/reference/builder/#healthcheck
+     * 
+ * + * HEALTHCHECK = 16; + */ + public static final int HEALTHCHECK_VALUE = 16; + /** + *
+     * https://docs.docker.com/reference/builder/#shell
+     * 
+ * + * SHELL = 17; + */ + public static final int SHELL_VALUE = 17; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Directive valueOf(int value) { + return forNumber(value); + } + + public static Directive forNumber(int value) { + switch (value) { + case 0: return DIRECTIVE_UNSPECIFIED; + case 1: return MAINTAINER; + case 2: return RUN; + case 3: return CMD; + case 4: return LABEL; + case 5: return EXPOSE; + case 6: return ENV; + case 7: return ADD; + case 8: return COPY; + case 9: return ENTRYPOINT; + case 10: return VOLUME; + case 11: return USER; + case 12: return WORKDIR; + case 13: return ARG; + case 14: return ONBUILD; + case 15: return STOPSIGNAL; + case 16: return HEALTHCHECK; + case 17: return SHELL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Directive> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Directive findValueByNumber(int number) { + return Directive.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Layer.getDescriptor().getEnumTypes().get(0); + } + + private static final Directive[] VALUES = values(); + + public static Directive valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Directive(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.image.Layer.Directive) + } + + public static final int DIRECTIVE_FIELD_NUMBER = 1; + private int directive_; + /** + *
+   * The recovered Dockerfile directive used to construct this layer.
+   * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public int getDirectiveValue() { + return directive_; + } + /** + *
+   * The recovered Dockerfile directive used to construct this layer.
+   * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public io.grafeas.v1beta1.image.Layer.Directive getDirective() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.image.Layer.Directive result = io.grafeas.v1beta1.image.Layer.Directive.valueOf(directive_); + return result == null ? io.grafeas.v1beta1.image.Layer.Directive.UNRECOGNIZED : result; + } + + public static final int ARGUMENTS_FIELD_NUMBER = 2; + private volatile java.lang.Object arguments_; + /** + *
+   * The recovered arguments to the Dockerfile directive.
+   * 
+ * + * string arguments = 2; + */ + public java.lang.String getArguments() { + java.lang.Object ref = arguments_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + arguments_ = s; + return s; + } + } + /** + *
+   * The recovered arguments to the Dockerfile directive.
+   * 
+ * + * string arguments = 2; + */ + public com.google.protobuf.ByteString + getArgumentsBytes() { + java.lang.Object ref = arguments_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + arguments_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (directive_ != io.grafeas.v1beta1.image.Layer.Directive.DIRECTIVE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, directive_); + } + if (!getArgumentsBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, arguments_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (directive_ != io.grafeas.v1beta1.image.Layer.Directive.DIRECTIVE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, directive_); + } + if (!getArgumentsBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, arguments_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.image.Layer)) { + return super.equals(obj); + } + io.grafeas.v1beta1.image.Layer other = (io.grafeas.v1beta1.image.Layer) obj; + + boolean result = true; + result = result && directive_ == other.directive_; + result = result && getArguments() + .equals(other.getArguments()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DIRECTIVE_FIELD_NUMBER; + hash = (53 * hash) + directive_; + hash = (37 * hash) + ARGUMENTS_FIELD_NUMBER; + hash = (53 * hash) + getArguments().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.image.Layer parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Layer parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Layer parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Layer parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Layer parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.image.Layer parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.image.Layer prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Layer holds metadata specific to a layer of a Docker image.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.image.Layer} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.image.Layer) + io.grafeas.v1beta1.image.LayerOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Layer_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Layer_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.image.Layer.class, io.grafeas.v1beta1.image.Layer.Builder.class); + } + + // Construct using io.grafeas.v1beta1.image.Layer.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + directive_ = 0; + + arguments_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.image.Image.internal_static_grafeas_v1beta1_image_Layer_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Layer getDefaultInstanceForType() { + return io.grafeas.v1beta1.image.Layer.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Layer build() { + io.grafeas.v1beta1.image.Layer result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Layer buildPartial() { + io.grafeas.v1beta1.image.Layer result = new io.grafeas.v1beta1.image.Layer(this); + result.directive_ = directive_; + result.arguments_ = arguments_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.image.Layer) { + return mergeFrom((io.grafeas.v1beta1.image.Layer)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.image.Layer other) { + if (other == io.grafeas.v1beta1.image.Layer.getDefaultInstance()) return this; + if (other.directive_ != 0) { + setDirectiveValue(other.getDirectiveValue()); + } + if (!other.getArguments().isEmpty()) { + arguments_ = other.arguments_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.image.Layer parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.image.Layer) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int directive_ = 0; + /** + *
+     * The recovered Dockerfile directive used to construct this layer.
+     * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public int getDirectiveValue() { + return directive_; + } + /** + *
+     * The recovered Dockerfile directive used to construct this layer.
+     * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public Builder setDirectiveValue(int value) { + directive_ = value; + onChanged(); + return this; + } + /** + *
+     * The recovered Dockerfile directive used to construct this layer.
+     * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public io.grafeas.v1beta1.image.Layer.Directive getDirective() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.image.Layer.Directive result = io.grafeas.v1beta1.image.Layer.Directive.valueOf(directive_); + return result == null ? io.grafeas.v1beta1.image.Layer.Directive.UNRECOGNIZED : result; + } + /** + *
+     * The recovered Dockerfile directive used to construct this layer.
+     * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public Builder setDirective(io.grafeas.v1beta1.image.Layer.Directive value) { + if (value == null) { + throw new NullPointerException(); + } + + directive_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The recovered Dockerfile directive used to construct this layer.
+     * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + public Builder clearDirective() { + + directive_ = 0; + onChanged(); + return this; + } + + private java.lang.Object arguments_ = ""; + /** + *
+     * The recovered arguments to the Dockerfile directive.
+     * 
+ * + * string arguments = 2; + */ + public java.lang.String getArguments() { + java.lang.Object ref = arguments_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + arguments_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The recovered arguments to the Dockerfile directive.
+     * 
+ * + * string arguments = 2; + */ + public com.google.protobuf.ByteString + getArgumentsBytes() { + java.lang.Object ref = arguments_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + arguments_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The recovered arguments to the Dockerfile directive.
+     * 
+ * + * string arguments = 2; + */ + public Builder setArguments( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + arguments_ = value; + onChanged(); + return this; + } + /** + *
+     * The recovered arguments to the Dockerfile directive.
+     * 
+ * + * string arguments = 2; + */ + public Builder clearArguments() { + + arguments_ = getDefaultInstance().getArguments(); + onChanged(); + return this; + } + /** + *
+     * The recovered arguments to the Dockerfile directive.
+     * 
+ * + * string arguments = 2; + */ + public Builder setArgumentsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + arguments_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.image.Layer) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.image.Layer) + private static final io.grafeas.v1beta1.image.Layer DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.image.Layer(); + } + + public static io.grafeas.v1beta1.image.Layer getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Layer parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Layer(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.image.Layer getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/LayerOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/LayerOrBuilder.java new file mode 100644 index 000000000000..c127b8282478 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/LayerOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/image/image.proto + +package io.grafeas.v1beta1.image; + +public interface LayerOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.image.Layer) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The recovered Dockerfile directive used to construct this layer.
+   * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + int getDirectiveValue(); + /** + *
+   * The recovered Dockerfile directive used to construct this layer.
+   * 
+ * + * .grafeas.v1beta1.image.Layer.Directive directive = 1; + */ + io.grafeas.v1beta1.image.Layer.Directive getDirective(); + + /** + *
+   * The recovered arguments to the Dockerfile directive.
+   * 
+ * + * string arguments = 2; + */ + java.lang.String getArguments(); + /** + *
+   * The recovered arguments to the Dockerfile directive.
+   * 
+ * + * string arguments = 2; + */ + com.google.protobuf.ByteString + getArgumentsBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/NoteName.java new file mode 100644 index 000000000000..a476c4ab8455 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.image; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/image/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/OccurrenceName.java new file mode 100644 index 000000000000..d1f0ffec2a59 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.image; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/image/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/ProjectName.java new file mode 100644 index 000000000000..b0a3a7fda194 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.image; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/image/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/ScanConfigName.java new file mode 100644 index 000000000000..28a266980869 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/image/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.image; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Architecture.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Architecture.java new file mode 100644 index 000000000000..a3979bf3063a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Architecture.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * Instruction set architectures supported by various package managers.
+ * 
+ * + * Protobuf enum {@code grafeas.v1beta1.package.Architecture} + */ +public enum Architecture + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unknown architecture.
+   * 
+ * + * ARCHITECTURE_UNSPECIFIED = 0; + */ + ARCHITECTURE_UNSPECIFIED(0), + /** + *
+   * X86 architecture.
+   * 
+ * + * X86 = 1; + */ + X86(1), + /** + *
+   * X64 architecture.
+   * 
+ * + * X64 = 2; + */ + X64(2), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unknown architecture.
+   * 
+ * + * ARCHITECTURE_UNSPECIFIED = 0; + */ + public static final int ARCHITECTURE_UNSPECIFIED_VALUE = 0; + /** + *
+   * X86 architecture.
+   * 
+ * + * X86 = 1; + */ + public static final int X86_VALUE = 1; + /** + *
+   * X64 architecture.
+   * 
+ * + * X64 = 2; + */ + public static final int X64_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Architecture valueOf(int value) { + return forNumber(value); + } + + public static Architecture forNumber(int value) { + switch (value) { + case 0: return ARCHITECTURE_UNSPECIFIED; + case 1: return X86; + case 2: return X64; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Architecture> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Architecture findValueByNumber(int number) { + return Architecture.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Architecture[] VALUES = values(); + + public static Architecture valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Architecture(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.package.Architecture) +} + 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 new file mode 100644 index 000000000000..7b0c28326c4f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Details.java @@ -0,0 +1,651 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * Details of a package occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.pkg.Installation.Builder subBuilder = null; + if (installation_ != null) { + subBuilder = installation_.toBuilder(); + } + installation_ = input.readMessage(io.grafeas.v1beta1.pkg.Installation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(installation_); + installation_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Details.class, io.grafeas.v1beta1.pkg.Details.Builder.class); + } + + public static final int INSTALLATION_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.pkg.Installation installation_; + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public boolean hasInstallation() { + return installation_ != null; + } + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public io.grafeas.v1beta1.pkg.Installation getInstallation() { + return installation_ == null ? io.grafeas.v1beta1.pkg.Installation.getDefaultInstance() : installation_; + } + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public io.grafeas.v1beta1.pkg.InstallationOrBuilder getInstallationOrBuilder() { + return getInstallation(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (installation_ != null) { + output.writeMessage(1, getInstallation()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (installation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getInstallation()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Details other = (io.grafeas.v1beta1.pkg.Details) obj; + + boolean result = true; + result = result && (hasInstallation() == other.hasInstallation()); + if (hasInstallation()) { + result = result && getInstallation() + .equals(other.getInstallation()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasInstallation()) { + hash = (37 * hash) + INSTALLATION_FIELD_NUMBER; + hash = (53 * hash) + getInstallation().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of a package occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Details) + io.grafeas.v1beta1.pkg.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Details.class, io.grafeas.v1beta1.pkg.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (installationBuilder_ == null) { + installation_ = null; + } else { + installation_ = null; + installationBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Details build() { + io.grafeas.v1beta1.pkg.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Details buildPartial() { + io.grafeas.v1beta1.pkg.Details result = new io.grafeas.v1beta1.pkg.Details(this); + if (installationBuilder_ == null) { + result.installation_ = installation_; + } else { + result.installation_ = installationBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Details) { + return mergeFrom((io.grafeas.v1beta1.pkg.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Details other) { + if (other == io.grafeas.v1beta1.pkg.Details.getDefaultInstance()) return this; + if (other.hasInstallation()) { + mergeInstallation(other.getInstallation()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.pkg.Installation installation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Installation, io.grafeas.v1beta1.pkg.Installation.Builder, io.grafeas.v1beta1.pkg.InstallationOrBuilder> installationBuilder_; + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public boolean hasInstallation() { + return installationBuilder_ != null || installation_ != null; + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public io.grafeas.v1beta1.pkg.Installation getInstallation() { + if (installationBuilder_ == null) { + return installation_ == null ? io.grafeas.v1beta1.pkg.Installation.getDefaultInstance() : installation_; + } else { + return installationBuilder_.getMessage(); + } + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public Builder setInstallation(io.grafeas.v1beta1.pkg.Installation value) { + if (installationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + installation_ = value; + onChanged(); + } else { + installationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public Builder setInstallation( + io.grafeas.v1beta1.pkg.Installation.Builder builderForValue) { + if (installationBuilder_ == null) { + installation_ = builderForValue.build(); + onChanged(); + } else { + installationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public Builder mergeInstallation(io.grafeas.v1beta1.pkg.Installation value) { + if (installationBuilder_ == null) { + if (installation_ != null) { + installation_ = + io.grafeas.v1beta1.pkg.Installation.newBuilder(installation_).mergeFrom(value).buildPartial(); + } else { + installation_ = value; + } + onChanged(); + } else { + installationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public Builder clearInstallation() { + if (installationBuilder_ == null) { + installation_ = null; + onChanged(); + } else { + installation_ = null; + installationBuilder_ = null; + } + + return this; + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public io.grafeas.v1beta1.pkg.Installation.Builder getInstallationBuilder() { + + onChanged(); + return getInstallationFieldBuilder().getBuilder(); + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + public io.grafeas.v1beta1.pkg.InstallationOrBuilder getInstallationOrBuilder() { + if (installationBuilder_ != null) { + return installationBuilder_.getMessageOrBuilder(); + } else { + return installation_ == null ? + io.grafeas.v1beta1.pkg.Installation.getDefaultInstance() : installation_; + } + } + /** + *
+     * Where the package was installed.
+     * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Installation, io.grafeas.v1beta1.pkg.Installation.Builder, io.grafeas.v1beta1.pkg.InstallationOrBuilder> + getInstallationFieldBuilder() { + if (installationBuilder_ == null) { + installationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Installation, io.grafeas.v1beta1.pkg.Installation.Builder, io.grafeas.v1beta1.pkg.InstallationOrBuilder>( + getInstallation(), + getParentForChildren(), + isClean()); + installation_ = null; + } + return installationBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Details) + private static final io.grafeas.v1beta1.pkg.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Details(); + } + + public static io.grafeas.v1beta1.pkg.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DetailsOrBuilder.java new file mode 100644 index 000000000000..2d5bca7bb1a1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DetailsOrBuilder.java @@ -0,0 +1,34 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + boolean hasInstallation(); + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + io.grafeas.v1beta1.pkg.Installation getInstallation(); + /** + *
+   * Where the package was installed.
+   * 
+ * + * .grafeas.v1beta1.package.Installation installation = 1; + */ + io.grafeas.v1beta1.pkg.InstallationOrBuilder getInstallationOrBuilder(); +} 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 new file mode 100644 index 000000000000..dcb36031b52e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Distribution.java @@ -0,0 +1,1412 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * This represents a particular channel of distribution for a given package.
+ * E.g., Debian's jessie-backports dpkg mirror.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Distribution} + */ +public final class Distribution extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Distribution) + DistributionOrBuilder { +private static final long serialVersionUID = 0L; + // Use Distribution.newBuilder() to construct. + private Distribution(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Distribution() { + cpeUri_ = ""; + architecture_ = 0; + maintainer_ = ""; + url_ = ""; + description_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Distribution( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + cpeUri_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + architecture_ = rawValue; + break; + } + case 26: { + io.grafeas.v1beta1.pkg.Version.Builder subBuilder = null; + if (latestVersion_ != null) { + subBuilder = latestVersion_.toBuilder(); + } + latestVersion_ = input.readMessage(io.grafeas.v1beta1.pkg.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latestVersion_); + latestVersion_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + maintainer_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Distribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Distribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Distribution.class, io.grafeas.v1beta1.pkg.Distribution.Builder.class); + } + + public static final int CPE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object cpeUri_; + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } + } + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ARCHITECTURE_FIELD_NUMBER = 2; + private int architecture_; + /** + *
+   * The CPU architecture for which packages in this distribution channel were
+   * built.
+   * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public int getArchitectureValue() { + return architecture_; + } + /** + *
+   * The CPU architecture for which packages in this distribution channel were
+   * built.
+   * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public io.grafeas.v1beta1.pkg.Architecture getArchitecture() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.pkg.Architecture result = io.grafeas.v1beta1.pkg.Architecture.valueOf(architecture_); + return result == null ? io.grafeas.v1beta1.pkg.Architecture.UNRECOGNIZED : result; + } + + public static final int LATEST_VERSION_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.pkg.Version latestVersion_; + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public boolean hasLatestVersion() { + return latestVersion_ != null; + } + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getLatestVersion() { + return latestVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : latestVersion_; + } + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getLatestVersionOrBuilder() { + return getLatestVersion(); + } + + public static final int MAINTAINER_FIELD_NUMBER = 4; + private volatile java.lang.Object maintainer_; + /** + *
+   * A freeform string denoting the maintainer of this package.
+   * 
+ * + * string maintainer = 4; + */ + public java.lang.String getMaintainer() { + java.lang.Object ref = maintainer_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintainer_ = s; + return s; + } + } + /** + *
+   * A freeform string denoting the maintainer of this package.
+   * 
+ * + * string maintainer = 4; + */ + public com.google.protobuf.ByteString + getMaintainerBytes() { + java.lang.Object ref = maintainer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maintainer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 5; + private volatile java.lang.Object url_; + /** + *
+   * The distribution channel-specific homepage for this package.
+   * 
+ * + * string url = 5; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + *
+   * The distribution channel-specific homepage for this package.
+   * 
+ * + * string url = 5; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object description_; + /** + *
+   * The distribution channel-specific description of this package.
+   * 
+ * + * string description = 6; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * The distribution channel-specific description of this package.
+   * 
+ * + * string description = 6; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCpeUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_); + } + if (architecture_ != io.grafeas.v1beta1.pkg.Architecture.ARCHITECTURE_UNSPECIFIED.getNumber()) { + output.writeEnum(2, architecture_); + } + if (latestVersion_ != null) { + output.writeMessage(3, getLatestVersion()); + } + if (!getMaintainerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, maintainer_); + } + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, url_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCpeUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_); + } + if (architecture_ != io.grafeas.v1beta1.pkg.Architecture.ARCHITECTURE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, architecture_); + } + if (latestVersion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getLatestVersion()); + } + if (!getMaintainerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, maintainer_); + } + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, url_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Distribution)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Distribution other = (io.grafeas.v1beta1.pkg.Distribution) obj; + + boolean result = true; + result = result && getCpeUri() + .equals(other.getCpeUri()); + result = result && architecture_ == other.architecture_; + result = result && (hasLatestVersion() == other.hasLatestVersion()); + if (hasLatestVersion()) { + result = result && getLatestVersion() + .equals(other.getLatestVersion()); + } + result = result && getMaintainer() + .equals(other.getMaintainer()); + result = result && getUrl() + .equals(other.getUrl()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCpeUri().hashCode(); + hash = (37 * hash) + ARCHITECTURE_FIELD_NUMBER; + hash = (53 * hash) + architecture_; + if (hasLatestVersion()) { + hash = (37 * hash) + LATEST_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getLatestVersion().hashCode(); + } + hash = (37 * hash) + MAINTAINER_FIELD_NUMBER; + hash = (53 * hash) + getMaintainer().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Distribution parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Distribution parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Distribution parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Distribution prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * This represents a particular channel of distribution for a given package.
+   * E.g., Debian's jessie-backports dpkg mirror.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Distribution} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Distribution) + io.grafeas.v1beta1.pkg.DistributionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Distribution_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Distribution_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Distribution.class, io.grafeas.v1beta1.pkg.Distribution.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Distribution.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cpeUri_ = ""; + + architecture_ = 0; + + if (latestVersionBuilder_ == null) { + latestVersion_ = null; + } else { + latestVersion_ = null; + latestVersionBuilder_ = null; + } + maintainer_ = ""; + + url_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Distribution_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Distribution getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Distribution.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Distribution build() { + io.grafeas.v1beta1.pkg.Distribution result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Distribution buildPartial() { + io.grafeas.v1beta1.pkg.Distribution result = new io.grafeas.v1beta1.pkg.Distribution(this); + result.cpeUri_ = cpeUri_; + result.architecture_ = architecture_; + if (latestVersionBuilder_ == null) { + result.latestVersion_ = latestVersion_; + } else { + result.latestVersion_ = latestVersionBuilder_.build(); + } + result.maintainer_ = maintainer_; + result.url_ = url_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Distribution) { + return mergeFrom((io.grafeas.v1beta1.pkg.Distribution)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Distribution other) { + if (other == io.grafeas.v1beta1.pkg.Distribution.getDefaultInstance()) return this; + if (!other.getCpeUri().isEmpty()) { + cpeUri_ = other.cpeUri_; + onChanged(); + } + if (other.architecture_ != 0) { + setArchitectureValue(other.getArchitectureValue()); + } + if (other.hasLatestVersion()) { + mergeLatestVersion(other.getLatestVersion()); + } + if (!other.getMaintainer().isEmpty()) { + maintainer_ = other.maintainer_; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Distribution parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Distribution) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cpeUri_ = ""; + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cpeUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder clearCpeUri() { + + cpeUri_ = getDefaultInstance().getCpeUri(); + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cpeUri_ = value; + onChanged(); + return this; + } + + private int architecture_ = 0; + /** + *
+     * The CPU architecture for which packages in this distribution channel were
+     * built.
+     * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public int getArchitectureValue() { + return architecture_; + } + /** + *
+     * The CPU architecture for which packages in this distribution channel were
+     * built.
+     * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public Builder setArchitectureValue(int value) { + architecture_ = value; + onChanged(); + return this; + } + /** + *
+     * The CPU architecture for which packages in this distribution channel were
+     * built.
+     * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public io.grafeas.v1beta1.pkg.Architecture getArchitecture() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.pkg.Architecture result = io.grafeas.v1beta1.pkg.Architecture.valueOf(architecture_); + return result == null ? io.grafeas.v1beta1.pkg.Architecture.UNRECOGNIZED : result; + } + /** + *
+     * The CPU architecture for which packages in this distribution channel were
+     * built.
+     * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public Builder setArchitecture(io.grafeas.v1beta1.pkg.Architecture value) { + if (value == null) { + throw new NullPointerException(); + } + + architecture_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The CPU architecture for which packages in this distribution channel were
+     * built.
+     * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + public Builder clearArchitecture() { + + architecture_ = 0; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.pkg.Version latestVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> latestVersionBuilder_; + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public boolean hasLatestVersion() { + return latestVersionBuilder_ != null || latestVersion_ != null; + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getLatestVersion() { + if (latestVersionBuilder_ == null) { + return latestVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : latestVersion_; + } else { + return latestVersionBuilder_.getMessage(); + } + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public Builder setLatestVersion(io.grafeas.v1beta1.pkg.Version value) { + if (latestVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latestVersion_ = value; + onChanged(); + } else { + latestVersionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public Builder setLatestVersion( + io.grafeas.v1beta1.pkg.Version.Builder builderForValue) { + if (latestVersionBuilder_ == null) { + latestVersion_ = builderForValue.build(); + onChanged(); + } else { + latestVersionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public Builder mergeLatestVersion(io.grafeas.v1beta1.pkg.Version value) { + if (latestVersionBuilder_ == null) { + if (latestVersion_ != null) { + latestVersion_ = + io.grafeas.v1beta1.pkg.Version.newBuilder(latestVersion_).mergeFrom(value).buildPartial(); + } else { + latestVersion_ = value; + } + onChanged(); + } else { + latestVersionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public Builder clearLatestVersion() { + if (latestVersionBuilder_ == null) { + latestVersion_ = null; + onChanged(); + } else { + latestVersion_ = null; + latestVersionBuilder_ = null; + } + + return this; + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version.Builder getLatestVersionBuilder() { + + onChanged(); + return getLatestVersionFieldBuilder().getBuilder(); + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getLatestVersionOrBuilder() { + if (latestVersionBuilder_ != null) { + return latestVersionBuilder_.getMessageOrBuilder(); + } else { + return latestVersion_ == null ? + io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : latestVersion_; + } + } + /** + *
+     * The latest available version of this package in this distribution
+     * channel.
+     * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> + getLatestVersionFieldBuilder() { + if (latestVersionBuilder_ == null) { + latestVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder>( + getLatestVersion(), + getParentForChildren(), + isClean()); + latestVersion_ = null; + } + return latestVersionBuilder_; + } + + private java.lang.Object maintainer_ = ""; + /** + *
+     * A freeform string denoting the maintainer of this package.
+     * 
+ * + * string maintainer = 4; + */ + public java.lang.String getMaintainer() { + java.lang.Object ref = maintainer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + maintainer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A freeform string denoting the maintainer of this package.
+     * 
+ * + * string maintainer = 4; + */ + public com.google.protobuf.ByteString + getMaintainerBytes() { + java.lang.Object ref = maintainer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + maintainer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A freeform string denoting the maintainer of this package.
+     * 
+ * + * string maintainer = 4; + */ + public Builder setMaintainer( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + maintainer_ = value; + onChanged(); + return this; + } + /** + *
+     * A freeform string denoting the maintainer of this package.
+     * 
+ * + * string maintainer = 4; + */ + public Builder clearMaintainer() { + + maintainer_ = getDefaultInstance().getMaintainer(); + onChanged(); + return this; + } + /** + *
+     * A freeform string denoting the maintainer of this package.
+     * 
+ * + * string maintainer = 4; + */ + public Builder setMaintainerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + maintainer_ = value; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+     * The distribution channel-specific homepage for this package.
+     * 
+ * + * string url = 5; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The distribution channel-specific homepage for this package.
+     * 
+ * + * string url = 5; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The distribution channel-specific homepage for this package.
+     * 
+ * + * string url = 5; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+     * The distribution channel-specific homepage for this package.
+     * 
+ * + * string url = 5; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+     * The distribution channel-specific homepage for this package.
+     * 
+ * + * string url = 5; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * The distribution channel-specific description of this package.
+     * 
+ * + * string description = 6; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The distribution channel-specific description of this package.
+     * 
+ * + * string description = 6; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The distribution channel-specific description of this package.
+     * 
+ * + * string description = 6; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * The distribution channel-specific description of this package.
+     * 
+ * + * string description = 6; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * The distribution channel-specific description of this package.
+     * 
+ * + * string description = 6; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Distribution) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Distribution) + private static final io.grafeas.v1beta1.pkg.Distribution DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Distribution(); + } + + public static io.grafeas.v1beta1.pkg.Distribution getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Distribution parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Distribution(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Distribution getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DistributionOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DistributionOrBuilder.java new file mode 100644 index 000000000000..448169c0b1c7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/DistributionOrBuilder.java @@ -0,0 +1,130 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface DistributionOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Distribution) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + java.lang.String getCpeUri(); + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + com.google.protobuf.ByteString + getCpeUriBytes(); + + /** + *
+   * The CPU architecture for which packages in this distribution channel were
+   * built.
+   * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + int getArchitectureValue(); + /** + *
+   * The CPU architecture for which packages in this distribution channel were
+   * built.
+   * 
+ * + * .grafeas.v1beta1.package.Architecture architecture = 2; + */ + io.grafeas.v1beta1.pkg.Architecture getArchitecture(); + + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + boolean hasLatestVersion(); + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + io.grafeas.v1beta1.pkg.Version getLatestVersion(); + /** + *
+   * The latest available version of this package in this distribution
+   * channel.
+   * 
+ * + * .grafeas.v1beta1.package.Version latest_version = 3; + */ + io.grafeas.v1beta1.pkg.VersionOrBuilder getLatestVersionOrBuilder(); + + /** + *
+   * A freeform string denoting the maintainer of this package.
+   * 
+ * + * string maintainer = 4; + */ + java.lang.String getMaintainer(); + /** + *
+   * A freeform string denoting the maintainer of this package.
+   * 
+ * + * string maintainer = 4; + */ + com.google.protobuf.ByteString + getMaintainerBytes(); + + /** + *
+   * The distribution channel-specific homepage for this package.
+   * 
+ * + * string url = 5; + */ + java.lang.String getUrl(); + /** + *
+   * The distribution channel-specific homepage for this package.
+   * 
+ * + * string url = 5; + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * The distribution channel-specific description of this package.
+   * 
+ * + * string description = 6; + */ + java.lang.String getDescription(); + /** + *
+   * The distribution channel-specific description of this package.
+   * 
+ * + * string description = 6; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); +} 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 new file mode 100644 index 000000000000..3f4132dad451 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Installation.java @@ -0,0 +1,1042 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * This represents how a particular software package may be installed on a
+ * system.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Installation} + */ +public final class Installation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Installation) + InstallationOrBuilder { +private static final long serialVersionUID = 0L; + // Use Installation.newBuilder() to construct. + private Installation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Installation() { + name_ = ""; + location_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Installation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + location_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + location_.add( + input.readMessage(io.grafeas.v1beta1.pkg.Location.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + location_ = java.util.Collections.unmodifiableList(location_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Installation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Installation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Installation.class, io.grafeas.v1beta1.pkg.Installation.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Output only. The name of the installed package.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Output only. The name of the installed package.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCATION_FIELD_NUMBER = 2; + private java.util.List location_; + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public java.util.List getLocationList() { + return location_; + } + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public java.util.List + getLocationOrBuilderList() { + return location_; + } + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public int getLocationCount() { + return location_.size(); + } + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.Location getLocation(int index) { + return location_.get(index); + } + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.LocationOrBuilder getLocationOrBuilder( + int index) { + return location_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < location_.size(); i++) { + output.writeMessage(2, location_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < location_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, location_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Installation)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Installation other = (io.grafeas.v1beta1.pkg.Installation) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getLocationList() + .equals(other.getLocationList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getLocationCount() > 0) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocationList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Installation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Installation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Installation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Installation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * This represents how a particular software package may be installed on a
+   * system.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Installation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Installation) + io.grafeas.v1beta1.pkg.InstallationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Installation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Installation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Installation.class, io.grafeas.v1beta1.pkg.Installation.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Installation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLocationFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + locationBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Installation_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Installation getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Installation.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Installation build() { + io.grafeas.v1beta1.pkg.Installation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000002)) { + location_ = java.util.Collections.unmodifiableList(location_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Installation) { + return mergeFrom((io.grafeas.v1beta1.pkg.Installation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Installation other) { + if (other == io.grafeas.v1beta1.pkg.Installation.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (locationBuilder_ == null) { + if (!other.location_.isEmpty()) { + if (location_.isEmpty()) { + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLocationIsMutable(); + location_.addAll(other.location_); + } + onChanged(); + } + } else { + if (!other.location_.isEmpty()) { + if (locationBuilder_.isEmpty()) { + locationBuilder_.dispose(); + locationBuilder_ = null; + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000002); + locationBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLocationFieldBuilder() : null; + } else { + locationBuilder_.addAllMessages(other.location_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Installation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Installation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Output only. The name of the installed package.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. The name of the installed package.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. The name of the installed package.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the installed package.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Output only. The name of the installed package.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List location_ = + java.util.Collections.emptyList(); + private void ensureLocationIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + location_ = new java.util.ArrayList(location_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Location, io.grafeas.v1beta1.pkg.Location.Builder, io.grafeas.v1beta1.pkg.LocationOrBuilder> locationBuilder_; + + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public java.util.List getLocationList() { + if (locationBuilder_ == null) { + return java.util.Collections.unmodifiableList(location_); + } else { + return locationBuilder_.getMessageList(); + } + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public int getLocationCount() { + if (locationBuilder_ == null) { + return location_.size(); + } else { + return locationBuilder_.getCount(); + } + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.Location getLocation(int index) { + if (locationBuilder_ == null) { + return location_.get(index); + } else { + return locationBuilder_.getMessage(index); + } + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder setLocation( + int index, io.grafeas.v1beta1.pkg.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.set(index, value); + onChanged(); + } else { + locationBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder setLocation( + int index, io.grafeas.v1beta1.pkg.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.set(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder addLocation(io.grafeas.v1beta1.pkg.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(value); + onChanged(); + } else { + locationBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder addLocation( + int index, io.grafeas.v1beta1.pkg.Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(index, value); + onChanged(); + } else { + locationBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder addLocation( + io.grafeas.v1beta1.pkg.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder addLocation( + int index, io.grafeas.v1beta1.pkg.Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder addAllLocation( + java.lang.Iterable values) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, location_); + onChanged(); + } else { + locationBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder clearLocation() { + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + locationBuilder_.clear(); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public Builder removeLocation(int index) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.remove(index); + onChanged(); + } else { + locationBuilder_.remove(index); + } + return this; + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.Location.Builder getLocationBuilder( + int index) { + return getLocationFieldBuilder().getBuilder(index); + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.LocationOrBuilder getLocationOrBuilder( + int index) { + if (locationBuilder_ == null) { + return location_.get(index); } else { + return locationBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public java.util.List + getLocationOrBuilderList() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(location_); + } + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.Location.Builder addLocationBuilder() { + return getLocationFieldBuilder().addBuilder( + io.grafeas.v1beta1.pkg.Location.getDefaultInstance()); + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public io.grafeas.v1beta1.pkg.Location.Builder addLocationBuilder( + int index) { + return getLocationFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.pkg.Location.getDefaultInstance()); + } + /** + *
+     * All of the places within the filesystem versions of this package
+     * have been found.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + public java.util.List + getLocationBuilderList() { + return getLocationFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Location, io.grafeas.v1beta1.pkg.Location.Builder, io.grafeas.v1beta1.pkg.LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Location, io.grafeas.v1beta1.pkg.Location.Builder, io.grafeas.v1beta1.pkg.LocationOrBuilder>( + location_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + location_ = null; + } + return locationBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Installation) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Installation) + private static final io.grafeas.v1beta1.pkg.Installation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Installation(); + } + + public static io.grafeas.v1beta1.pkg.Installation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Installation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Installation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Installation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/InstallationOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/InstallationOrBuilder.java new file mode 100644 index 000000000000..78f2056b0ea6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/InstallationOrBuilder.java @@ -0,0 +1,76 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface InstallationOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Installation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Output only. The name of the installed package.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Output only. The name of the installed package.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + java.util.List + getLocationList(); + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + io.grafeas.v1beta1.pkg.Location getLocation(int index); + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + int getLocationCount(); + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + java.util.List + getLocationOrBuilderList(); + /** + *
+   * All of the places within the filesystem versions of this package
+   * have been found.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Location location = 2; + */ + io.grafeas.v1beta1.pkg.LocationOrBuilder getLocationOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..a1a5b4051c0b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Location.java @@ -0,0 +1,970 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * An occurrence of a particular package installation found within a system's
+ * filesystem. E.g., glibc was found in /var/lib/dpkg/status.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Location} + */ +public final class Location extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Location) + LocationOrBuilder { +private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Location() { + cpeUri_ = ""; + path_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Location( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + cpeUri_ = s; + break; + } + case 18: { + io.grafeas.v1beta1.pkg.Version.Builder subBuilder = null; + if (version_ != null) { + subBuilder = version_.toBuilder(); + } + version_ = input.readMessage(io.grafeas.v1beta1.pkg.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Location.class, io.grafeas.v1beta1.pkg.Location.Builder.class); + } + + public static final int CPE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object cpeUri_; + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } + } + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.pkg.Version version_; + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public boolean hasVersion() { + return version_ != null; + } + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public io.grafeas.v1beta1.pkg.Version getVersion() { + return version_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder() { + return getVersion(); + } + + public static final int PATH_FIELD_NUMBER = 3; + private volatile java.lang.Object path_; + /** + *
+   * The path from which we gathered that this package/version is installed.
+   * 
+ * + * string path = 3; + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + *
+   * The path from which we gathered that this package/version is installed.
+   * 
+ * + * string path = 3; + */ + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCpeUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_); + } + if (version_ != null) { + output.writeMessage(2, getVersion()); + } + if (!getPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, path_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCpeUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_); + } + if (version_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getVersion()); + } + if (!getPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, path_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Location)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Location other = (io.grafeas.v1beta1.pkg.Location) obj; + + boolean result = true; + result = result && getCpeUri() + .equals(other.getCpeUri()); + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && getPath() + .equals(other.getPath()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCpeUri().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Location parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Location parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Location parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Location prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An occurrence of a particular package installation found within a system's
+   * filesystem. E.g., glibc was found in /var/lib/dpkg/status.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Location} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Location) + io.grafeas.v1beta1.pkg.LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Location_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Location.class, io.grafeas.v1beta1.pkg.Location.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Location.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cpeUri_ = ""; + + if (versionBuilder_ == null) { + version_ = null; + } else { + version_ = null; + versionBuilder_ = null; + } + path_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Location_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Location getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Location.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Location build() { + io.grafeas.v1beta1.pkg.Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Location buildPartial() { + io.grafeas.v1beta1.pkg.Location result = new io.grafeas.v1beta1.pkg.Location(this); + result.cpeUri_ = cpeUri_; + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + result.path_ = path_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Location) { + return mergeFrom((io.grafeas.v1beta1.pkg.Location)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Location other) { + if (other == io.grafeas.v1beta1.pkg.Location.getDefaultInstance()) return this; + if (!other.getCpeUri().isEmpty()) { + cpeUri_ = other.cpeUri_; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Location parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Location) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cpeUri_ = ""; + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cpeUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder clearCpeUri() { + + cpeUri_ = getDefaultInstance().getCpeUri(); + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+     * denoting the package manager version distributing a package.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cpeUri_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.pkg.Version version_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> versionBuilder_; + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public boolean hasVersion() { + return versionBuilder_ != null || version_ != null; + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public io.grafeas.v1beta1.pkg.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public Builder setVersion(io.grafeas.v1beta1.pkg.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public Builder setVersion( + io.grafeas.v1beta1.pkg.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public Builder mergeVersion(io.grafeas.v1beta1.pkg.Version value) { + if (versionBuilder_ == null) { + if (version_ != null) { + version_ = + io.grafeas.v1beta1.pkg.Version.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + version_ = null; + versionBuilder_ = null; + } + + return this; + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public io.grafeas.v1beta1.pkg.Version.Builder getVersionBuilder() { + + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } + } + /** + *
+     * The version installed at this location.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + + private java.lang.Object path_ = ""; + /** + *
+     * The path from which we gathered that this package/version is installed.
+     * 
+ * + * string path = 3; + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The path from which we gathered that this package/version is installed.
+     * 
+ * + * string path = 3; + */ + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The path from which we gathered that this package/version is installed.
+     * 
+ * + * string path = 3; + */ + public Builder setPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + *
+     * The path from which we gathered that this package/version is installed.
+     * 
+ * + * string path = 3; + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + *
+     * The path from which we gathered that this package/version is installed.
+     * 
+ * + * string path = 3; + */ + public Builder setPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Location) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Location) + private static final io.grafeas.v1beta1.pkg.Location DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Location(); + } + + public static io.grafeas.v1beta1.pkg.Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Location parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Location(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/LocationOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/LocationOrBuilder.java new file mode 100644 index 000000000000..4271335476a4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/LocationOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface LocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Location) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + java.lang.String getCpeUri(); + /** + *
+   * The cpe_uri in [cpe format](https://cpe.mitre.org/specification/)
+   * denoting the package manager version distributing a package.
+   * 
+ * + * string cpe_uri = 1; + */ + com.google.protobuf.ByteString + getCpeUriBytes(); + + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + boolean hasVersion(); + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + io.grafeas.v1beta1.pkg.Version getVersion(); + /** + *
+   * The version installed at this location.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 2; + */ + io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder(); + + /** + *
+   * The path from which we gathered that this package/version is installed.
+   * 
+ * + * string path = 3; + */ + java.lang.String getPath(); + /** + *
+   * The path from which we gathered that this package/version is installed.
+   * 
+ * + * string path = 3; + */ + com.google.protobuf.ByteString + getPathBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/NoteName.java new file mode 100644 index 000000000000..aa9df7fb1667 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.pkg; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/OccurrenceName.java new file mode 100644 index 000000000000..a98eb3d66a0a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.pkg; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-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 new file mode 100644 index 000000000000..6d049a81750b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Package.java @@ -0,0 +1,1021 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * This represents a particular package that is distributed over various
+ * channels. E.g., glibc (aka libc6) is distributed by many, at various
+ * versions.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Package} + */ +public final class Package extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Package) + PackageOrBuilder { +private static final long serialVersionUID = 0L; + // Use Package.newBuilder() to construct. + private Package(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Package() { + name_ = ""; + distribution_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Package( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + distribution_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + distribution_.add( + input.readMessage(io.grafeas.v1beta1.pkg.Distribution.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + distribution_ = java.util.Collections.unmodifiableList(distribution_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Package_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Package_fieldAccessorTable + .ensureFieldAccessorsInitialized( + 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_; + /** + *
+   * The name of the package.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The name of the package.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISTRIBUTION_FIELD_NUMBER = 10; + private java.util.List distribution_; + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public java.util.List getDistributionList() { + return distribution_; + } + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public java.util.List + getDistributionOrBuilderList() { + return distribution_; + } + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public int getDistributionCount() { + return distribution_.size(); + } + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.Distribution getDistribution(int index) { + return distribution_.get(index); + } + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.DistributionOrBuilder getDistributionOrBuilder( + int index) { + return distribution_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < distribution_.size(); i++) { + output.writeMessage(10, distribution_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + for (int i = 0; i < distribution_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, distribution_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Package)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Package other = (io.grafeas.v1beta1.pkg.Package) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getDistributionList() + .equals(other.getDistributionList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getDistributionCount() > 0) { + hash = (37 * hash) + DISTRIBUTION_FIELD_NUMBER; + hash = (53 * hash) + getDistributionList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Package parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Package parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Package parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Package parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Package prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * This represents a particular package that is distributed over various
+   * channels. E.g., glibc (aka libc6) is distributed by many, at various
+   * versions.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Package} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Package) + io.grafeas.v1beta1.pkg.PackageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Package_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Package_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Package.class, io.grafeas.v1beta1.pkg.Package.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Package.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDistributionFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (distributionBuilder_ == null) { + distribution_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + distributionBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Package_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Package getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Package.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Package build() { + io.grafeas.v1beta1.pkg.Package result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000002)) { + distribution_ = java.util.Collections.unmodifiableList(distribution_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.distribution_ = distribution_; + } else { + result.distribution_ = distributionBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Package) { + return mergeFrom((io.grafeas.v1beta1.pkg.Package)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Package other) { + if (other == io.grafeas.v1beta1.pkg.Package.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (distributionBuilder_ == null) { + if (!other.distribution_.isEmpty()) { + if (distribution_.isEmpty()) { + distribution_ = other.distribution_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureDistributionIsMutable(); + distribution_.addAll(other.distribution_); + } + onChanged(); + } + } else { + if (!other.distribution_.isEmpty()) { + if (distributionBuilder_.isEmpty()) { + distributionBuilder_.dispose(); + distributionBuilder_ = null; + distribution_ = other.distribution_; + bitField0_ = (bitField0_ & ~0x00000002); + distributionBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDistributionFieldBuilder() : null; + } else { + distributionBuilder_.addAllMessages(other.distribution_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Package parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Package) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * The name of the package.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the package.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the package.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the package.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The name of the package.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.util.List distribution_ = + java.util.Collections.emptyList(); + private void ensureDistributionIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + distribution_ = new java.util.ArrayList(distribution_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Distribution, io.grafeas.v1beta1.pkg.Distribution.Builder, io.grafeas.v1beta1.pkg.DistributionOrBuilder> distributionBuilder_; + + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public java.util.List getDistributionList() { + if (distributionBuilder_ == null) { + return java.util.Collections.unmodifiableList(distribution_); + } else { + return distributionBuilder_.getMessageList(); + } + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public int getDistributionCount() { + if (distributionBuilder_ == null) { + return distribution_.size(); + } else { + return distributionBuilder_.getCount(); + } + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.Distribution getDistribution(int index) { + if (distributionBuilder_ == null) { + return distribution_.get(index); + } else { + return distributionBuilder_.getMessage(index); + } + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder setDistribution( + int index, io.grafeas.v1beta1.pkg.Distribution value) { + if (distributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDistributionIsMutable(); + distribution_.set(index, value); + onChanged(); + } else { + distributionBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder setDistribution( + int index, io.grafeas.v1beta1.pkg.Distribution.Builder builderForValue) { + if (distributionBuilder_ == null) { + ensureDistributionIsMutable(); + distribution_.set(index, builderForValue.build()); + onChanged(); + } else { + distributionBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder addDistribution(io.grafeas.v1beta1.pkg.Distribution value) { + if (distributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDistributionIsMutable(); + distribution_.add(value); + onChanged(); + } else { + distributionBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder addDistribution( + int index, io.grafeas.v1beta1.pkg.Distribution value) { + if (distributionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDistributionIsMutable(); + distribution_.add(index, value); + onChanged(); + } else { + distributionBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder addDistribution( + io.grafeas.v1beta1.pkg.Distribution.Builder builderForValue) { + if (distributionBuilder_ == null) { + ensureDistributionIsMutable(); + distribution_.add(builderForValue.build()); + onChanged(); + } else { + distributionBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder addDistribution( + int index, io.grafeas.v1beta1.pkg.Distribution.Builder builderForValue) { + if (distributionBuilder_ == null) { + ensureDistributionIsMutable(); + distribution_.add(index, builderForValue.build()); + onChanged(); + } else { + distributionBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder addAllDistribution( + java.lang.Iterable values) { + if (distributionBuilder_ == null) { + ensureDistributionIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, distribution_); + onChanged(); + } else { + distributionBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder clearDistribution() { + if (distributionBuilder_ == null) { + distribution_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + distributionBuilder_.clear(); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public Builder removeDistribution(int index) { + if (distributionBuilder_ == null) { + ensureDistributionIsMutable(); + distribution_.remove(index); + onChanged(); + } else { + distributionBuilder_.remove(index); + } + return this; + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.Distribution.Builder getDistributionBuilder( + int index) { + return getDistributionFieldBuilder().getBuilder(index); + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.DistributionOrBuilder getDistributionOrBuilder( + int index) { + if (distributionBuilder_ == null) { + return distribution_.get(index); } else { + return distributionBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public java.util.List + getDistributionOrBuilderList() { + if (distributionBuilder_ != null) { + return distributionBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(distribution_); + } + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.Distribution.Builder addDistributionBuilder() { + return getDistributionFieldBuilder().addBuilder( + io.grafeas.v1beta1.pkg.Distribution.getDefaultInstance()); + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public io.grafeas.v1beta1.pkg.Distribution.Builder addDistributionBuilder( + int index) { + return getDistributionFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.pkg.Distribution.getDefaultInstance()); + } + /** + *
+     * The various channels by which a package is distributed.
+     * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + public java.util.List + getDistributionBuilderList() { + return getDistributionFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Distribution, io.grafeas.v1beta1.pkg.Distribution.Builder, io.grafeas.v1beta1.pkg.DistributionOrBuilder> + getDistributionFieldBuilder() { + if (distributionBuilder_ == null) { + distributionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.pkg.Distribution, io.grafeas.v1beta1.pkg.Distribution.Builder, io.grafeas.v1beta1.pkg.DistributionOrBuilder>( + distribution_, + ((bitField0_ & 0x00000002) == 0x00000002), + getParentForChildren(), + isClean()); + distribution_ = null; + } + return distributionBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Package) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Package) + private static final io.grafeas.v1beta1.pkg.Package DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Package(); + } + + public static io.grafeas.v1beta1.pkg.Package getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Package parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Package(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Package getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOrBuilder.java new file mode 100644 index 000000000000..014b9d1eca93 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOrBuilder.java @@ -0,0 +1,71 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface PackageOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Package) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of the package.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * The name of the package.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + java.util.List + getDistributionList(); + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + io.grafeas.v1beta1.pkg.Distribution getDistribution(int index); + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + int getDistributionCount(); + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + java.util.List + getDistributionOrBuilderList(); + /** + *
+   * The various channels by which a package is distributed.
+   * 
+ * + * repeated .grafeas.v1beta1.package.Distribution distribution = 10; + */ + io.grafeas.v1beta1.pkg.DistributionOrBuilder getDistributionOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..2678e01358f0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/PackageOuterClass.java @@ -0,0 +1,134 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public final class PackageOuterClass { + private PackageOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Distribution_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Distribution_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Location_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Location_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Package_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Package_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Installation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Installation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_package_Version_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_package_Version_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n?google/devtools/containeranalysis/v1be" + + "ta1/package/package.proto\022\027grafeas.v1bet" + + "a1.package\"\314\001\n\014Distribution\022\017\n\007cpe_uri\030\001" + + " \001(\t\022;\n\014architecture\030\002 \001(\0162%.grafeas.v1b" + + "eta1.package.Architecture\0228\n\016latest_vers" + + "ion\030\003 \001(\0132 .grafeas.v1beta1.package.Vers" + + "ion\022\022\n\nmaintainer\030\004 \001(\t\022\013\n\003url\030\005 \001(\t\022\023\n\013" + + "description\030\006 \001(\t\"\\\n\010Location\022\017\n\007cpe_uri" + + "\030\001 \001(\t\0221\n\007version\030\002 \001(\0132 .grafeas.v1beta" + + "1.package.Version\022\014\n\004path\030\003 \001(\t\"T\n\007Packa" + + "ge\022\014\n\004name\030\001 \001(\t\022;\n\014distribution\030\n \003(\0132%" + + ".grafeas.v1beta1.package.Distribution\"F\n" + + "\007Details\022;\n\014installation\030\001 \001(\0132%.grafeas" + + ".v1beta1.package.Installation\"Q\n\014Install" + + "ation\022\014\n\004name\030\001 \001(\t\0223\n\010location\030\002 \003(\0132!." + + "grafeas.v1beta1.package.Location\"\307\001\n\007Ver" + + "sion\022\r\n\005epoch\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\022\020\n\010rev" + + "ision\030\003 \001(\t\022:\n\004kind\030\004 \001(\0162,.grafeas.v1be" + + "ta1.package.Version.VersionKind\"Q\n\013Versi" + + "onKind\022\034\n\030VERSION_KIND_UNSPECIFIED\020\000\022\n\n\006" + + "NORMAL\020\001\022\013\n\007MINIMUM\020\002\022\013\n\007MAXIMUM\020\003*>\n\014Ar" + + "chitecture\022\034\n\030ARCHITECTURE_UNSPECIFIED\020\000" + + "\022\007\n\003X86\020\001\022\007\n\003X64\020\002Bz\n\026io.grafeas.v1beta1" + + ".pkgP\001ZXgoogle.golang.org/genproto/googl" + + "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); + internal_static_grafeas_v1beta1_package_Distribution_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_package_Distribution_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Distribution_descriptor, + new java.lang.String[] { "CpeUri", "Architecture", "LatestVersion", "Maintainer", "Url", "Description", }); + internal_static_grafeas_v1beta1_package_Location_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_package_Location_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Location_descriptor, + new java.lang.String[] { "CpeUri", "Version", "Path", }); + internal_static_grafeas_v1beta1_package_Package_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_package_Package_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Package_descriptor, + new java.lang.String[] { "Name", "Distribution", }); + internal_static_grafeas_v1beta1_package_Details_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_package_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Details_descriptor, + new java.lang.String[] { "Installation", }); + internal_static_grafeas_v1beta1_package_Installation_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1beta1_package_Installation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Installation_descriptor, + new java.lang.String[] { "Name", "Location", }); + internal_static_grafeas_v1beta1_package_Version_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_grafeas_v1beta1_package_Version_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_package_Version_descriptor, + new java.lang.String[] { "Epoch", "Name", "Revision", "Kind", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ProjectName.java new file mode 100644 index 000000000000..a740c019d0a5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.pkg; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ScanConfigName.java new file mode 100644 index 000000000000..72198ecd8ad7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.pkg; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..a4fc587e9f8c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/Version.java @@ -0,0 +1,1082 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +/** + *
+ * Version contains structured information about the version of a package.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Version} + */ +public final class Version extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.package.Version) + VersionOrBuilder { +private static final long serialVersionUID = 0L; + // Use Version.newBuilder() to construct. + private Version(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Version() { + epoch_ = 0; + name_ = ""; + revision_ = ""; + kind_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Version( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + epoch_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + revision_ = s; + break; + } + case 32: { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Version.class, io.grafeas.v1beta1.pkg.Version.Builder.class); + } + + /** + *
+   * Whether this is an ordinary package version or a sentinel MIN/MAX version.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.package.Version.VersionKind} + */ + public enum VersionKind + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * VERSION_KIND_UNSPECIFIED = 0; + */ + VERSION_KIND_UNSPECIFIED(0), + /** + *
+     * A standard package version, defined by the other fields.
+     * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + *
+     * A special version representing negative infinity, other fields are
+     * ignored.
+     * 
+ * + * MINIMUM = 2; + */ + MINIMUM(2), + /** + *
+     * A special version representing positive infinity, other fields are
+     * ignored.
+     * 
+ * + * MAXIMUM = 3; + */ + MAXIMUM(3), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * VERSION_KIND_UNSPECIFIED = 0; + */ + public static final int VERSION_KIND_UNSPECIFIED_VALUE = 0; + /** + *
+     * A standard package version, defined by the other fields.
+     * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + /** + *
+     * A special version representing negative infinity, other fields are
+     * ignored.
+     * 
+ * + * MINIMUM = 2; + */ + public static final int MINIMUM_VALUE = 2; + /** + *
+     * A special version representing positive infinity, other fields are
+     * ignored.
+     * 
+ * + * MAXIMUM = 3; + */ + public static final int MAXIMUM_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static VersionKind valueOf(int value) { + return forNumber(value); + } + + public static VersionKind forNumber(int value) { + switch (value) { + case 0: return VERSION_KIND_UNSPECIFIED; + case 1: return NORMAL; + case 2: return MINIMUM; + case 3: return MAXIMUM; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + VersionKind> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public VersionKind findValueByNumber(int number) { + return VersionKind.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.Version.getDescriptor().getEnumTypes().get(0); + } + + private static final VersionKind[] VALUES = values(); + + public static VersionKind valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private VersionKind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.package.Version.VersionKind) + } + + public static final int EPOCH_FIELD_NUMBER = 1; + private int epoch_; + /** + *
+   * Used to correct mistakes in the version numbering scheme.
+   * 
+ * + * int32 epoch = 1; + */ + public int getEpoch() { + return epoch_; + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + *
+   * The main part of the version name.
+   * 
+ * + * string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The main part of the version name.
+   * 
+ * + * string name = 2; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVISION_FIELD_NUMBER = 3; + private volatile java.lang.Object revision_; + /** + *
+   * The iteration of the package build from the above version.
+   * 
+ * + * string revision = 3; + */ + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } + } + /** + *
+   * The iteration of the package build from the above version.
+   * 
+ * + * string revision = 3; + */ + public com.google.protobuf.ByteString + getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KIND_FIELD_NUMBER = 4; + private int kind_; + /** + *
+   * Distinguish between sentinel MIN/MAX versions and normal versions. If
+   * kind is not NORMAL, then the other fields are ignored.
+   * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+   * Distinguish between sentinel MIN/MAX versions and normal versions. If
+   * kind is not NORMAL, then the other fields are ignored.
+   * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public io.grafeas.v1beta1.pkg.Version.VersionKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.pkg.Version.VersionKind result = io.grafeas.v1beta1.pkg.Version.VersionKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.pkg.Version.VersionKind.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (epoch_ != 0) { + output.writeInt32(1, epoch_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!getRevisionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revision_); + } + if (kind_ != io.grafeas.v1beta1.pkg.Version.VersionKind.VERSION_KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(4, kind_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (epoch_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, epoch_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!getRevisionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revision_); + } + if (kind_ != io.grafeas.v1beta1.pkg.Version.VersionKind.VERSION_KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(4, kind_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.pkg.Version)) { + return super.equals(obj); + } + io.grafeas.v1beta1.pkg.Version other = (io.grafeas.v1beta1.pkg.Version) obj; + + boolean result = true; + result = result && (getEpoch() + == other.getEpoch()); + result = result && getName() + .equals(other.getName()); + result = result && getRevision() + .equals(other.getRevision()); + result = result && kind_ == other.kind_; + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + EPOCH_FIELD_NUMBER; + hash = (53 * hash) + getEpoch(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + REVISION_FIELD_NUMBER; + hash = (53 * hash) + getRevision().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.pkg.Version parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Version parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Version parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.pkg.Version parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.pkg.Version prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Version contains structured information about the version of a package.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.package.Version} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.package.Version) + io.grafeas.v1beta1.pkg.VersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Version_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Version_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.pkg.Version.class, io.grafeas.v1beta1.pkg.Version.Builder.class); + } + + // Construct using io.grafeas.v1beta1.pkg.Version.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + epoch_ = 0; + + name_ = ""; + + revision_ = ""; + + kind_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.pkg.PackageOuterClass.internal_static_grafeas_v1beta1_package_Version_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Version getDefaultInstanceForType() { + return io.grafeas.v1beta1.pkg.Version.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Version build() { + io.grafeas.v1beta1.pkg.Version result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Version buildPartial() { + io.grafeas.v1beta1.pkg.Version result = new io.grafeas.v1beta1.pkg.Version(this); + result.epoch_ = epoch_; + result.name_ = name_; + result.revision_ = revision_; + result.kind_ = kind_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.pkg.Version) { + return mergeFrom((io.grafeas.v1beta1.pkg.Version)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.pkg.Version other) { + if (other == io.grafeas.v1beta1.pkg.Version.getDefaultInstance()) return this; + if (other.getEpoch() != 0) { + setEpoch(other.getEpoch()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getRevision().isEmpty()) { + revision_ = other.revision_; + onChanged(); + } + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.pkg.Version parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.pkg.Version) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int epoch_ ; + /** + *
+     * Used to correct mistakes in the version numbering scheme.
+     * 
+ * + * int32 epoch = 1; + */ + public int getEpoch() { + return epoch_; + } + /** + *
+     * Used to correct mistakes in the version numbering scheme.
+     * 
+ * + * int32 epoch = 1; + */ + public Builder setEpoch(int value) { + + epoch_ = value; + onChanged(); + return this; + } + /** + *
+     * Used to correct mistakes in the version numbering scheme.
+     * 
+ * + * int32 epoch = 1; + */ + public Builder clearEpoch() { + + epoch_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The main part of the version name.
+     * 
+ * + * string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The main part of the version name.
+     * 
+ * + * string name = 2; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The main part of the version name.
+     * 
+ * + * string name = 2; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The main part of the version name.
+     * 
+ * + * string name = 2; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The main part of the version name.
+     * 
+ * + * string name = 2; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object revision_ = ""; + /** + *
+     * The iteration of the package build from the above version.
+     * 
+ * + * string revision = 3; + */ + public java.lang.String getRevision() { + java.lang.Object ref = revision_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revision_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The iteration of the package build from the above version.
+     * 
+ * + * string revision = 3; + */ + public com.google.protobuf.ByteString + getRevisionBytes() { + java.lang.Object ref = revision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The iteration of the package build from the above version.
+     * 
+ * + * string revision = 3; + */ + public Builder setRevision( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revision_ = value; + onChanged(); + return this; + } + /** + *
+     * The iteration of the package build from the above version.
+     * 
+ * + * string revision = 3; + */ + public Builder clearRevision() { + + revision_ = getDefaultInstance().getRevision(); + onChanged(); + return this; + } + /** + *
+     * The iteration of the package build from the above version.
+     * 
+ * + * string revision = 3; + */ + public Builder setRevisionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revision_ = value; + onChanged(); + return this; + } + + private int kind_ = 0; + /** + *
+     * Distinguish between sentinel MIN/MAX versions and normal versions. If
+     * kind is not NORMAL, then the other fields are ignored.
+     * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public int getKindValue() { + return kind_; + } + /** + *
+     * Distinguish between sentinel MIN/MAX versions and normal versions. If
+     * kind is not NORMAL, then the other fields are ignored.
+     * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public Builder setKindValue(int value) { + kind_ = value; + onChanged(); + return this; + } + /** + *
+     * Distinguish between sentinel MIN/MAX versions and normal versions. If
+     * kind is not NORMAL, then the other fields are ignored.
+     * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public io.grafeas.v1beta1.pkg.Version.VersionKind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.pkg.Version.VersionKind result = io.grafeas.v1beta1.pkg.Version.VersionKind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.pkg.Version.VersionKind.UNRECOGNIZED : result; + } + /** + *
+     * Distinguish between sentinel MIN/MAX versions and normal versions. If
+     * kind is not NORMAL, then the other fields are ignored.
+     * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public Builder setKind(io.grafeas.v1beta1.pkg.Version.VersionKind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Distinguish between sentinel MIN/MAX versions and normal versions. If
+     * kind is not NORMAL, then the other fields are ignored.
+     * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.package.Version) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.package.Version) + private static final io.grafeas.v1beta1.pkg.Version DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.pkg.Version(); + } + + public static io.grafeas.v1beta1.pkg.Version getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Version parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Version(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.pkg.Version getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/VersionOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/VersionOrBuilder.java new file mode 100644 index 000000000000..a5abd0a9aa12 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/pkg/VersionOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/package/package.proto + +package io.grafeas.v1beta1.pkg; + +public interface VersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.package.Version) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Used to correct mistakes in the version numbering scheme.
+   * 
+ * + * int32 epoch = 1; + */ + int getEpoch(); + + /** + *
+   * The main part of the version name.
+   * 
+ * + * string name = 2; + */ + java.lang.String getName(); + /** + *
+   * The main part of the version name.
+   * 
+ * + * string name = 2; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * The iteration of the package build from the above version.
+   * 
+ * + * string revision = 3; + */ + java.lang.String getRevision(); + /** + *
+   * The iteration of the package build from the above version.
+   * 
+ * + * string revision = 3; + */ + com.google.protobuf.ByteString + getRevisionBytes(); + + /** + *
+   * Distinguish between sentinel MIN/MAX versions and normal versions. If
+   * kind is not NORMAL, then the other fields are ignored.
+   * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + int getKindValue(); + /** + *
+   * Distinguish between sentinel MIN/MAX versions and normal versions. If
+   * kind is not NORMAL, then the other fields are ignored.
+   * 
+ * + * .grafeas.v1beta1.package.Version.VersionKind kind = 4; + */ + io.grafeas.v1beta1.pkg.Version.VersionKind getKind(); +} 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 new file mode 100644 index 000000000000..c1aeb0920487 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Artifact.java @@ -0,0 +1,1025 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Artifact describes a build product.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Artifact} + */ +public final class Artifact extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.Artifact) + ArtifactOrBuilder { +private static final long serialVersionUID = 0L; + // Use Artifact.newBuilder() to construct. + private Artifact(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Artifact() { + checksum_ = ""; + id_ = ""; + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Artifact( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + checksum_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + names_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + names_.add(s); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + names_ = names_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Artifact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Artifact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Artifact.class, io.grafeas.v1beta1.provenance.Artifact.Builder.class); + } + + private int bitField0_; + public static final int CHECKSUM_FIELD_NUMBER = 1; + private volatile java.lang.Object checksum_; + /** + *
+   * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+   * container.
+   * 
+ * + * string checksum = 1; + */ + public java.lang.String getChecksum() { + java.lang.Object ref = checksum_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checksum_ = s; + return s; + } + } + /** + *
+   * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+   * container.
+   * 
+ * + * string checksum = 1; + */ + public com.google.protobuf.ByteString + getChecksumBytes() { + java.lang.Object ref = checksum_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checksum_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 2; + private volatile java.lang.Object id_; + /** + *
+   * Artifact ID, if any; for container images, this will be a URL by digest
+   * like `gcr.io/projectID/imagename@sha256:123456`.
+   * 
+ * + * string id = 2; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + *
+   * Artifact ID, if any; for container images, this will be a URL by digest
+   * like `gcr.io/projectID/imagename@sha256:123456`.
+   * 
+ * + * string id = 2; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAMES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList names_; + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + public com.google.protobuf.ProtocolStringList + getNamesList() { + return names_; + } + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + public int getNamesCount() { + return names_.size(); + } + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + public com.google.protobuf.ByteString + getNamesBytes(int index) { + return names_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getChecksumBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, checksum_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + for (int i = 0; i < names_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, names_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getChecksumBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, checksum_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + { + int dataSize = 0; + for (int i = 0; i < names_.size(); i++) { + dataSize += computeStringSizeNoTag(names_.getRaw(i)); + } + size += dataSize; + size += 1 * getNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.Artifact)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.Artifact other = (io.grafeas.v1beta1.provenance.Artifact) obj; + + boolean result = true; + result = result && getChecksum() + .equals(other.getChecksum()); + result = result && getId() + .equals(other.getId()); + result = result && getNamesList() + .equals(other.getNamesList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CHECKSUM_FIELD_NUMBER; + hash = (53 * hash) + getChecksum().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (getNamesCount() > 0) { + hash = (37 * hash) + NAMES_FIELD_NUMBER; + hash = (53 * hash) + getNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Artifact parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Artifact parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Artifact parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.Artifact prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Artifact describes a build product.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Artifact} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.Artifact) + io.grafeas.v1beta1.provenance.ArtifactOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Artifact_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Artifact_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Artifact.class, io.grafeas.v1beta1.provenance.Artifact.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.Artifact.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + checksum_ = ""; + + id_ = ""; + + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Artifact_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Artifact getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.Artifact.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Artifact build() { + io.grafeas.v1beta1.provenance.Artifact result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000004)) { + names_ = names_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.names_ = names_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.Artifact) { + return mergeFrom((io.grafeas.v1beta1.provenance.Artifact)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.Artifact other) { + if (other == io.grafeas.v1beta1.provenance.Artifact.getDefaultInstance()) return this; + if (!other.getChecksum().isEmpty()) { + checksum_ = other.checksum_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.names_.isEmpty()) { + if (names_.isEmpty()) { + names_ = other.names_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureNamesIsMutable(); + names_.addAll(other.names_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.Artifact parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.Artifact) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object checksum_ = ""; + /** + *
+     * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+     * container.
+     * 
+ * + * string checksum = 1; + */ + public java.lang.String getChecksum() { + java.lang.Object ref = checksum_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + checksum_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+     * container.
+     * 
+ * + * string checksum = 1; + */ + public com.google.protobuf.ByteString + getChecksumBytes() { + java.lang.Object ref = checksum_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + checksum_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+     * container.
+     * 
+ * + * string checksum = 1; + */ + public Builder setChecksum( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + checksum_ = value; + onChanged(); + return this; + } + /** + *
+     * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+     * container.
+     * 
+ * + * string checksum = 1; + */ + public Builder clearChecksum() { + + checksum_ = getDefaultInstance().getChecksum(); + onChanged(); + return this; + } + /** + *
+     * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+     * container.
+     * 
+ * + * string checksum = 1; + */ + public Builder setChecksumBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + checksum_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + *
+     * Artifact ID, if any; for container images, this will be a URL by digest
+     * like `gcr.io/projectID/imagename@sha256:123456`.
+     * 
+ * + * string id = 2; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Artifact ID, if any; for container images, this will be a URL by digest
+     * like `gcr.io/projectID/imagename@sha256:123456`.
+     * 
+ * + * string id = 2; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Artifact ID, if any; for container images, this will be a URL by digest
+     * like `gcr.io/projectID/imagename@sha256:123456`.
+     * 
+ * + * string id = 2; + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + *
+     * Artifact ID, if any; for container images, this will be a URL by digest
+     * like `gcr.io/projectID/imagename@sha256:123456`.
+     * 
+ * + * string id = 2; + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + *
+     * Artifact ID, if any; for container images, this will be a URL by digest
+     * like `gcr.io/projectID/imagename@sha256:123456`.
+     * 
+ * + * string id = 2; + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureNamesIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + names_ = new com.google.protobuf.LazyStringArrayList(names_); + bitField0_ |= 0x00000004; + } + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public com.google.protobuf.ProtocolStringList + getNamesList() { + return names_.getUnmodifiableView(); + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public int getNamesCount() { + return names_.size(); + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public java.lang.String getNames(int index) { + return names_.get(index); + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public com.google.protobuf.ByteString + getNamesBytes(int index) { + return names_.getByteString(index); + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public Builder setNames( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public Builder addNames( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNamesIsMutable(); + names_.add(value); + onChanged(); + return this; + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public Builder addAllNames( + java.lang.Iterable values) { + ensureNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, names_); + onChanged(); + return this; + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public Builder clearNames() { + names_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Related artifact names. This may be the path to a binary or jar file, or in
+     * the case of a container build, the name used to push the container image to
+     * Google Container Registry, as presented to `docker push`. Note that a
+     * single Artifact ID can have multiple names, for example if two tags are
+     * applied to one image.
+     * 
+ * + * repeated string names = 3; + */ + public Builder addNamesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureNamesIsMutable(); + names_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.Artifact) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.Artifact) + private static final io.grafeas.v1beta1.provenance.Artifact DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.Artifact(); + } + + public static io.grafeas.v1beta1.provenance.Artifact getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Artifact parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Artifact(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Artifact getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ArtifactOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ArtifactOrBuilder.java new file mode 100644 index 000000000000..f07f8aa33c59 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ArtifactOrBuilder.java @@ -0,0 +1,100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface ArtifactOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.Artifact) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+   * container.
+   * 
+ * + * string checksum = 1; + */ + java.lang.String getChecksum(); + /** + *
+   * Hash or checksum value of a binary, or Docker Registry 2.0 digest of a
+   * container.
+   * 
+ * + * string checksum = 1; + */ + com.google.protobuf.ByteString + getChecksumBytes(); + + /** + *
+   * Artifact ID, if any; for container images, this will be a URL by digest
+   * like `gcr.io/projectID/imagename@sha256:123456`.
+   * 
+ * + * string id = 2; + */ + java.lang.String getId(); + /** + *
+   * Artifact ID, if any; for container images, this will be a URL by digest
+   * like `gcr.io/projectID/imagename@sha256:123456`.
+   * 
+ * + * string id = 2; + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + java.util.List + getNamesList(); + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + int getNamesCount(); + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + java.lang.String getNames(int index); + /** + *
+   * Related artifact names. This may be the path to a binary or jar file, or in
+   * the case of a container build, the name used to push the container image to
+   * Google Container Registry, as presented to `docker push`. Note that a
+   * single Artifact ID can have multiple names, for example if two tags are
+   * applied to one image.
+   * 
+ * + * repeated string names = 3; + */ + com.google.protobuf.ByteString + getNamesBytes(int index); +} 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 new file mode 100644 index 000000000000..dc44f63f2881 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenance.java @@ -0,0 +1,3487 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Provenance of a build. Contains all information needed to verify the full
+ * details about the build from source to completion.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.BuildProvenance} + */ +public final class BuildProvenance extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.BuildProvenance) + BuildProvenanceOrBuilder { +private static final long serialVersionUID = 0L; + // Use BuildProvenance.newBuilder() to construct. + private BuildProvenance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BuildProvenance() { + id_ = ""; + projectId_ = ""; + commands_ = java.util.Collections.emptyList(); + builtArtifacts_ = java.util.Collections.emptyList(); + creator_ = ""; + logsUri_ = ""; + triggerId_ = ""; + builderVersion_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BuildProvenance( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + commands_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + commands_.add( + input.readMessage(io.grafeas.v1beta1.provenance.Command.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + builtArtifacts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + builtArtifacts_.add( + input.readMessage(io.grafeas.v1beta1.provenance.Artifact.parser(), extensionRegistry)); + break; + } + case 42: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + creator_ = s; + break; + } + case 74: { + java.lang.String s = input.readStringRequireUtf8(); + + logsUri_ = s; + break; + } + case 82: { + io.grafeas.v1beta1.provenance.Source.Builder subBuilder = null; + if (sourceProvenance_ != null) { + subBuilder = sourceProvenance_.toBuilder(); + } + sourceProvenance_ = input.readMessage(io.grafeas.v1beta1.provenance.Source.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceProvenance_); + sourceProvenance_ = subBuilder.buildPartial(); + } + + break; + } + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + + triggerId_ = s; + break; + } + case 98: { + if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) { + buildOptions_ = com.google.protobuf.MapField.newMapField( + BuildOptionsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000800; + } + com.google.protobuf.MapEntry + buildOptions__ = input.readMessage( + BuildOptionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + buildOptions_.getMutableMap().put( + buildOptions__.getKey(), buildOptions__.getValue()); + break; + } + case 106: { + java.lang.String s = input.readStringRequireUtf8(); + + builderVersion_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + commands_ = java.util.Collections.unmodifiableList(commands_); + } + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + builtArtifacts_ = java.util.Collections.unmodifiableList(builtArtifacts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 12: + return internalGetBuildOptions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.BuildProvenance.class, io.grafeas.v1beta1.provenance.BuildProvenance.Builder.class); + } + + private int bitField0_; + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + *
+   * Unique identifier of the build.
+   * 
+ * + * string id = 1; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + *
+   * Unique identifier of the build.
+   * 
+ * + * string id = 1; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object projectId_; + /** + *
+   * ID of the project.
+   * 
+ * + * string project_id = 2; + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + *
+   * ID of the project.
+   * 
+ * + * string project_id = 2; + */ + public com.google.protobuf.ByteString + getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COMMANDS_FIELD_NUMBER = 3; + private java.util.List commands_; + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public java.util.List getCommandsList() { + return commands_; + } + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public java.util.List + getCommandsOrBuilderList() { + return commands_; + } + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public int getCommandsCount() { + return commands_.size(); + } + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.Command getCommands(int index) { + return commands_.get(index); + } + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.CommandOrBuilder getCommandsOrBuilder( + int index) { + return commands_.get(index); + } + + public static final int BUILT_ARTIFACTS_FIELD_NUMBER = 4; + private java.util.List builtArtifacts_; + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public java.util.List getBuiltArtifactsList() { + return builtArtifacts_; + } + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public java.util.List + getBuiltArtifactsOrBuilderList() { + return builtArtifacts_; + } + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public int getBuiltArtifactsCount() { + return builtArtifacts_.size(); + } + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.Artifact getBuiltArtifacts(int index) { + return builtArtifacts_.get(index); + } + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.ArtifactOrBuilder getBuiltArtifactsOrBuilder( + int index) { + return builtArtifacts_.get(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int START_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int CREATOR_FIELD_NUMBER = 8; + private volatile java.lang.Object creator_; + /** + *
+   * E-mail address of the user who initiated this build. Note that this was the
+   * user's e-mail address at the time the build was initiated; this address may
+   * not represent the same end-user for all time.
+   * 
+ * + * string creator = 8; + */ + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + creator_ = s; + return s; + } + } + /** + *
+   * E-mail address of the user who initiated this build. Note that this was the
+   * user's e-mail address at the time the build was initiated; this address may
+   * not represent the same end-user for all time.
+   * 
+ * + * string creator = 8; + */ + public com.google.protobuf.ByteString + getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOGS_URI_FIELD_NUMBER = 9; + private volatile java.lang.Object logsUri_; + /** + *
+   * URI where any logs for this provenance were written.
+   * 
+ * + * string logs_uri = 9; + */ + public java.lang.String getLogsUri() { + java.lang.Object ref = logsUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logsUri_ = s; + return s; + } + } + /** + *
+   * URI where any logs for this provenance were written.
+   * 
+ * + * string logs_uri = 9; + */ + public com.google.protobuf.ByteString + getLogsUriBytes() { + java.lang.Object ref = logsUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logsUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_PROVENANCE_FIELD_NUMBER = 10; + private io.grafeas.v1beta1.provenance.Source sourceProvenance_; + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public boolean hasSourceProvenance() { + return sourceProvenance_ != null; + } + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public io.grafeas.v1beta1.provenance.Source getSourceProvenance() { + return sourceProvenance_ == null ? io.grafeas.v1beta1.provenance.Source.getDefaultInstance() : sourceProvenance_; + } + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public io.grafeas.v1beta1.provenance.SourceOrBuilder getSourceProvenanceOrBuilder() { + return getSourceProvenance(); + } + + public static final int TRIGGER_ID_FIELD_NUMBER = 11; + private volatile java.lang.Object triggerId_; + /** + *
+   * Trigger identifier if the build was triggered automatically; empty if not.
+   * 
+ * + * string trigger_id = 11; + */ + public java.lang.String getTriggerId() { + java.lang.Object ref = triggerId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerId_ = s; + return s; + } + } + /** + *
+   * Trigger identifier if the build was triggered automatically; empty if not.
+   * 
+ * + * string trigger_id = 11; + */ + public com.google.protobuf.ByteString + getTriggerIdBytes() { + java.lang.Object ref = triggerId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + triggerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BUILD_OPTIONS_FIELD_NUMBER = 12; + private static final class BuildOptionsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> buildOptions_; + private com.google.protobuf.MapField + internalGetBuildOptions() { + if (buildOptions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildOptionsDefaultEntryHolder.defaultEntry); + } + return buildOptions_; + } + + public int getBuildOptionsCount() { + return internalGetBuildOptions().getMap().size(); + } + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + public boolean containsBuildOptions( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetBuildOptions().getMap().containsKey(key); + } + /** + * Use {@link #getBuildOptionsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getBuildOptions() { + return getBuildOptionsMap(); + } + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + public java.util.Map getBuildOptionsMap() { + return internalGetBuildOptions().getMap(); + } + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + public java.lang.String getBuildOptionsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetBuildOptions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + public java.lang.String getBuildOptionsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetBuildOptions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int BUILDER_VERSION_FIELD_NUMBER = 13; + private volatile java.lang.Object builderVersion_; + /** + *
+   * Version string of the builder at the time this build was executed.
+   * 
+ * + * string builder_version = 13; + */ + public java.lang.String getBuilderVersion() { + java.lang.Object ref = builderVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + builderVersion_ = s; + return s; + } + } + /** + *
+   * Version string of the builder at the time this build was executed.
+   * 
+ * + * string builder_version = 13; + */ + public com.google.protobuf.ByteString + getBuilderVersionBytes() { + java.lang.Object ref = builderVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + builderVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getProjectIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, projectId_); + } + for (int i = 0; i < commands_.size(); i++) { + output.writeMessage(3, commands_.get(i)); + } + for (int i = 0; i < builtArtifacts_.size(); i++) { + output.writeMessage(4, builtArtifacts_.get(i)); + } + if (createTime_ != null) { + output.writeMessage(5, getCreateTime()); + } + if (startTime_ != null) { + output.writeMessage(6, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(7, getEndTime()); + } + if (!getCreatorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, creator_); + } + if (!getLogsUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, logsUri_); + } + if (sourceProvenance_ != null) { + output.writeMessage(10, getSourceProvenance()); + } + if (!getTriggerIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, triggerId_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetBuildOptions(), + BuildOptionsDefaultEntryHolder.defaultEntry, + 12); + if (!getBuilderVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 13, builderVersion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getProjectIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, projectId_); + } + for (int i = 0; i < commands_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, commands_.get(i)); + } + for (int i = 0; i < builtArtifacts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, builtArtifacts_.get(i)); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getCreateTime()); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getEndTime()); + } + if (!getCreatorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, creator_); + } + if (!getLogsUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, logsUri_); + } + if (sourceProvenance_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, getSourceProvenance()); + } + if (!getTriggerIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, triggerId_); + } + for (java.util.Map.Entry entry + : internalGetBuildOptions().getMap().entrySet()) { + com.google.protobuf.MapEntry + buildOptions__ = BuildOptionsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(12, buildOptions__); + } + if (!getBuilderVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, builderVersion_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.BuildProvenance)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.BuildProvenance other = (io.grafeas.v1beta1.provenance.BuildProvenance) obj; + + boolean result = true; + result = result && getId() + .equals(other.getId()); + result = result && getProjectId() + .equals(other.getProjectId()); + result = result && getCommandsList() + .equals(other.getCommandsList()); + result = result && getBuiltArtifactsList() + .equals(other.getBuiltArtifactsList()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime() + .equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime() + .equals(other.getEndTime()); + } + result = result && getCreator() + .equals(other.getCreator()); + result = result && getLogsUri() + .equals(other.getLogsUri()); + result = result && (hasSourceProvenance() == other.hasSourceProvenance()); + if (hasSourceProvenance()) { + result = result && getSourceProvenance() + .equals(other.getSourceProvenance()); + } + result = result && getTriggerId() + .equals(other.getTriggerId()); + result = result && internalGetBuildOptions().equals( + other.internalGetBuildOptions()); + result = result && getBuilderVersion() + .equals(other.getBuilderVersion()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + if (getCommandsCount() > 0) { + hash = (37 * hash) + COMMANDS_FIELD_NUMBER; + hash = (53 * hash) + getCommandsList().hashCode(); + } + if (getBuiltArtifactsCount() > 0) { + hash = (37 * hash) + BUILT_ARTIFACTS_FIELD_NUMBER; + hash = (53 * hash) + getBuiltArtifactsList().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + CREATOR_FIELD_NUMBER; + hash = (53 * hash) + getCreator().hashCode(); + hash = (37 * hash) + LOGS_URI_FIELD_NUMBER; + hash = (53 * hash) + getLogsUri().hashCode(); + if (hasSourceProvenance()) { + hash = (37 * hash) + SOURCE_PROVENANCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceProvenance().hashCode(); + } + hash = (37 * hash) + TRIGGER_ID_FIELD_NUMBER; + hash = (53 * hash) + getTriggerId().hashCode(); + if (!internalGetBuildOptions().getMap().isEmpty()) { + hash = (37 * hash) + BUILD_OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + internalGetBuildOptions().hashCode(); + } + hash = (37 * hash) + BUILDER_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getBuilderVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.BuildProvenance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.BuildProvenance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provenance of a build. Contains all information needed to verify the full
+   * details about the build from source to completion.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.BuildProvenance} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.BuildProvenance) + io.grafeas.v1beta1.provenance.BuildProvenanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 12: + return internalGetBuildOptions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 12: + return internalGetMutableBuildOptions(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.BuildProvenance.class, io.grafeas.v1beta1.provenance.BuildProvenance.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.BuildProvenance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getCommandsFieldBuilder(); + getBuiltArtifactsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + projectId_ = ""; + + if (commandsBuilder_ == null) { + commands_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + commandsBuilder_.clear(); + } + if (builtArtifactsBuilder_ == null) { + builtArtifacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + builtArtifactsBuilder_.clear(); + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + creator_ = ""; + + logsUri_ = ""; + + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + triggerId_ = ""; + + internalGetMutableBuildOptions().clear(); + builderVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.BuildProvenance getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.BuildProvenance.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.BuildProvenance build() { + io.grafeas.v1beta1.provenance.BuildProvenance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000004)) { + commands_ = java.util.Collections.unmodifiableList(commands_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.commands_ = commands_; + } else { + result.commands_ = commandsBuilder_.build(); + } + if (builtArtifactsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + builtArtifacts_ = java.util.Collections.unmodifiableList(builtArtifacts_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.builtArtifacts_ = builtArtifacts_; + } else { + result.builtArtifacts_ = builtArtifactsBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.creator_ = creator_; + result.logsUri_ = logsUri_; + if (sourceProvenanceBuilder_ == null) { + result.sourceProvenance_ = sourceProvenance_; + } else { + result.sourceProvenance_ = sourceProvenanceBuilder_.build(); + } + result.triggerId_ = triggerId_; + result.buildOptions_ = internalGetBuildOptions(); + result.buildOptions_.makeImmutable(); + result.builderVersion_ = builderVersion_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.BuildProvenance) { + return mergeFrom((io.grafeas.v1beta1.provenance.BuildProvenance)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.BuildProvenance other) { + if (other == io.grafeas.v1beta1.provenance.BuildProvenance.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (commandsBuilder_ == null) { + if (!other.commands_.isEmpty()) { + if (commands_.isEmpty()) { + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureCommandsIsMutable(); + commands_.addAll(other.commands_); + } + onChanged(); + } + } else { + if (!other.commands_.isEmpty()) { + if (commandsBuilder_.isEmpty()) { + commandsBuilder_.dispose(); + commandsBuilder_ = null; + commands_ = other.commands_; + bitField0_ = (bitField0_ & ~0x00000004); + commandsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getCommandsFieldBuilder() : null; + } else { + commandsBuilder_.addAllMessages(other.commands_); + } + } + } + if (builtArtifactsBuilder_ == null) { + if (!other.builtArtifacts_.isEmpty()) { + if (builtArtifacts_.isEmpty()) { + builtArtifacts_ = other.builtArtifacts_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.addAll(other.builtArtifacts_); + } + onChanged(); + } + } else { + if (!other.builtArtifacts_.isEmpty()) { + if (builtArtifactsBuilder_.isEmpty()) { + builtArtifactsBuilder_.dispose(); + builtArtifactsBuilder_ = null; + builtArtifacts_ = other.builtArtifacts_; + bitField0_ = (bitField0_ & ~0x00000008); + builtArtifactsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getBuiltArtifactsFieldBuilder() : null; + } else { + builtArtifactsBuilder_.addAllMessages(other.builtArtifacts_); + } + } + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getCreator().isEmpty()) { + creator_ = other.creator_; + onChanged(); + } + if (!other.getLogsUri().isEmpty()) { + logsUri_ = other.logsUri_; + onChanged(); + } + if (other.hasSourceProvenance()) { + mergeSourceProvenance(other.getSourceProvenance()); + } + if (!other.getTriggerId().isEmpty()) { + triggerId_ = other.triggerId_; + onChanged(); + } + internalGetMutableBuildOptions().mergeFrom( + other.internalGetBuildOptions()); + if (!other.getBuilderVersion().isEmpty()) { + builderVersion_ = other.builderVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.BuildProvenance parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.BuildProvenance) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + *
+     * Unique identifier of the build.
+     * 
+ * + * string id = 1; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Unique identifier of the build.
+     * 
+ * + * string id = 1; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Unique identifier of the build.
+     * 
+ * + * string id = 1; + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + *
+     * Unique identifier of the build.
+     * 
+ * + * string id = 1; + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + *
+     * Unique identifier of the build.
+     * 
+ * + * string id = 1; + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + *
+     * ID of the project.
+     * 
+ * + * string project_id = 2; + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * ID of the project.
+     * 
+ * + * string project_id = 2; + */ + public com.google.protobuf.ByteString + getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * ID of the project.
+     * 
+ * + * string project_id = 2; + */ + public Builder setProjectId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + *
+     * ID of the project.
+     * 
+ * + * string project_id = 2; + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + *
+     * ID of the project.
+     * 
+ * + * string project_id = 2; + */ + public Builder setProjectIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.util.List commands_ = + java.util.Collections.emptyList(); + private void ensureCommandsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + commands_ = new java.util.ArrayList(commands_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Command, io.grafeas.v1beta1.provenance.Command.Builder, io.grafeas.v1beta1.provenance.CommandOrBuilder> commandsBuilder_; + + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public java.util.List getCommandsList() { + if (commandsBuilder_ == null) { + return java.util.Collections.unmodifiableList(commands_); + } else { + return commandsBuilder_.getMessageList(); + } + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public int getCommandsCount() { + if (commandsBuilder_ == null) { + return commands_.size(); + } else { + return commandsBuilder_.getCount(); + } + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.Command getCommands(int index) { + if (commandsBuilder_ == null) { + return commands_.get(index); + } else { + return commandsBuilder_.getMessage(index); + } + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder setCommands( + int index, io.grafeas.v1beta1.provenance.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.set(index, value); + onChanged(); + } else { + commandsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder setCommands( + int index, io.grafeas.v1beta1.provenance.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.set(index, builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder addCommands(io.grafeas.v1beta1.provenance.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.add(value); + onChanged(); + } else { + commandsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder addCommands( + int index, io.grafeas.v1beta1.provenance.Command value) { + if (commandsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCommandsIsMutable(); + commands_.add(index, value); + onChanged(); + } else { + commandsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder addCommands( + io.grafeas.v1beta1.provenance.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.add(builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder addCommands( + int index, io.grafeas.v1beta1.provenance.Command.Builder builderForValue) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.add(index, builderForValue.build()); + onChanged(); + } else { + commandsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder addAllCommands( + java.lang.Iterable values) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, commands_); + onChanged(); + } else { + commandsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder clearCommands() { + if (commandsBuilder_ == null) { + commands_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + commandsBuilder_.clear(); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public Builder removeCommands(int index) { + if (commandsBuilder_ == null) { + ensureCommandsIsMutable(); + commands_.remove(index); + onChanged(); + } else { + commandsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.Command.Builder getCommandsBuilder( + int index) { + return getCommandsFieldBuilder().getBuilder(index); + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.CommandOrBuilder getCommandsOrBuilder( + int index) { + if (commandsBuilder_ == null) { + return commands_.get(index); } else { + return commandsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public java.util.List + getCommandsOrBuilderList() { + if (commandsBuilder_ != null) { + return commandsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(commands_); + } + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.Command.Builder addCommandsBuilder() { + return getCommandsFieldBuilder().addBuilder( + io.grafeas.v1beta1.provenance.Command.getDefaultInstance()); + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public io.grafeas.v1beta1.provenance.Command.Builder addCommandsBuilder( + int index) { + return getCommandsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.provenance.Command.getDefaultInstance()); + } + /** + *
+     * Commands requested by the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + public java.util.List + getCommandsBuilderList() { + return getCommandsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Command, io.grafeas.v1beta1.provenance.Command.Builder, io.grafeas.v1beta1.provenance.CommandOrBuilder> + getCommandsFieldBuilder() { + if (commandsBuilder_ == null) { + commandsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Command, io.grafeas.v1beta1.provenance.Command.Builder, io.grafeas.v1beta1.provenance.CommandOrBuilder>( + commands_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + commands_ = null; + } + return commandsBuilder_; + } + + private java.util.List builtArtifacts_ = + java.util.Collections.emptyList(); + private void ensureBuiltArtifactsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + builtArtifacts_ = new java.util.ArrayList(builtArtifacts_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Artifact, io.grafeas.v1beta1.provenance.Artifact.Builder, io.grafeas.v1beta1.provenance.ArtifactOrBuilder> builtArtifactsBuilder_; + + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public java.util.List getBuiltArtifactsList() { + if (builtArtifactsBuilder_ == null) { + return java.util.Collections.unmodifiableList(builtArtifacts_); + } else { + return builtArtifactsBuilder_.getMessageList(); + } + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public int getBuiltArtifactsCount() { + if (builtArtifactsBuilder_ == null) { + return builtArtifacts_.size(); + } else { + return builtArtifactsBuilder_.getCount(); + } + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.Artifact getBuiltArtifacts(int index) { + if (builtArtifactsBuilder_ == null) { + return builtArtifacts_.get(index); + } else { + return builtArtifactsBuilder_.getMessage(index); + } + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder setBuiltArtifacts( + int index, io.grafeas.v1beta1.provenance.Artifact value) { + if (builtArtifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.set(index, value); + onChanged(); + } else { + builtArtifactsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder setBuiltArtifacts( + int index, io.grafeas.v1beta1.provenance.Artifact.Builder builderForValue) { + if (builtArtifactsBuilder_ == null) { + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.set(index, builderForValue.build()); + onChanged(); + } else { + builtArtifactsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder addBuiltArtifacts(io.grafeas.v1beta1.provenance.Artifact value) { + if (builtArtifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.add(value); + onChanged(); + } else { + builtArtifactsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder addBuiltArtifacts( + int index, io.grafeas.v1beta1.provenance.Artifact value) { + if (builtArtifactsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.add(index, value); + onChanged(); + } else { + builtArtifactsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder addBuiltArtifacts( + io.grafeas.v1beta1.provenance.Artifact.Builder builderForValue) { + if (builtArtifactsBuilder_ == null) { + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.add(builderForValue.build()); + onChanged(); + } else { + builtArtifactsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder addBuiltArtifacts( + int index, io.grafeas.v1beta1.provenance.Artifact.Builder builderForValue) { + if (builtArtifactsBuilder_ == null) { + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.add(index, builderForValue.build()); + onChanged(); + } else { + builtArtifactsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder addAllBuiltArtifacts( + java.lang.Iterable values) { + if (builtArtifactsBuilder_ == null) { + ensureBuiltArtifactsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, builtArtifacts_); + onChanged(); + } else { + builtArtifactsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder clearBuiltArtifacts() { + if (builtArtifactsBuilder_ == null) { + builtArtifacts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + builtArtifactsBuilder_.clear(); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public Builder removeBuiltArtifacts(int index) { + if (builtArtifactsBuilder_ == null) { + ensureBuiltArtifactsIsMutable(); + builtArtifacts_.remove(index); + onChanged(); + } else { + builtArtifactsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.Artifact.Builder getBuiltArtifactsBuilder( + int index) { + return getBuiltArtifactsFieldBuilder().getBuilder(index); + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.ArtifactOrBuilder getBuiltArtifactsOrBuilder( + int index) { + if (builtArtifactsBuilder_ == null) { + return builtArtifacts_.get(index); } else { + return builtArtifactsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public java.util.List + getBuiltArtifactsOrBuilderList() { + if (builtArtifactsBuilder_ != null) { + return builtArtifactsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(builtArtifacts_); + } + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.Artifact.Builder addBuiltArtifactsBuilder() { + return getBuiltArtifactsFieldBuilder().addBuilder( + io.grafeas.v1beta1.provenance.Artifact.getDefaultInstance()); + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public io.grafeas.v1beta1.provenance.Artifact.Builder addBuiltArtifactsBuilder( + int index) { + return getBuiltArtifactsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.provenance.Artifact.getDefaultInstance()); + } + /** + *
+     * Output of the build.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + public java.util.List + getBuiltArtifactsBuilderList() { + return getBuiltArtifactsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Artifact, io.grafeas.v1beta1.provenance.Artifact.Builder, io.grafeas.v1beta1.provenance.ArtifactOrBuilder> + getBuiltArtifactsFieldBuilder() { + if (builtArtifactsBuilder_ == null) { + builtArtifactsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Artifact, io.grafeas.v1beta1.provenance.Artifact.Builder, io.grafeas.v1beta1.provenance.ArtifactOrBuilder>( + builtArtifacts_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + builtArtifacts_ = null; + } + return builtArtifactsBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Time at which the build was created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time at which execution of the build was started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * Time at which execution of the build was finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private java.lang.Object creator_ = ""; + /** + *
+     * E-mail address of the user who initiated this build. Note that this was the
+     * user's e-mail address at the time the build was initiated; this address may
+     * not represent the same end-user for all time.
+     * 
+ * + * string creator = 8; + */ + public java.lang.String getCreator() { + java.lang.Object ref = creator_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + creator_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * E-mail address of the user who initiated this build. Note that this was the
+     * user's e-mail address at the time the build was initiated; this address may
+     * not represent the same end-user for all time.
+     * 
+ * + * string creator = 8; + */ + public com.google.protobuf.ByteString + getCreatorBytes() { + java.lang.Object ref = creator_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + creator_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * E-mail address of the user who initiated this build. Note that this was the
+     * user's e-mail address at the time the build was initiated; this address may
+     * not represent the same end-user for all time.
+     * 
+ * + * string creator = 8; + */ + public Builder setCreator( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + creator_ = value; + onChanged(); + return this; + } + /** + *
+     * E-mail address of the user who initiated this build. Note that this was the
+     * user's e-mail address at the time the build was initiated; this address may
+     * not represent the same end-user for all time.
+     * 
+ * + * string creator = 8; + */ + public Builder clearCreator() { + + creator_ = getDefaultInstance().getCreator(); + onChanged(); + return this; + } + /** + *
+     * E-mail address of the user who initiated this build. Note that this was the
+     * user's e-mail address at the time the build was initiated; this address may
+     * not represent the same end-user for all time.
+     * 
+ * + * string creator = 8; + */ + public Builder setCreatorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + creator_ = value; + onChanged(); + return this; + } + + private java.lang.Object logsUri_ = ""; + /** + *
+     * URI where any logs for this provenance were written.
+     * 
+ * + * string logs_uri = 9; + */ + public java.lang.String getLogsUri() { + java.lang.Object ref = logsUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logsUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * URI where any logs for this provenance were written.
+     * 
+ * + * string logs_uri = 9; + */ + public com.google.protobuf.ByteString + getLogsUriBytes() { + java.lang.Object ref = logsUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logsUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * URI where any logs for this provenance were written.
+     * 
+ * + * string logs_uri = 9; + */ + public Builder setLogsUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logsUri_ = value; + onChanged(); + return this; + } + /** + *
+     * URI where any logs for this provenance were written.
+     * 
+ * + * string logs_uri = 9; + */ + public Builder clearLogsUri() { + + logsUri_ = getDefaultInstance().getLogsUri(); + onChanged(); + return this; + } + /** + *
+     * URI where any logs for this provenance were written.
+     * 
+ * + * string logs_uri = 9; + */ + public Builder setLogsUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logsUri_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.provenance.Source sourceProvenance_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Source, io.grafeas.v1beta1.provenance.Source.Builder, io.grafeas.v1beta1.provenance.SourceOrBuilder> sourceProvenanceBuilder_; + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public boolean hasSourceProvenance() { + return sourceProvenanceBuilder_ != null || sourceProvenance_ != null; + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public io.grafeas.v1beta1.provenance.Source getSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + return sourceProvenance_ == null ? io.grafeas.v1beta1.provenance.Source.getDefaultInstance() : sourceProvenance_; + } else { + return sourceProvenanceBuilder_.getMessage(); + } + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public Builder setSourceProvenance(io.grafeas.v1beta1.provenance.Source value) { + if (sourceProvenanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceProvenance_ = value; + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public Builder setSourceProvenance( + io.grafeas.v1beta1.provenance.Source.Builder builderForValue) { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = builderForValue.build(); + onChanged(); + } else { + sourceProvenanceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public Builder mergeSourceProvenance(io.grafeas.v1beta1.provenance.Source value) { + if (sourceProvenanceBuilder_ == null) { + if (sourceProvenance_ != null) { + sourceProvenance_ = + io.grafeas.v1beta1.provenance.Source.newBuilder(sourceProvenance_).mergeFrom(value).buildPartial(); + } else { + sourceProvenance_ = value; + } + onChanged(); + } else { + sourceProvenanceBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public Builder clearSourceProvenance() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenance_ = null; + onChanged(); + } else { + sourceProvenance_ = null; + sourceProvenanceBuilder_ = null; + } + + return this; + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public io.grafeas.v1beta1.provenance.Source.Builder getSourceProvenanceBuilder() { + + onChanged(); + return getSourceProvenanceFieldBuilder().getBuilder(); + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + public io.grafeas.v1beta1.provenance.SourceOrBuilder getSourceProvenanceOrBuilder() { + if (sourceProvenanceBuilder_ != null) { + return sourceProvenanceBuilder_.getMessageOrBuilder(); + } else { + return sourceProvenance_ == null ? + io.grafeas.v1beta1.provenance.Source.getDefaultInstance() : sourceProvenance_; + } + } + /** + *
+     * Details of the Source input to the build.
+     * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Source, io.grafeas.v1beta1.provenance.Source.Builder, io.grafeas.v1beta1.provenance.SourceOrBuilder> + getSourceProvenanceFieldBuilder() { + if (sourceProvenanceBuilder_ == null) { + sourceProvenanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.provenance.Source, io.grafeas.v1beta1.provenance.Source.Builder, io.grafeas.v1beta1.provenance.SourceOrBuilder>( + getSourceProvenance(), + getParentForChildren(), + isClean()); + sourceProvenance_ = null; + } + return sourceProvenanceBuilder_; + } + + private java.lang.Object triggerId_ = ""; + /** + *
+     * Trigger identifier if the build was triggered automatically; empty if not.
+     * 
+ * + * string trigger_id = 11; + */ + public java.lang.String getTriggerId() { + java.lang.Object ref = triggerId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + triggerId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Trigger identifier if the build was triggered automatically; empty if not.
+     * 
+ * + * string trigger_id = 11; + */ + public com.google.protobuf.ByteString + getTriggerIdBytes() { + java.lang.Object ref = triggerId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + triggerId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Trigger identifier if the build was triggered automatically; empty if not.
+     * 
+ * + * string trigger_id = 11; + */ + public Builder setTriggerId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + triggerId_ = value; + onChanged(); + return this; + } + /** + *
+     * Trigger identifier if the build was triggered automatically; empty if not.
+     * 
+ * + * string trigger_id = 11; + */ + public Builder clearTriggerId() { + + triggerId_ = getDefaultInstance().getTriggerId(); + onChanged(); + return this; + } + /** + *
+     * Trigger identifier if the build was triggered automatically; empty if not.
+     * 
+ * + * string trigger_id = 11; + */ + public Builder setTriggerIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + triggerId_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> buildOptions_; + private com.google.protobuf.MapField + internalGetBuildOptions() { + if (buildOptions_ == null) { + return com.google.protobuf.MapField.emptyMapField( + BuildOptionsDefaultEntryHolder.defaultEntry); + } + return buildOptions_; + } + private com.google.protobuf.MapField + internalGetMutableBuildOptions() { + onChanged();; + if (buildOptions_ == null) { + buildOptions_ = com.google.protobuf.MapField.newMapField( + BuildOptionsDefaultEntryHolder.defaultEntry); + } + if (!buildOptions_.isMutable()) { + buildOptions_ = buildOptions_.copy(); + } + return buildOptions_; + } + + public int getBuildOptionsCount() { + return internalGetBuildOptions().getMap().size(); + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public boolean containsBuildOptions( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetBuildOptions().getMap().containsKey(key); + } + /** + * Use {@link #getBuildOptionsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getBuildOptions() { + return getBuildOptionsMap(); + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public java.util.Map getBuildOptionsMap() { + return internalGetBuildOptions().getMap(); + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public java.lang.String getBuildOptionsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetBuildOptions().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public java.lang.String getBuildOptionsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetBuildOptions().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearBuildOptions() { + internalGetMutableBuildOptions().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public Builder removeBuildOptions( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableBuildOptions().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableBuildOptions() { + return internalGetMutableBuildOptions().getMutableMap(); + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + public Builder putBuildOptions( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableBuildOptions().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Special options applied to this build. This is a catch-all field where
+     * build providers can enter any desired additional details.
+     * 
+ * + * map<string, string> build_options = 12; + */ + + public Builder putAllBuildOptions( + java.util.Map values) { + internalGetMutableBuildOptions().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object builderVersion_ = ""; + /** + *
+     * Version string of the builder at the time this build was executed.
+     * 
+ * + * string builder_version = 13; + */ + public java.lang.String getBuilderVersion() { + java.lang.Object ref = builderVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + builderVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Version string of the builder at the time this build was executed.
+     * 
+ * + * string builder_version = 13; + */ + public com.google.protobuf.ByteString + getBuilderVersionBytes() { + java.lang.Object ref = builderVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + builderVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Version string of the builder at the time this build was executed.
+     * 
+ * + * string builder_version = 13; + */ + public Builder setBuilderVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + builderVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * Version string of the builder at the time this build was executed.
+     * 
+ * + * string builder_version = 13; + */ + public Builder clearBuilderVersion() { + + builderVersion_ = getDefaultInstance().getBuilderVersion(); + onChanged(); + return this; + } + /** + *
+     * Version string of the builder at the time this build was executed.
+     * 
+ * + * string builder_version = 13; + */ + public Builder setBuilderVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + builderVersion_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.BuildProvenance) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.BuildProvenance) + private static final io.grafeas.v1beta1.provenance.BuildProvenance DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.BuildProvenance(); + } + + public static io.grafeas.v1beta1.provenance.BuildProvenance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BuildProvenance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BuildProvenance(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.BuildProvenance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenanceOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenanceOrBuilder.java new file mode 100644 index 000000000000..c70df1662c2f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/BuildProvenanceOrBuilder.java @@ -0,0 +1,368 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface BuildProvenanceOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.BuildProvenance) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Unique identifier of the build.
+   * 
+ * + * string id = 1; + */ + java.lang.String getId(); + /** + *
+   * Unique identifier of the build.
+   * 
+ * + * string id = 1; + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * ID of the project.
+   * 
+ * + * string project_id = 2; + */ + java.lang.String getProjectId(); + /** + *
+   * ID of the project.
+   * 
+ * + * string project_id = 2; + */ + com.google.protobuf.ByteString + getProjectIdBytes(); + + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + java.util.List + getCommandsList(); + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + io.grafeas.v1beta1.provenance.Command getCommands(int index); + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + int getCommandsCount(); + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + java.util.List + getCommandsOrBuilderList(); + /** + *
+   * Commands requested by the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Command commands = 3; + */ + io.grafeas.v1beta1.provenance.CommandOrBuilder getCommandsOrBuilder( + int index); + + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + java.util.List + getBuiltArtifactsList(); + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + io.grafeas.v1beta1.provenance.Artifact getBuiltArtifacts(int index); + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + int getBuiltArtifactsCount(); + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + java.util.List + getBuiltArtifactsOrBuilderList(); + /** + *
+   * Output of the build.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Artifact built_artifacts = 4; + */ + io.grafeas.v1beta1.provenance.ArtifactOrBuilder getBuiltArtifactsOrBuilder( + int index); + + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + boolean hasCreateTime(); + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Time at which the build was created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + boolean hasStartTime(); + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Time at which execution of the build was started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + boolean hasEndTime(); + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * Time at which execution of the build was finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * E-mail address of the user who initiated this build. Note that this was the
+   * user's e-mail address at the time the build was initiated; this address may
+   * not represent the same end-user for all time.
+   * 
+ * + * string creator = 8; + */ + java.lang.String getCreator(); + /** + *
+   * E-mail address of the user who initiated this build. Note that this was the
+   * user's e-mail address at the time the build was initiated; this address may
+   * not represent the same end-user for all time.
+   * 
+ * + * string creator = 8; + */ + com.google.protobuf.ByteString + getCreatorBytes(); + + /** + *
+   * URI where any logs for this provenance were written.
+   * 
+ * + * string logs_uri = 9; + */ + java.lang.String getLogsUri(); + /** + *
+   * URI where any logs for this provenance were written.
+   * 
+ * + * string logs_uri = 9; + */ + com.google.protobuf.ByteString + getLogsUriBytes(); + + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + boolean hasSourceProvenance(); + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + io.grafeas.v1beta1.provenance.Source getSourceProvenance(); + /** + *
+   * Details of the Source input to the build.
+   * 
+ * + * .grafeas.v1beta1.provenance.Source source_provenance = 10; + */ + io.grafeas.v1beta1.provenance.SourceOrBuilder getSourceProvenanceOrBuilder(); + + /** + *
+   * Trigger identifier if the build was triggered automatically; empty if not.
+   * 
+ * + * string trigger_id = 11; + */ + java.lang.String getTriggerId(); + /** + *
+   * Trigger identifier if the build was triggered automatically; empty if not.
+   * 
+ * + * string trigger_id = 11; + */ + com.google.protobuf.ByteString + getTriggerIdBytes(); + + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + int getBuildOptionsCount(); + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + boolean containsBuildOptions( + java.lang.String key); + /** + * Use {@link #getBuildOptionsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getBuildOptions(); + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + java.util.Map + getBuildOptionsMap(); + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + java.lang.String getBuildOptionsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Special options applied to this build. This is a catch-all field where
+   * build providers can enter any desired additional details.
+   * 
+ * + * map<string, string> build_options = 12; + */ + + java.lang.String getBuildOptionsOrThrow( + java.lang.String key); + + /** + *
+   * Version string of the builder at the time this build was executed.
+   * 
+ * + * string builder_version = 13; + */ + java.lang.String getBuilderVersion(); + /** + *
+   * Version string of the builder at the time this build was executed.
+   * 
+ * + * string builder_version = 13; + */ + com.google.protobuf.ByteString + getBuilderVersionBytes(); +} 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 new file mode 100644 index 000000000000..9bbbbef655e0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Command.java @@ -0,0 +1,1579 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Command describes a step performed as part of the build pipeline.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Command} + */ +public final class Command extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.Command) + CommandOrBuilder { +private static final long serialVersionUID = 0L; + // Use Command.newBuilder() to construct. + private Command(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Command() { + name_ = ""; + env_ = com.google.protobuf.LazyStringArrayList.EMPTY; + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + dir_ = ""; + id_ = ""; + waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Command( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + env_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + env_.add(s); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + args_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + args_.add(s); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + dir_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + waitFor_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000020; + } + waitFor_.add(s); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + env_ = env_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + args_ = args_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + waitFor_ = waitFor_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Command_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Command_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Command.class, io.grafeas.v1beta1.provenance.Command.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Name of the command, as presented on the command line, or if the command is
+   * packaged as a Docker container, as presented to `docker pull`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Name of the command, as presented on the command line, or if the command is
+   * packaged as a Docker container, as presented to `docker pull`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENV_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList env_; + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + public com.google.protobuf.ProtocolStringList + getEnvList() { + return env_; + } + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + public int getEnvCount() { + return env_.size(); + } + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + public java.lang.String getEnv(int index) { + return env_.get(index); + } + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + public com.google.protobuf.ByteString + getEnvBytes(int index) { + return env_.getByteString(index); + } + + public static final int ARGS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList args_; + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + public com.google.protobuf.ProtocolStringList + getArgsList() { + return args_; + } + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + public int getArgsCount() { + return args_.size(); + } + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + public com.google.protobuf.ByteString + getArgsBytes(int index) { + return args_.getByteString(index); + } + + public static final int DIR_FIELD_NUMBER = 4; + private volatile java.lang.Object dir_; + /** + *
+   * Working directory (relative to project source root) used when running this
+   * command.
+   * 
+ * + * string dir = 4; + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } + } + /** + *
+   * Working directory (relative to project source root) used when running this
+   * command.
+   * 
+ * + * string dir = 4; + */ + public com.google.protobuf.ByteString + getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ID_FIELD_NUMBER = 5; + private volatile java.lang.Object id_; + /** + *
+   * Optional unique identifier for this command, used in wait_for to reference
+   * this command as a dependency.
+   * 
+ * + * string id = 5; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } + } + /** + *
+   * Optional unique identifier for this command, used in wait_for to reference
+   * this command as a dependency.
+   * 
+ * + * string id = 5; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WAIT_FOR_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList waitFor_; + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + public com.google.protobuf.ProtocolStringList + getWaitForList() { + return waitFor_; + } + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + public int getWaitForCount() { + return waitFor_.size(); + } + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + public java.lang.String getWaitFor(int index) { + return waitFor_.get(index); + } + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + public com.google.protobuf.ByteString + getWaitForBytes(int index) { + return waitFor_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + for (int i = 0; i < env_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, env_.getRaw(i)); + } + for (int i = 0; i < args_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, args_.getRaw(i)); + } + if (!getDirBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dir_); + } + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, id_); + } + for (int i = 0; i < waitFor_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, waitFor_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + { + int dataSize = 0; + for (int i = 0; i < env_.size(); i++) { + dataSize += computeStringSizeNoTag(env_.getRaw(i)); + } + size += dataSize; + size += 1 * getEnvList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < args_.size(); i++) { + dataSize += computeStringSizeNoTag(args_.getRaw(i)); + } + size += dataSize; + size += 1 * getArgsList().size(); + } + if (!getDirBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dir_); + } + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, id_); + } + { + int dataSize = 0; + for (int i = 0; i < waitFor_.size(); i++) { + dataSize += computeStringSizeNoTag(waitFor_.getRaw(i)); + } + size += dataSize; + size += 1 * getWaitForList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.Command)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.Command other = (io.grafeas.v1beta1.provenance.Command) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && getEnvList() + .equals(other.getEnvList()); + result = result && getArgsList() + .equals(other.getArgsList()); + result = result && getDir() + .equals(other.getDir()); + result = result && getId() + .equals(other.getId()); + result = result && getWaitForList() + .equals(other.getWaitForList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (getEnvCount() > 0) { + hash = (37 * hash) + ENV_FIELD_NUMBER; + hash = (53 * hash) + getEnvList().hashCode(); + } + if (getArgsCount() > 0) { + hash = (37 * hash) + ARGS_FIELD_NUMBER; + hash = (53 * hash) + getArgsList().hashCode(); + } + hash = (37 * hash) + DIR_FIELD_NUMBER; + hash = (53 * hash) + getDir().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (getWaitForCount() > 0) { + hash = (37 * hash) + WAIT_FOR_FIELD_NUMBER; + hash = (53 * hash) + getWaitForList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.Command parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Command parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Command parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Command parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.Command prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Command describes a step performed as part of the build pipeline.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Command} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.Command) + io.grafeas.v1beta1.provenance.CommandOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Command_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Command_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Command.class, io.grafeas.v1beta1.provenance.Command.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.Command.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + env_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + dir_ = ""; + + id_ = ""; + + waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Command_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Command getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.Command.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Command build() { + io.grafeas.v1beta1.provenance.Command result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000002)) { + env_ = env_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.env_ = env_; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + args_ = args_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.args_ = args_; + result.dir_ = dir_; + result.id_ = id_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + waitFor_ = waitFor_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.waitFor_ = waitFor_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.Command) { + return mergeFrom((io.grafeas.v1beta1.provenance.Command)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.Command other) { + if (other == io.grafeas.v1beta1.provenance.Command.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.env_.isEmpty()) { + if (env_.isEmpty()) { + env_ = other.env_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEnvIsMutable(); + env_.addAll(other.env_); + } + onChanged(); + } + if (!other.args_.isEmpty()) { + if (args_.isEmpty()) { + args_ = other.args_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureArgsIsMutable(); + args_.addAll(other.args_); + } + onChanged(); + } + if (!other.getDir().isEmpty()) { + dir_ = other.dir_; + onChanged(); + } + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.waitFor_.isEmpty()) { + if (waitFor_.isEmpty()) { + waitFor_ = other.waitFor_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureWaitForIsMutable(); + waitFor_.addAll(other.waitFor_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.Command parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.Command) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Name of the command, as presented on the command line, or if the command is
+     * packaged as a Docker container, as presented to `docker pull`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Name of the command, as presented on the command line, or if the command is
+     * packaged as a Docker container, as presented to `docker pull`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Name of the command, as presented on the command line, or if the command is
+     * packaged as a Docker container, as presented to `docker pull`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Name of the command, as presented on the command line, or if the command is
+     * packaged as a Docker container, as presented to `docker pull`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Name of the command, as presented on the command line, or if the command is
+     * packaged as a Docker container, as presented to `docker pull`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList env_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureEnvIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + env_ = new com.google.protobuf.LazyStringArrayList(env_); + bitField0_ |= 0x00000002; + } + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public com.google.protobuf.ProtocolStringList + getEnvList() { + return env_.getUnmodifiableView(); + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public int getEnvCount() { + return env_.size(); + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public java.lang.String getEnv(int index) { + return env_.get(index); + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public com.google.protobuf.ByteString + getEnvBytes(int index) { + return env_.getByteString(index); + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public Builder setEnv( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvIsMutable(); + env_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public Builder addEnv( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnvIsMutable(); + env_.add(value); + onChanged(); + return this; + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public Builder addAllEnv( + java.lang.Iterable values) { + ensureEnvIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, env_); + onChanged(); + return this; + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public Builder clearEnv() { + env_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + *
+     * Environment variables set before running this command.
+     * 
+ * + * repeated string env = 2; + */ + public Builder addEnvBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureEnvIsMutable(); + env_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureArgsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + args_ = new com.google.protobuf.LazyStringArrayList(args_); + bitField0_ |= 0x00000004; + } + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public com.google.protobuf.ProtocolStringList + getArgsList() { + return args_.getUnmodifiableView(); + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public int getArgsCount() { + return args_.size(); + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public java.lang.String getArgs(int index) { + return args_.get(index); + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public com.google.protobuf.ByteString + getArgsBytes(int index) { + return args_.getByteString(index); + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public Builder setArgs( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public Builder addArgs( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureArgsIsMutable(); + args_.add(value); + onChanged(); + return this; + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public Builder addAllArgs( + java.lang.Iterable values) { + ensureArgsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, args_); + onChanged(); + return this; + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public Builder clearArgs() { + args_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+     * Command-line arguments used when executing this command.
+     * 
+ * + * repeated string args = 3; + */ + public Builder addArgsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureArgsIsMutable(); + args_.add(value); + onChanged(); + return this; + } + + private java.lang.Object dir_ = ""; + /** + *
+     * Working directory (relative to project source root) used when running this
+     * command.
+     * 
+ * + * string dir = 4; + */ + public java.lang.String getDir() { + java.lang.Object ref = dir_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dir_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Working directory (relative to project source root) used when running this
+     * command.
+     * 
+ * + * string dir = 4; + */ + public com.google.protobuf.ByteString + getDirBytes() { + java.lang.Object ref = dir_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dir_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Working directory (relative to project source root) used when running this
+     * command.
+     * 
+ * + * string dir = 4; + */ + public Builder setDir( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dir_ = value; + onChanged(); + return this; + } + /** + *
+     * Working directory (relative to project source root) used when running this
+     * command.
+     * 
+ * + * string dir = 4; + */ + public Builder clearDir() { + + dir_ = getDefaultInstance().getDir(); + onChanged(); + return this; + } + /** + *
+     * Working directory (relative to project source root) used when running this
+     * command.
+     * 
+ * + * string dir = 4; + */ + public Builder setDirBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dir_ = value; + onChanged(); + return this; + } + + private java.lang.Object id_ = ""; + /** + *
+     * Optional unique identifier for this command, used in wait_for to reference
+     * this command as a dependency.
+     * 
+ * + * string id = 5; + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional unique identifier for this command, used in wait_for to reference
+     * this command as a dependency.
+     * 
+ * + * string id = 5; + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional unique identifier for this command, used in wait_for to reference
+     * this command as a dependency.
+     * 
+ * + * string id = 5; + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional unique identifier for this command, used in wait_for to reference
+     * this command as a dependency.
+     * 
+ * + * string id = 5; + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + *
+     * Optional unique identifier for this command, used in wait_for to reference
+     * this command as a dependency.
+     * 
+ * + * string id = 5; + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureWaitForIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + waitFor_ = new com.google.protobuf.LazyStringArrayList(waitFor_); + bitField0_ |= 0x00000020; + } + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public com.google.protobuf.ProtocolStringList + getWaitForList() { + return waitFor_.getUnmodifiableView(); + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public int getWaitForCount() { + return waitFor_.size(); + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public java.lang.String getWaitFor(int index) { + return waitFor_.get(index); + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public com.google.protobuf.ByteString + getWaitForBytes(int index) { + return waitFor_.getByteString(index); + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public Builder setWaitFor( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWaitForIsMutable(); + waitFor_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public Builder addWaitFor( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWaitForIsMutable(); + waitFor_.add(value); + onChanged(); + return this; + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public Builder addAllWaitFor( + java.lang.Iterable values) { + ensureWaitForIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, waitFor_); + onChanged(); + return this; + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public Builder clearWaitFor() { + waitFor_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + *
+     * The ID(s) of the command(s) that this command depends on.
+     * 
+ * + * repeated string wait_for = 6; + */ + public Builder addWaitForBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureWaitForIsMutable(); + waitFor_.add(value); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.Command) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.Command) + private static final io.grafeas.v1beta1.provenance.Command DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.Command(); + } + + public static io.grafeas.v1beta1.provenance.Command getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Command parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Command(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Command getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/CommandOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/CommandOrBuilder.java new file mode 100644 index 000000000000..56c4adaa1077 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/CommandOrBuilder.java @@ -0,0 +1,174 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface CommandOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.Command) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Name of the command, as presented on the command line, or if the command is
+   * packaged as a Docker container, as presented to `docker pull`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Name of the command, as presented on the command line, or if the command is
+   * packaged as a Docker container, as presented to `docker pull`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + java.util.List + getEnvList(); + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + int getEnvCount(); + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + java.lang.String getEnv(int index); + /** + *
+   * Environment variables set before running this command.
+   * 
+ * + * repeated string env = 2; + */ + com.google.protobuf.ByteString + getEnvBytes(int index); + + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + java.util.List + getArgsList(); + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + int getArgsCount(); + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + java.lang.String getArgs(int index); + /** + *
+   * Command-line arguments used when executing this command.
+   * 
+ * + * repeated string args = 3; + */ + com.google.protobuf.ByteString + getArgsBytes(int index); + + /** + *
+   * Working directory (relative to project source root) used when running this
+   * command.
+   * 
+ * + * string dir = 4; + */ + java.lang.String getDir(); + /** + *
+   * Working directory (relative to project source root) used when running this
+   * command.
+   * 
+ * + * string dir = 4; + */ + com.google.protobuf.ByteString + getDirBytes(); + + /** + *
+   * Optional unique identifier for this command, used in wait_for to reference
+   * this command as a dependency.
+   * 
+ * + * string id = 5; + */ + java.lang.String getId(); + /** + *
+   * Optional unique identifier for this command, used in wait_for to reference
+   * this command as a dependency.
+   * 
+ * + * string id = 5; + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + java.util.List + getWaitForList(); + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + int getWaitForCount(); + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + java.lang.String getWaitFor(int index); + /** + *
+   * The ID(s) of the command(s) that this command depends on.
+   * 
+ * + * repeated string wait_for = 6; + */ + com.google.protobuf.ByteString + getWaitForBytes(int index); +} 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 new file mode 100644 index 000000000000..cb0a88386c80 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashes.java @@ -0,0 +1,861 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Container message for hashes of byte content of files, used in Source
+ * messages to verify integrity of source input to the build.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.FileHashes} + */ +public final class FileHashes extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.FileHashes) + FileHashesOrBuilder { +private static final long serialVersionUID = 0L; + // Use FileHashes.newBuilder() to construct. + private FileHashes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FileHashes() { + fileHash_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FileHashes( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + fileHash_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fileHash_.add( + input.readMessage(io.grafeas.v1beta1.provenance.Hash.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + fileHash_ = java.util.Collections.unmodifiableList(fileHash_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_FileHashes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.FileHashes.class, io.grafeas.v1beta1.provenance.FileHashes.Builder.class); + } + + public static final int FILE_HASH_FIELD_NUMBER = 1; + private java.util.List fileHash_; + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public java.util.List getFileHashList() { + return fileHash_; + } + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public java.util.List + getFileHashOrBuilderList() { + return fileHash_; + } + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public int getFileHashCount() { + return fileHash_.size(); + } + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.Hash getFileHash(int index) { + return fileHash_.get(index); + } + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.HashOrBuilder getFileHashOrBuilder( + int index) { + return fileHash_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < fileHash_.size(); i++) { + output.writeMessage(1, fileHash_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < fileHash_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, fileHash_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.FileHashes)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.FileHashes other = (io.grafeas.v1beta1.provenance.FileHashes) obj; + + boolean result = true; + result = result && getFileHashList() + .equals(other.getFileHashList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFileHashCount() > 0) { + hash = (37 * hash) + FILE_HASH_FIELD_NUMBER; + hash = (53 * hash) + getFileHashList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.FileHashes parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.FileHashes prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Container message for hashes of byte content of files, used in Source
+   * messages to verify integrity of source input to the build.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.FileHashes} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.FileHashes) + io.grafeas.v1beta1.provenance.FileHashesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_FileHashes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.FileHashes.class, io.grafeas.v1beta1.provenance.FileHashes.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.FileHashes.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFileHashFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (fileHashBuilder_ == null) { + fileHash_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fileHashBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.FileHashes getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.FileHashes.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.FileHashes build() { + io.grafeas.v1beta1.provenance.FileHashes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.FileHashes buildPartial() { + io.grafeas.v1beta1.provenance.FileHashes result = new io.grafeas.v1beta1.provenance.FileHashes(this); + int from_bitField0_ = bitField0_; + if (fileHashBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + fileHash_ = java.util.Collections.unmodifiableList(fileHash_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fileHash_ = fileHash_; + } else { + result.fileHash_ = fileHashBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.FileHashes) { + return mergeFrom((io.grafeas.v1beta1.provenance.FileHashes)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.FileHashes other) { + if (other == io.grafeas.v1beta1.provenance.FileHashes.getDefaultInstance()) return this; + if (fileHashBuilder_ == null) { + if (!other.fileHash_.isEmpty()) { + if (fileHash_.isEmpty()) { + fileHash_ = other.fileHash_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFileHashIsMutable(); + fileHash_.addAll(other.fileHash_); + } + onChanged(); + } + } else { + if (!other.fileHash_.isEmpty()) { + if (fileHashBuilder_.isEmpty()) { + fileHashBuilder_.dispose(); + fileHashBuilder_ = null; + fileHash_ = other.fileHash_; + bitField0_ = (bitField0_ & ~0x00000001); + fileHashBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFileHashFieldBuilder() : null; + } else { + fileHashBuilder_.addAllMessages(other.fileHash_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.FileHashes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.FileHashes) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List fileHash_ = + java.util.Collections.emptyList(); + private void ensureFileHashIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + fileHash_ = new java.util.ArrayList(fileHash_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder> fileHashBuilder_; + + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public java.util.List getFileHashList() { + if (fileHashBuilder_ == null) { + return java.util.Collections.unmodifiableList(fileHash_); + } else { + return fileHashBuilder_.getMessageList(); + } + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public int getFileHashCount() { + if (fileHashBuilder_ == null) { + return fileHash_.size(); + } else { + return fileHashBuilder_.getCount(); + } + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.Hash getFileHash(int index) { + if (fileHashBuilder_ == null) { + return fileHash_.get(index); + } else { + return fileHashBuilder_.getMessage(index); + } + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder setFileHash( + int index, io.grafeas.v1beta1.provenance.Hash value) { + if (fileHashBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileHashIsMutable(); + fileHash_.set(index, value); + onChanged(); + } else { + fileHashBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder setFileHash( + int index, io.grafeas.v1beta1.provenance.Hash.Builder builderForValue) { + if (fileHashBuilder_ == null) { + ensureFileHashIsMutable(); + fileHash_.set(index, builderForValue.build()); + onChanged(); + } else { + fileHashBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder addFileHash(io.grafeas.v1beta1.provenance.Hash value) { + if (fileHashBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileHashIsMutable(); + fileHash_.add(value); + onChanged(); + } else { + fileHashBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder addFileHash( + int index, io.grafeas.v1beta1.provenance.Hash value) { + if (fileHashBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFileHashIsMutable(); + fileHash_.add(index, value); + onChanged(); + } else { + fileHashBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder addFileHash( + io.grafeas.v1beta1.provenance.Hash.Builder builderForValue) { + if (fileHashBuilder_ == null) { + ensureFileHashIsMutable(); + fileHash_.add(builderForValue.build()); + onChanged(); + } else { + fileHashBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder addFileHash( + int index, io.grafeas.v1beta1.provenance.Hash.Builder builderForValue) { + if (fileHashBuilder_ == null) { + ensureFileHashIsMutable(); + fileHash_.add(index, builderForValue.build()); + onChanged(); + } else { + fileHashBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder addAllFileHash( + java.lang.Iterable values) { + if (fileHashBuilder_ == null) { + ensureFileHashIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fileHash_); + onChanged(); + } else { + fileHashBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder clearFileHash() { + if (fileHashBuilder_ == null) { + fileHash_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fileHashBuilder_.clear(); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public Builder removeFileHash(int index) { + if (fileHashBuilder_ == null) { + ensureFileHashIsMutable(); + fileHash_.remove(index); + onChanged(); + } else { + fileHashBuilder_.remove(index); + } + return this; + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.Hash.Builder getFileHashBuilder( + int index) { + return getFileHashFieldBuilder().getBuilder(index); + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.HashOrBuilder getFileHashOrBuilder( + int index) { + if (fileHashBuilder_ == null) { + return fileHash_.get(index); } else { + return fileHashBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public java.util.List + getFileHashOrBuilderList() { + if (fileHashBuilder_ != null) { + return fileHashBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fileHash_); + } + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.Hash.Builder addFileHashBuilder() { + return getFileHashFieldBuilder().addBuilder( + io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()); + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public io.grafeas.v1beta1.provenance.Hash.Builder addFileHashBuilder( + int index) { + return getFileHashFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()); + } + /** + *
+     * Collection of file hashes.
+     * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + public java.util.List + getFileHashBuilderList() { + return getFileHashFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder> + getFileHashFieldBuilder() { + if (fileHashBuilder_ == null) { + fileHashBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.provenance.Hash, io.grafeas.v1beta1.provenance.Hash.Builder, io.grafeas.v1beta1.provenance.HashOrBuilder>( + fileHash_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + fileHash_ = null; + } + return fileHashBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.FileHashes) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.FileHashes) + private static final io.grafeas.v1beta1.provenance.FileHashes DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.FileHashes(); + } + + public static io.grafeas.v1beta1.provenance.FileHashes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileHashes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileHashes(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.FileHashes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashesOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashesOrBuilder.java new file mode 100644 index 000000000000..4ab2d74296e7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/FileHashesOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface FileHashesOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.FileHashes) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + java.util.List + getFileHashList(); + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + io.grafeas.v1beta1.provenance.Hash getFileHash(int index); + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + int getFileHashCount(); + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + java.util.List + getFileHashOrBuilderList(); + /** + *
+   * Collection of file hashes.
+   * 
+ * + * repeated .grafeas.v1beta1.provenance.Hash file_hash = 1; + */ + io.grafeas.v1beta1.provenance.HashOrBuilder getFileHashOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..17c16e9cd127 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Hash.java @@ -0,0 +1,730 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Container message for hash values.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Hash} + */ +public final class Hash extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.Hash) + HashOrBuilder { +private static final long serialVersionUID = 0L; + // Use Hash.newBuilder() to construct. + private Hash(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Hash() { + type_ = 0; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Hash( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + type_ = rawValue; + break; + } + case 18: { + + value_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Hash_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Hash_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Hash.class, io.grafeas.v1beta1.provenance.Hash.Builder.class); + } + + /** + *
+   * Specifies the hash algorithm, if any.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.provenance.Hash.HashType} + */ + public enum HashType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * HASH_TYPE_UNSPECIFIED = 0; + */ + HASH_TYPE_UNSPECIFIED(0), + /** + *
+     * A SHA-256 hash.
+     * 
+ * + * SHA256 = 1; + */ + SHA256(1), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * HASH_TYPE_UNSPECIFIED = 0; + */ + public static final int HASH_TYPE_UNSPECIFIED_VALUE = 0; + /** + *
+     * A SHA-256 hash.
+     * 
+ * + * SHA256 = 1; + */ + public static final int SHA256_VALUE = 1; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static HashType valueOf(int value) { + return forNumber(value); + } + + public static HashType forNumber(int value) { + switch (value) { + case 0: return HASH_TYPE_UNSPECIFIED; + case 1: return SHA256; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + HashType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public HashType findValueByNumber(int number) { + return HashType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Hash.getDescriptor().getEnumTypes().get(0); + } + + private static final HashType[] VALUES = values(); + + public static HashType valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private HashType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.provenance.Hash.HashType) + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_; + /** + *
+   * The type of hash that was performed.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+   * The type of hash that was performed.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public io.grafeas.v1beta1.provenance.Hash.HashType getType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.provenance.Hash.HashType result = io.grafeas.v1beta1.provenance.Hash.HashType.valueOf(type_); + return result == null ? io.grafeas.v1beta1.provenance.Hash.HashType.UNRECOGNIZED : result; + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + *
+   * The hash value.
+   * 
+ * + * bytes value = 2; + */ + public com.google.protobuf.ByteString getValue() { + return value_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (type_ != io.grafeas.v1beta1.provenance.Hash.HashType.HASH_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(1, type_); + } + if (!value_.isEmpty()) { + output.writeBytes(2, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != io.grafeas.v1beta1.provenance.Hash.HashType.HASH_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.Hash)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.Hash other = (io.grafeas.v1beta1.provenance.Hash) obj; + + boolean result = true; + result = result && type_ == other.type_; + result = result && getValue() + .equals(other.getValue()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Hash parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Hash parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Hash parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.Hash prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Container message for hash values.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Hash} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.Hash) + io.grafeas.v1beta1.provenance.HashOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Hash_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Hash_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Hash.class, io.grafeas.v1beta1.provenance.Hash.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.Hash.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = 0; + + value_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Hash_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Hash getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.Hash.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Hash build() { + io.grafeas.v1beta1.provenance.Hash result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Hash buildPartial() { + io.grafeas.v1beta1.provenance.Hash result = new io.grafeas.v1beta1.provenance.Hash(this); + result.type_ = type_; + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.Hash) { + return mergeFrom((io.grafeas.v1beta1.provenance.Hash)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.Hash other) { + if (other == io.grafeas.v1beta1.provenance.Hash.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { + setValue(other.getValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.Hash parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.Hash) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int type_ = 0; + /** + *
+     * The type of hash that was performed.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public int getTypeValue() { + return type_; + } + /** + *
+     * The type of hash that was performed.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public Builder setTypeValue(int value) { + type_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of hash that was performed.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public io.grafeas.v1beta1.provenance.Hash.HashType getType() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.provenance.Hash.HashType result = io.grafeas.v1beta1.provenance.Hash.HashType.valueOf(type_); + return result == null ? io.grafeas.v1beta1.provenance.Hash.HashType.UNRECOGNIZED : result; + } + /** + *
+     * The type of hash that was performed.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public Builder setType(io.grafeas.v1beta1.provenance.Hash.HashType value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The type of hash that was performed.
+     * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + public Builder clearType() { + + type_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The hash value.
+     * 
+ * + * bytes value = 2; + */ + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + *
+     * The hash value.
+     * 
+ * + * bytes value = 2; + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+     * The hash value.
+     * 
+ * + * bytes value = 2; + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.Hash) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.Hash) + private static final io.grafeas.v1beta1.provenance.Hash DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.Hash(); + } + + public static io.grafeas.v1beta1.provenance.Hash getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Hash parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Hash(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Hash getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/HashOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/HashOrBuilder.java new file mode 100644 index 000000000000..135c4c62e9ae --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/HashOrBuilder.java @@ -0,0 +1,35 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface HashOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.Hash) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The type of hash that was performed.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + int getTypeValue(); + /** + *
+   * The type of hash that was performed.
+   * 
+ * + * .grafeas.v1beta1.provenance.Hash.HashType type = 1; + */ + io.grafeas.v1beta1.provenance.Hash.HashType getType(); + + /** + *
+   * The hash value.
+   * 
+ * + * bytes value = 2; + */ + com.google.protobuf.ByteString getValue(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/NoteName.java new file mode 100644 index 000000000000..f680ab9f4ccb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.provenance; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/OccurrenceName.java new file mode 100644 index 000000000000..b07489a578dd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.provenance; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ProjectName.java new file mode 100644 index 000000000000..62046694c955 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.provenance; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-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 new file mode 100644 index 000000000000..cdb5e80f6c7b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Provenance.java @@ -0,0 +1,175 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public final class Provenance { + private Provenance() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_BuildProvenance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_Source_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_Source_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_FileHashes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_Hash_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_Hash_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_Command_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_Command_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_provenance_Artifact_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_provenance_Artifact_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nEgoogle/devtools/containeranalysis/v1be" + + "ta1/provenance/provenance.proto\022\032grafeas" + + ".v1beta1.provenance\032\037google/protobuf/tim" + + "estamp.proto\032=google/devtools/containera" + + "nalysis/v1beta1/source/source.proto\"\320\004\n\017" + + "BuildProvenance\022\n\n\002id\030\001 \001(\t\022\022\n\nproject_i" + + "d\030\002 \001(\t\0225\n\010commands\030\003 \003(\0132#.grafeas.v1be" + + "ta1.provenance.Command\022=\n\017built_artifact" + + "s\030\004 \003(\0132$.grafeas.v1beta1.provenance.Art" + + "ifact\022/\n\013create_time\030\005 \001(\0132\032.google.prot" + + "obuf.Timestamp\022.\n\nstart_time\030\006 \001(\0132\032.goo" + + "gle.protobuf.Timestamp\022,\n\010end_time\030\007 \001(\013" + + "2\032.google.protobuf.Timestamp\022\017\n\007creator\030" + + "\010 \001(\t\022\020\n\010logs_uri\030\t \001(\t\022=\n\021source_proven" + + "ance\030\n \001(\0132\".grafeas.v1beta1.provenance." + + "Source\022\022\n\ntrigger_id\030\013 \001(\t\022T\n\rbuild_opti" + + "ons\030\014 \003(\0132=.grafeas.v1beta1.provenance.B" + + "uildProvenance.BuildOptionsEntry\022\027\n\017buil" + + "der_version\030\r \001(\t\0323\n\021BuildOptionsEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\315\002\n\006Sourc" + + "e\022#\n\033artifact_storage_source_uri\030\001 \001(\t\022G" + + "\n\013file_hashes\030\002 \003(\01322.grafeas.v1beta1.pr" + + "ovenance.Source.FileHashesEntry\0226\n\007conte" + + "xt\030\003 \001(\0132%.grafeas.v1beta1.source.Source" + + "Context\022B\n\023additional_contexts\030\004 \003(\0132%.g" + + "rafeas.v1beta1.source.SourceContext\032Y\n\017F" + + "ileHashesEntry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001" + + "(\0132&.grafeas.v1beta1.provenance.FileHash" + + "es:\0028\001\"A\n\nFileHashes\0223\n\tfile_hash\030\001 \003(\0132" + + " .grafeas.v1beta1.provenance.Hash\"\201\001\n\004Ha" + + "sh\0227\n\004type\030\001 \001(\0162).grafeas.v1beta1.prove" + + "nance.Hash.HashType\022\r\n\005value\030\002 \001(\014\"1\n\010Ha" + + "shType\022\031\n\025HASH_TYPE_UNSPECIFIED\020\000\022\n\n\006SHA" + + "256\020\001\"]\n\007Command\022\014\n\004name\030\001 \001(\t\022\013\n\003env\030\002 " + + "\003(\t\022\014\n\004args\030\003 \003(\t\022\013\n\003dir\030\004 \001(\t\022\n\n\002id\030\005 \001" + + "(\t\022\020\n\010wait_for\030\006 \003(\t\"7\n\010Artifact\022\020\n\010chec" + + "ksum\030\001 \001(\t\022\n\n\002id\030\002 \001(\t\022\r\n\005names\030\003 \003(\tB\207\001" + + "\n\035io.grafeas.v1beta1.provenanceP\001Z^googl" + + "e.golang.org/genproto/googleapis/devtool" + + "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[] { + com.google.protobuf.TimestampProto.getDescriptor(), + io.grafeas.v1beta1.source.Source.getDescriptor(), + }, assigner); + internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_provenance_BuildProvenance_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor, + new java.lang.String[] { "Id", "ProjectId", "Commands", "BuiltArtifacts", "CreateTime", "StartTime", "EndTime", "Creator", "LogsUri", "SourceProvenance", "TriggerId", "BuildOptions", "BuilderVersion", }); + internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_descriptor = + internal_static_grafeas_v1beta1_provenance_BuildProvenance_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_BuildProvenance_BuildOptionsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_grafeas_v1beta1_provenance_Source_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_provenance_Source_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_Source_descriptor, + new java.lang.String[] { "ArtifactStorageSourceUri", "FileHashes", "Context", "AdditionalContexts", }); + internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_descriptor = + internal_static_grafeas_v1beta1_provenance_Source_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_provenance_FileHashes_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_FileHashes_descriptor, + new java.lang.String[] { "FileHash", }); + internal_static_grafeas_v1beta1_provenance_Hash_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_provenance_Hash_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_Hash_descriptor, + new java.lang.String[] { "Type", "Value", }); + internal_static_grafeas_v1beta1_provenance_Command_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1beta1_provenance_Command_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_Command_descriptor, + new java.lang.String[] { "Name", "Env", "Args", "Dir", "Id", "WaitFor", }); + internal_static_grafeas_v1beta1_provenance_Artifact_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_grafeas_v1beta1_provenance_Artifact_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_provenance_Artifact_descriptor, + new java.lang.String[] { "Checksum", "Id", "Names", }); + com.google.protobuf.TimestampProto.getDescriptor(); + io.grafeas.v1beta1.source.Source.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ScanConfigName.java new file mode 100644 index 000000000000..988954391591 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.provenance; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..ee8759ef14c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/Source.java @@ -0,0 +1,1694 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +/** + *
+ * Source describes the location of the source used for the build.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Source} + */ +public final class Source extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.provenance.Source) + SourceOrBuilder { +private static final long serialVersionUID = 0L; + // Use Source.newBuilder() to construct. + private Source(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Source() { + artifactStorageSourceUri_ = ""; + additionalContexts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Source( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + artifactStorageSourceUri_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + fileHashes_ = com.google.protobuf.MapField.newMapField( + FileHashesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + fileHashes__ = input.readMessage( + FileHashesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + fileHashes_.getMutableMap().put( + fileHashes__.getKey(), fileHashes__.getValue()); + break; + } + case 26: { + io.grafeas.v1beta1.source.SourceContext.Builder subBuilder = null; + if (context_ != null) { + subBuilder = context_.toBuilder(); + } + context_ = input.readMessage(io.grafeas.v1beta1.source.SourceContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(context_); + context_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + additionalContexts_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + additionalContexts_.add( + input.readMessage(io.grafeas.v1beta1.source.SourceContext.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + additionalContexts_ = java.util.Collections.unmodifiableList(additionalContexts_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetFileHashes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Source.class, 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_; + /** + *
+   * If provided, the input binary artifacts for the build came from this
+   * location.
+   * 
+ * + * string artifact_storage_source_uri = 1; + */ + public java.lang.String getArtifactStorageSourceUri() { + java.lang.Object ref = artifactStorageSourceUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + artifactStorageSourceUri_ = s; + return s; + } + } + /** + *
+   * If provided, the input binary artifacts for the build came from this
+   * location.
+   * 
+ * + * string artifact_storage_source_uri = 1; + */ + public com.google.protobuf.ByteString + getArtifactStorageSourceUriBytes() { + java.lang.Object ref = artifactStorageSourceUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + artifactStorageSourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILE_HASHES_FIELD_NUMBER = 2; + private static final class FileHashesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, io.grafeas.v1beta1.provenance.FileHashes> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_FileHashesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + io.grafeas.v1beta1.provenance.FileHashes.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.String, io.grafeas.v1beta1.provenance.FileHashes> fileHashes_; + private com.google.protobuf.MapField + internalGetFileHashes() { + if (fileHashes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FileHashesDefaultEntryHolder.defaultEntry); + } + return fileHashes_; + } + + public int getFileHashesCount() { + return internalGetFileHashes().getMap().size(); + } + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public boolean containsFileHashes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetFileHashes().getMap().containsKey(key); + } + /** + * Use {@link #getFileHashesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getFileHashes() { + return getFileHashesMap(); + } + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public java.util.Map getFileHashesMap() { + return internalGetFileHashes().getMap(); + } + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.provenance.FileHashes defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetFileHashes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetFileHashes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CONTEXT_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.source.SourceContext context_; + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public boolean hasContext() { + return context_ != null; + } + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public io.grafeas.v1beta1.source.SourceContext getContext() { + return context_ == null ? io.grafeas.v1beta1.source.SourceContext.getDefaultInstance() : context_; + } + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public io.grafeas.v1beta1.source.SourceContextOrBuilder getContextOrBuilder() { + return getContext(); + } + + public static final int ADDITIONAL_CONTEXTS_FIELD_NUMBER = 4; + private java.util.List additionalContexts_; + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public java.util.List getAdditionalContextsList() { + return additionalContexts_; + } + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public java.util.List + getAdditionalContextsOrBuilderList() { + return additionalContexts_; + } + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public int getAdditionalContextsCount() { + return additionalContexts_.size(); + } + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContext getAdditionalContexts(int index) { + return additionalContexts_.get(index); + } + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContextOrBuilder getAdditionalContextsOrBuilder( + int index) { + return additionalContexts_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getArtifactStorageSourceUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, artifactStorageSourceUri_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetFileHashes(), + FileHashesDefaultEntryHolder.defaultEntry, + 2); + if (context_ != null) { + output.writeMessage(3, getContext()); + } + for (int i = 0; i < additionalContexts_.size(); i++) { + output.writeMessage(4, additionalContexts_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getArtifactStorageSourceUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, artifactStorageSourceUri_); + } + for (java.util.Map.Entry entry + : internalGetFileHashes().getMap().entrySet()) { + com.google.protobuf.MapEntry + fileHashes__ = FileHashesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, fileHashes__); + } + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getContext()); + } + for (int i = 0; i < additionalContexts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, additionalContexts_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.provenance.Source)) { + return super.equals(obj); + } + io.grafeas.v1beta1.provenance.Source other = (io.grafeas.v1beta1.provenance.Source) obj; + + boolean result = true; + result = result && getArtifactStorageSourceUri() + .equals(other.getArtifactStorageSourceUri()); + result = result && internalGetFileHashes().equals( + other.internalGetFileHashes()); + result = result && (hasContext() == other.hasContext()); + if (hasContext()) { + result = result && getContext() + .equals(other.getContext()); + } + result = result && getAdditionalContextsList() + .equals(other.getAdditionalContextsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ARTIFACT_STORAGE_SOURCE_URI_FIELD_NUMBER; + hash = (53 * hash) + getArtifactStorageSourceUri().hashCode(); + if (!internalGetFileHashes().getMap().isEmpty()) { + hash = (37 * hash) + FILE_HASHES_FIELD_NUMBER; + hash = (53 * hash) + internalGetFileHashes().hashCode(); + } + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (getAdditionalContextsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_CONTEXTS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalContextsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.provenance.Source parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Source parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Source parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.provenance.Source parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.provenance.Source prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Source describes the location of the source used for the build.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.provenance.Source} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.provenance.Source) + io.grafeas.v1beta1.provenance.SourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetFileHashes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutableFileHashes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.provenance.Source.class, io.grafeas.v1beta1.provenance.Source.Builder.class); + } + + // Construct using io.grafeas.v1beta1.provenance.Source.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAdditionalContextsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + artifactStorageSourceUri_ = ""; + + internalGetMutableFileHashes().clear(); + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + if (additionalContextsBuilder_ == null) { + additionalContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + additionalContextsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.provenance.Provenance.internal_static_grafeas_v1beta1_provenance_Source_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Source getDefaultInstanceForType() { + return io.grafeas.v1beta1.provenance.Source.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Source build() { + io.grafeas.v1beta1.provenance.Source result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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(); + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + if (additionalContextsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + additionalContexts_ = java.util.Collections.unmodifiableList(additionalContexts_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.additionalContexts_ = additionalContexts_; + } else { + result.additionalContexts_ = additionalContextsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.provenance.Source) { + return mergeFrom((io.grafeas.v1beta1.provenance.Source)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.provenance.Source other) { + if (other == io.grafeas.v1beta1.provenance.Source.getDefaultInstance()) return this; + if (!other.getArtifactStorageSourceUri().isEmpty()) { + artifactStorageSourceUri_ = other.artifactStorageSourceUri_; + onChanged(); + } + internalGetMutableFileHashes().mergeFrom( + other.internalGetFileHashes()); + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (additionalContextsBuilder_ == null) { + if (!other.additionalContexts_.isEmpty()) { + if (additionalContexts_.isEmpty()) { + additionalContexts_ = other.additionalContexts_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureAdditionalContextsIsMutable(); + additionalContexts_.addAll(other.additionalContexts_); + } + onChanged(); + } + } else { + if (!other.additionalContexts_.isEmpty()) { + if (additionalContextsBuilder_.isEmpty()) { + additionalContextsBuilder_.dispose(); + additionalContextsBuilder_ = null; + additionalContexts_ = other.additionalContexts_; + bitField0_ = (bitField0_ & ~0x00000008); + additionalContextsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAdditionalContextsFieldBuilder() : null; + } else { + additionalContextsBuilder_.addAllMessages(other.additionalContexts_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.provenance.Source parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.provenance.Source) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object artifactStorageSourceUri_ = ""; + /** + *
+     * If provided, the input binary artifacts for the build came from this
+     * location.
+     * 
+ * + * string artifact_storage_source_uri = 1; + */ + public java.lang.String getArtifactStorageSourceUri() { + java.lang.Object ref = artifactStorageSourceUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + artifactStorageSourceUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If provided, the input binary artifacts for the build came from this
+     * location.
+     * 
+ * + * string artifact_storage_source_uri = 1; + */ + public com.google.protobuf.ByteString + getArtifactStorageSourceUriBytes() { + java.lang.Object ref = artifactStorageSourceUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + artifactStorageSourceUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If provided, the input binary artifacts for the build came from this
+     * location.
+     * 
+ * + * string artifact_storage_source_uri = 1; + */ + public Builder setArtifactStorageSourceUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + artifactStorageSourceUri_ = value; + onChanged(); + return this; + } + /** + *
+     * If provided, the input binary artifacts for the build came from this
+     * location.
+     * 
+ * + * string artifact_storage_source_uri = 1; + */ + public Builder clearArtifactStorageSourceUri() { + + artifactStorageSourceUri_ = getDefaultInstance().getArtifactStorageSourceUri(); + onChanged(); + return this; + } + /** + *
+     * If provided, the input binary artifacts for the build came from this
+     * location.
+     * 
+ * + * string artifact_storage_source_uri = 1; + */ + public Builder setArtifactStorageSourceUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + artifactStorageSourceUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, io.grafeas.v1beta1.provenance.FileHashes> fileHashes_; + private com.google.protobuf.MapField + internalGetFileHashes() { + if (fileHashes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + FileHashesDefaultEntryHolder.defaultEntry); + } + return fileHashes_; + } + private com.google.protobuf.MapField + internalGetMutableFileHashes() { + onChanged();; + if (fileHashes_ == null) { + fileHashes_ = com.google.protobuf.MapField.newMapField( + FileHashesDefaultEntryHolder.defaultEntry); + } + if (!fileHashes_.isMutable()) { + fileHashes_ = fileHashes_.copy(); + } + return fileHashes_; + } + + public int getFileHashesCount() { + return internalGetFileHashes().getMap().size(); + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public boolean containsFileHashes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetFileHashes().getMap().containsKey(key); + } + /** + * Use {@link #getFileHashesMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getFileHashes() { + return getFileHashesMap(); + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public java.util.Map getFileHashesMap() { + return internalGetFileHashes().getMap(); + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.provenance.FileHashes defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetFileHashes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetFileHashes().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearFileHashes() { + internalGetMutableFileHashes().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public Builder removeFileHashes( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableFileHashes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableFileHashes() { + return internalGetMutableFileHashes().getMutableMap(); + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + public Builder putFileHashes( + java.lang.String key, + io.grafeas.v1beta1.provenance.FileHashes value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableFileHashes().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Hash(es) of the build source, which can be used to verify that the original
+     * source integrity was maintained in the build.
+     * The keys to this map are file paths used as build source and the values
+     * contain the hash values for those files.
+     * If the build source came in a single package such as a gzipped tarfile
+     * (.tar.gz), the FileHash will be for the single path to that file.
+     * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + public Builder putAllFileHashes( + java.util.Map values) { + internalGetMutableFileHashes().getMutableMap() + .putAll(values); + return this; + } + + private io.grafeas.v1beta1.source.SourceContext context_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder> contextBuilder_; + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public io.grafeas.v1beta1.source.SourceContext getContext() { + if (contextBuilder_ == null) { + return context_ == null ? io.grafeas.v1beta1.source.SourceContext.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public Builder setContext(io.grafeas.v1beta1.source.SourceContext value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public Builder setContext( + io.grafeas.v1beta1.source.SourceContext.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public Builder mergeContext(io.grafeas.v1beta1.source.SourceContext value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = + io.grafeas.v1beta1.source.SourceContext.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public io.grafeas.v1beta1.source.SourceContext.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + public io.grafeas.v1beta1.source.SourceContextOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? + io.grafeas.v1beta1.source.SourceContext.getDefaultInstance() : context_; + } + } + /** + *
+     * If provided, the source code used for the build came from this location.
+     * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder>( + getContext(), + getParentForChildren(), + isClean()); + context_ = null; + } + return contextBuilder_; + } + + private java.util.List additionalContexts_ = + java.util.Collections.emptyList(); + private void ensureAdditionalContextsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + additionalContexts_ = new java.util.ArrayList(additionalContexts_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder> additionalContextsBuilder_; + + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public java.util.List getAdditionalContextsList() { + if (additionalContextsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalContexts_); + } else { + return additionalContextsBuilder_.getMessageList(); + } + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public int getAdditionalContextsCount() { + if (additionalContextsBuilder_ == null) { + return additionalContexts_.size(); + } else { + return additionalContextsBuilder_.getCount(); + } + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContext getAdditionalContexts(int index) { + if (additionalContextsBuilder_ == null) { + return additionalContexts_.get(index); + } else { + return additionalContextsBuilder_.getMessage(index); + } + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder setAdditionalContexts( + int index, io.grafeas.v1beta1.source.SourceContext value) { + if (additionalContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalContextsIsMutable(); + additionalContexts_.set(index, value); + onChanged(); + } else { + additionalContextsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder setAdditionalContexts( + int index, io.grafeas.v1beta1.source.SourceContext.Builder builderForValue) { + if (additionalContextsBuilder_ == null) { + ensureAdditionalContextsIsMutable(); + additionalContexts_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalContextsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder addAdditionalContexts(io.grafeas.v1beta1.source.SourceContext value) { + if (additionalContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalContextsIsMutable(); + additionalContexts_.add(value); + onChanged(); + } else { + additionalContextsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder addAdditionalContexts( + int index, io.grafeas.v1beta1.source.SourceContext value) { + if (additionalContextsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalContextsIsMutable(); + additionalContexts_.add(index, value); + onChanged(); + } else { + additionalContextsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder addAdditionalContexts( + io.grafeas.v1beta1.source.SourceContext.Builder builderForValue) { + if (additionalContextsBuilder_ == null) { + ensureAdditionalContextsIsMutable(); + additionalContexts_.add(builderForValue.build()); + onChanged(); + } else { + additionalContextsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder addAdditionalContexts( + int index, io.grafeas.v1beta1.source.SourceContext.Builder builderForValue) { + if (additionalContextsBuilder_ == null) { + ensureAdditionalContextsIsMutable(); + additionalContexts_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalContextsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder addAllAdditionalContexts( + java.lang.Iterable values) { + if (additionalContextsBuilder_ == null) { + ensureAdditionalContextsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalContexts_); + onChanged(); + } else { + additionalContextsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder clearAdditionalContexts() { + if (additionalContextsBuilder_ == null) { + additionalContexts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + additionalContextsBuilder_.clear(); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public Builder removeAdditionalContexts(int index) { + if (additionalContextsBuilder_ == null) { + ensureAdditionalContextsIsMutable(); + additionalContexts_.remove(index); + onChanged(); + } else { + additionalContextsBuilder_.remove(index); + } + return this; + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContext.Builder getAdditionalContextsBuilder( + int index) { + return getAdditionalContextsFieldBuilder().getBuilder(index); + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContextOrBuilder getAdditionalContextsOrBuilder( + int index) { + if (additionalContextsBuilder_ == null) { + return additionalContexts_.get(index); } else { + return additionalContextsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public java.util.List + getAdditionalContextsOrBuilderList() { + if (additionalContextsBuilder_ != null) { + return additionalContextsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalContexts_); + } + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContext.Builder addAdditionalContextsBuilder() { + return getAdditionalContextsFieldBuilder().addBuilder( + io.grafeas.v1beta1.source.SourceContext.getDefaultInstance()); + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public io.grafeas.v1beta1.source.SourceContext.Builder addAdditionalContextsBuilder( + int index) { + return getAdditionalContextsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.source.SourceContext.getDefaultInstance()); + } + /** + *
+     * If provided, some of the source code used for the build may be found in
+     * these locations, in the case where the source repository had multiple
+     * remotes or submodules. This list will not include the context specified in
+     * the context field.
+     * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + public java.util.List + getAdditionalContextsBuilderList() { + return getAdditionalContextsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder> + getAdditionalContextsFieldBuilder() { + if (additionalContextsBuilder_ == null) { + additionalContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.source.SourceContext, io.grafeas.v1beta1.source.SourceContext.Builder, io.grafeas.v1beta1.source.SourceContextOrBuilder>( + additionalContexts_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + additionalContexts_ = null; + } + return additionalContextsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.provenance.Source) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.provenance.Source) + private static final io.grafeas.v1beta1.provenance.Source DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.provenance.Source(); + } + + public static io.grafeas.v1beta1.provenance.Source getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Source parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Source(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.provenance.Source getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/SourceOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/SourceOrBuilder.java new file mode 100644 index 000000000000..5f6255272e34 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/provenance/SourceOrBuilder.java @@ -0,0 +1,192 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/provenance/provenance.proto + +package io.grafeas.v1beta1.provenance; + +public interface SourceOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.provenance.Source) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * If provided, the input binary artifacts for the build came from this
+   * location.
+   * 
+ * + * string artifact_storage_source_uri = 1; + */ + java.lang.String getArtifactStorageSourceUri(); + /** + *
+   * If provided, the input binary artifacts for the build came from this
+   * location.
+   * 
+ * + * string artifact_storage_source_uri = 1; + */ + com.google.protobuf.ByteString + getArtifactStorageSourceUriBytes(); + + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + int getFileHashesCount(); + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + boolean containsFileHashes( + java.lang.String key); + /** + * Use {@link #getFileHashesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getFileHashes(); + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + java.util.Map + getFileHashesMap(); + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrDefault( + java.lang.String key, + io.grafeas.v1beta1.provenance.FileHashes defaultValue); + /** + *
+   * Hash(es) of the build source, which can be used to verify that the original
+   * source integrity was maintained in the build.
+   * The keys to this map are file paths used as build source and the values
+   * contain the hash values for those files.
+   * If the build source came in a single package such as a gzipped tarfile
+   * (.tar.gz), the FileHash will be for the single path to that file.
+   * 
+ * + * map<string, .grafeas.v1beta1.provenance.FileHashes> file_hashes = 2; + */ + + io.grafeas.v1beta1.provenance.FileHashes getFileHashesOrThrow( + java.lang.String key); + + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + boolean hasContext(); + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + io.grafeas.v1beta1.source.SourceContext getContext(); + /** + *
+   * If provided, the source code used for the build came from this location.
+   * 
+ * + * .grafeas.v1beta1.source.SourceContext context = 3; + */ + io.grafeas.v1beta1.source.SourceContextOrBuilder getContextOrBuilder(); + + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + java.util.List + getAdditionalContextsList(); + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + io.grafeas.v1beta1.source.SourceContext getAdditionalContexts(int index); + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + int getAdditionalContextsCount(); + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + java.util.List + getAdditionalContextsOrBuilderList(); + /** + *
+   * If provided, some of the source code used for the build may be found in
+   * these locations, in the case where the source repository had multiple
+   * remotes or submodules. This list will not include the context specified in
+   * the context field.
+   * 
+ * + * repeated .grafeas.v1beta1.source.SourceContext additional_contexts = 4; + */ + io.grafeas.v1beta1.source.SourceContextOrBuilder getAdditionalContextsOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..acc636a6a54d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContext.java @@ -0,0 +1,844 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * An alias to a repo revision.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.AliasContext} + */ +public final class AliasContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.AliasContext) + AliasContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use AliasContext.newBuilder() to construct. + private AliasContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AliasContext() { + kind_ = 0; + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AliasContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + kind_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_AliasContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_AliasContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.AliasContext.class, io.grafeas.v1beta1.source.AliasContext.Builder.class); + } + + /** + *
+   * The type of an alias.
+   * 
+ * + * Protobuf enum {@code grafeas.v1beta1.source.AliasContext.Kind} + */ + public enum Kind + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * Unknown.
+     * 
+ * + * KIND_UNSPECIFIED = 0; + */ + KIND_UNSPECIFIED(0), + /** + *
+     * Git tag.
+     * 
+ * + * FIXED = 1; + */ + FIXED(1), + /** + *
+     * Git branch.
+     * 
+ * + * MOVABLE = 2; + */ + MOVABLE(2), + /** + *
+     * Used to specify non-standard aliases. For example, if a Git repo has a
+     * ref named "refs/foo/bar".
+     * 
+ * + * OTHER = 4; + */ + OTHER(4), + UNRECOGNIZED(-1), + ; + + /** + *
+     * Unknown.
+     * 
+ * + * KIND_UNSPECIFIED = 0; + */ + public static final int KIND_UNSPECIFIED_VALUE = 0; + /** + *
+     * Git tag.
+     * 
+ * + * FIXED = 1; + */ + public static final int FIXED_VALUE = 1; + /** + *
+     * Git branch.
+     * 
+ * + * MOVABLE = 2; + */ + public static final int MOVABLE_VALUE = 2; + /** + *
+     * Used to specify non-standard aliases. For example, if a Git repo has a
+     * ref named "refs/foo/bar".
+     * 
+ * + * OTHER = 4; + */ + public static final int OTHER_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Kind valueOf(int value) { + return forNumber(value); + } + + public static Kind forNumber(int value) { + switch (value) { + case 0: return KIND_UNSPECIFIED; + case 1: return FIXED; + case 2: return MOVABLE; + case 4: return OTHER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Kind> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Kind findValueByNumber(int number) { + return Kind.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.source.AliasContext.getDescriptor().getEnumTypes().get(0); + } + + private static final Kind[] VALUES = values(); + + public static Kind valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Kind(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.source.AliasContext.Kind) + } + + public static final int KIND_FIELD_NUMBER = 1; + private int kind_; + /** + *
+   * The alias kind.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public int getKindValue() { + return kind_; + } + /** + *
+   * The alias kind.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public io.grafeas.v1beta1.source.AliasContext.Kind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.source.AliasContext.Kind result = io.grafeas.v1beta1.source.AliasContext.Kind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.source.AliasContext.Kind.UNRECOGNIZED : result; + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + *
+   * The alias name.
+   * 
+ * + * string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * The alias name.
+   * 
+ * + * string name = 2; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (kind_ != io.grafeas.v1beta1.source.AliasContext.Kind.KIND_UNSPECIFIED.getNumber()) { + output.writeEnum(1, kind_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (kind_ != io.grafeas.v1beta1.source.AliasContext.Kind.KIND_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, kind_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.AliasContext)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.AliasContext other = (io.grafeas.v1beta1.source.AliasContext) obj; + + boolean result = true; + result = result && kind_ == other.kind_; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + kind_; + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.AliasContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.AliasContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.AliasContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.AliasContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * An alias to a repo revision.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.AliasContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.AliasContext) + io.grafeas.v1beta1.source.AliasContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_AliasContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_AliasContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.AliasContext.class, io.grafeas.v1beta1.source.AliasContext.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.AliasContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + kind_ = 0; + + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_AliasContext_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.AliasContext getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.AliasContext build() { + io.grafeas.v1beta1.source.AliasContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.AliasContext buildPartial() { + io.grafeas.v1beta1.source.AliasContext result = new io.grafeas.v1beta1.source.AliasContext(this); + result.kind_ = kind_; + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.AliasContext) { + return mergeFrom((io.grafeas.v1beta1.source.AliasContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.AliasContext other) { + if (other == io.grafeas.v1beta1.source.AliasContext.getDefaultInstance()) return this; + if (other.kind_ != 0) { + setKindValue(other.getKindValue()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.AliasContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.AliasContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int kind_ = 0; + /** + *
+     * The alias kind.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public int getKindValue() { + return kind_; + } + /** + *
+     * The alias kind.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public Builder setKindValue(int value) { + kind_ = value; + onChanged(); + return this; + } + /** + *
+     * The alias kind.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public io.grafeas.v1beta1.source.AliasContext.Kind getKind() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.source.AliasContext.Kind result = io.grafeas.v1beta1.source.AliasContext.Kind.valueOf(kind_); + return result == null ? io.grafeas.v1beta1.source.AliasContext.Kind.UNRECOGNIZED : result; + } + /** + *
+     * The alias kind.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public Builder setKind(io.grafeas.v1beta1.source.AliasContext.Kind value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * The alias kind.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + public Builder clearKind() { + + kind_ = 0; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * The alias name.
+     * 
+ * + * string name = 2; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The alias name.
+     * 
+ * + * string name = 2; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The alias name.
+     * 
+ * + * string name = 2; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * The alias name.
+     * 
+ * + * string name = 2; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * The alias name.
+     * 
+ * + * string name = 2; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.AliasContext) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.AliasContext) + private static final io.grafeas.v1beta1.source.AliasContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.AliasContext(); + } + + public static io.grafeas.v1beta1.source.AliasContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AliasContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AliasContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.AliasContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContextOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContextOrBuilder.java new file mode 100644 index 000000000000..f3c1d114e30e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/AliasContextOrBuilder.java @@ -0,0 +1,44 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface AliasContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.AliasContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The alias kind.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + int getKindValue(); + /** + *
+   * The alias kind.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext.Kind kind = 1; + */ + io.grafeas.v1beta1.source.AliasContext.Kind getKind(); + + /** + *
+   * The alias name.
+   * 
+ * + * string name = 2; + */ + java.lang.String getName(); + /** + *
+   * The alias name.
+   * 
+ * + * string name = 2; + */ + com.google.protobuf.ByteString + getNameBytes(); +} 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 new file mode 100644 index 000000000000..7174a05169d6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContext.java @@ -0,0 +1,1155 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * A CloudRepoSourceContext denotes a particular revision in a Google Cloud
+ * Source Repo.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.CloudRepoSourceContext} + */ +public final class CloudRepoSourceContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.CloudRepoSourceContext) + CloudRepoSourceContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use CloudRepoSourceContext.newBuilder() to construct. + private CloudRepoSourceContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CloudRepoSourceContext() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CloudRepoSourceContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.source.RepoId.Builder subBuilder = null; + if (repoId_ != null) { + subBuilder = repoId_.toBuilder(); + } + repoId_ = input.readMessage(io.grafeas.v1beta1.source.RepoId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(repoId_); + repoId_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 2; + revision_ = s; + break; + } + case 26: { + io.grafeas.v1beta1.source.AliasContext.Builder subBuilder = null; + if (revisionCase_ == 3) { + subBuilder = ((io.grafeas.v1beta1.source.AliasContext) revision_).toBuilder(); + } + revision_ = + input.readMessage(io.grafeas.v1beta1.source.AliasContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.AliasContext) revision_); + revision_ = subBuilder.buildPartial(); + } + revisionCase_ = 3; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.CloudRepoSourceContext.class, io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder.class); + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + public enum RevisionCase + implements com.google.protobuf.Internal.EnumLite { + REVISION_ID(2), + ALIAS_CONTEXT(3), + REVISION_NOT_SET(0); + private final int value; + private RevisionCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RevisionCase valueOf(int value) { + return forNumber(value); + } + + public static RevisionCase forNumber(int value) { + switch (value) { + case 2: return REVISION_ID; + case 3: return ALIAS_CONTEXT; + case 0: return REVISION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public RevisionCase + getRevisionCase() { + return RevisionCase.forNumber( + revisionCase_); + } + + public static final int REPO_ID_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.source.RepoId repoId_; + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public boolean hasRepoId() { + return repoId_ != null; + } + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public io.grafeas.v1beta1.source.RepoId getRepoId() { + return repoId_ == null ? io.grafeas.v1beta1.source.RepoId.getDefaultInstance() : repoId_; + } + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public io.grafeas.v1beta1.source.RepoIdOrBuilder getRepoIdOrBuilder() { + return getRepoId(); + } + + public static final int REVISION_ID_FIELD_NUMBER = 2; + /** + *
+   * A revision ID.
+   * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = ""; + if (revisionCase_ == 2) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 2) { + revision_ = s; + } + return s; + } + } + /** + *
+   * A revision ID.
+   * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 2) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (revisionCase_ == 2) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALIAS_CONTEXT_FIELD_NUMBER = 3; + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public boolean hasAliasContext() { + return revisionCase_ == 3; + } + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public io.grafeas.v1beta1.source.AliasContext getAliasContext() { + if (revisionCase_ == 3) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder() { + if (revisionCase_ == 3) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (repoId_ != null) { + output.writeMessage(1, getRepoId()); + } + if (revisionCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revision_); + } + if (revisionCase_ == 3) { + output.writeMessage(3, (io.grafeas.v1beta1.source.AliasContext) revision_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (repoId_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRepoId()); + } + if (revisionCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revision_); + } + if (revisionCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.grafeas.v1beta1.source.AliasContext) revision_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.CloudRepoSourceContext)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.CloudRepoSourceContext other = (io.grafeas.v1beta1.source.CloudRepoSourceContext) obj; + + boolean result = true; + result = result && (hasRepoId() == other.hasRepoId()); + if (hasRepoId()) { + result = result && getRepoId() + .equals(other.getRepoId()); + } + result = result && getRevisionCase().equals( + other.getRevisionCase()); + if (!result) return false; + switch (revisionCase_) { + case 2: + result = result && getRevisionId() + .equals(other.getRevisionId()); + break; + case 3: + result = result && getAliasContext() + .equals(other.getAliasContext()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRepoId()) { + hash = (37 * hash) + REPO_ID_FIELD_NUMBER; + hash = (53 * hash) + getRepoId().hashCode(); + } + switch (revisionCase_) { + case 2: + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + break; + case 3: + hash = (37 * hash) + ALIAS_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAliasContext().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.CloudRepoSourceContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.CloudRepoSourceContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A CloudRepoSourceContext denotes a particular revision in a Google Cloud
+   * Source Repo.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.CloudRepoSourceContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.CloudRepoSourceContext) + io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.CloudRepoSourceContext.class, io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.CloudRepoSourceContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (repoIdBuilder_ == null) { + repoId_ = null; + } else { + repoId_ = null; + repoIdBuilder_ = null; + } + revisionCase_ = 0; + revision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.CloudRepoSourceContext getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.CloudRepoSourceContext build() { + io.grafeas.v1beta1.source.CloudRepoSourceContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.CloudRepoSourceContext buildPartial() { + io.grafeas.v1beta1.source.CloudRepoSourceContext result = new io.grafeas.v1beta1.source.CloudRepoSourceContext(this); + if (repoIdBuilder_ == null) { + result.repoId_ = repoId_; + } else { + result.repoId_ = repoIdBuilder_.build(); + } + if (revisionCase_ == 2) { + result.revision_ = revision_; + } + if (revisionCase_ == 3) { + if (aliasContextBuilder_ == null) { + result.revision_ = revision_; + } else { + result.revision_ = aliasContextBuilder_.build(); + } + } + result.revisionCase_ = revisionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.CloudRepoSourceContext) { + return mergeFrom((io.grafeas.v1beta1.source.CloudRepoSourceContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.CloudRepoSourceContext other) { + if (other == io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance()) return this; + if (other.hasRepoId()) { + mergeRepoId(other.getRepoId()); + } + switch (other.getRevisionCase()) { + case REVISION_ID: { + revisionCase_ = 2; + revision_ = other.revision_; + onChanged(); + break; + } + case ALIAS_CONTEXT: { + mergeAliasContext(other.getAliasContext()); + break; + } + case REVISION_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.CloudRepoSourceContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.CloudRepoSourceContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int revisionCase_ = 0; + private java.lang.Object revision_; + public RevisionCase + getRevisionCase() { + return RevisionCase.forNumber( + revisionCase_); + } + + public Builder clearRevision() { + revisionCase_ = 0; + revision_ = null; + onChanged(); + return this; + } + + + private io.grafeas.v1beta1.source.RepoId repoId_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.RepoId, io.grafeas.v1beta1.source.RepoId.Builder, io.grafeas.v1beta1.source.RepoIdOrBuilder> repoIdBuilder_; + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public boolean hasRepoId() { + return repoIdBuilder_ != null || repoId_ != null; + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public io.grafeas.v1beta1.source.RepoId getRepoId() { + if (repoIdBuilder_ == null) { + return repoId_ == null ? io.grafeas.v1beta1.source.RepoId.getDefaultInstance() : repoId_; + } else { + return repoIdBuilder_.getMessage(); + } + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public Builder setRepoId(io.grafeas.v1beta1.source.RepoId value) { + if (repoIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + repoId_ = value; + onChanged(); + } else { + repoIdBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public Builder setRepoId( + io.grafeas.v1beta1.source.RepoId.Builder builderForValue) { + if (repoIdBuilder_ == null) { + repoId_ = builderForValue.build(); + onChanged(); + } else { + repoIdBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public Builder mergeRepoId(io.grafeas.v1beta1.source.RepoId value) { + if (repoIdBuilder_ == null) { + if (repoId_ != null) { + repoId_ = + io.grafeas.v1beta1.source.RepoId.newBuilder(repoId_).mergeFrom(value).buildPartial(); + } else { + repoId_ = value; + } + onChanged(); + } else { + repoIdBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public Builder clearRepoId() { + if (repoIdBuilder_ == null) { + repoId_ = null; + onChanged(); + } else { + repoId_ = null; + repoIdBuilder_ = null; + } + + return this; + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public io.grafeas.v1beta1.source.RepoId.Builder getRepoIdBuilder() { + + onChanged(); + return getRepoIdFieldBuilder().getBuilder(); + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + public io.grafeas.v1beta1.source.RepoIdOrBuilder getRepoIdOrBuilder() { + if (repoIdBuilder_ != null) { + return repoIdBuilder_.getMessageOrBuilder(); + } else { + return repoId_ == null ? + io.grafeas.v1beta1.source.RepoId.getDefaultInstance() : repoId_; + } + } + /** + *
+     * The ID of the repo.
+     * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.RepoId, io.grafeas.v1beta1.source.RepoId.Builder, io.grafeas.v1beta1.source.RepoIdOrBuilder> + getRepoIdFieldBuilder() { + if (repoIdBuilder_ == null) { + repoIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.RepoId, io.grafeas.v1beta1.source.RepoId.Builder, io.grafeas.v1beta1.source.RepoIdOrBuilder>( + getRepoId(), + getParentForChildren(), + isClean()); + repoId_ = null; + } + return repoIdBuilder_; + } + + /** + *
+     * A revision ID.
+     * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = ""; + if (revisionCase_ == 2) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 2) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A revision ID.
+     * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 2) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (revisionCase_ == 2) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A revision ID.
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 2; + revision_ = value; + onChanged(); + return this; + } + /** + *
+     * A revision ID.
+     * 
+ * + * string revision_id = 2; + */ + public Builder clearRevisionId() { + if (revisionCase_ == 2) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + *
+     * A revision ID.
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 2; + revision_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder> aliasContextBuilder_; + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public boolean hasAliasContext() { + return revisionCase_ == 3; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public io.grafeas.v1beta1.source.AliasContext getAliasContext() { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 3) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } else { + if (revisionCase_ == 3) { + return aliasContextBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public Builder setAliasContext(io.grafeas.v1beta1.source.AliasContext value) { + if (aliasContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + revision_ = value; + onChanged(); + } else { + aliasContextBuilder_.setMessage(value); + } + revisionCase_ = 3; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public Builder setAliasContext( + io.grafeas.v1beta1.source.AliasContext.Builder builderForValue) { + if (aliasContextBuilder_ == null) { + revision_ = builderForValue.build(); + onChanged(); + } else { + aliasContextBuilder_.setMessage(builderForValue.build()); + } + revisionCase_ = 3; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public Builder mergeAliasContext(io.grafeas.v1beta1.source.AliasContext value) { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 3 && + revision_ != io.grafeas.v1beta1.source.AliasContext.getDefaultInstance()) { + revision_ = io.grafeas.v1beta1.source.AliasContext.newBuilder((io.grafeas.v1beta1.source.AliasContext) revision_) + .mergeFrom(value).buildPartial(); + } else { + revision_ = value; + } + onChanged(); + } else { + if (revisionCase_ == 3) { + aliasContextBuilder_.mergeFrom(value); + } + aliasContextBuilder_.setMessage(value); + } + revisionCase_ = 3; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public Builder clearAliasContext() { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + } else { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + } + aliasContextBuilder_.clear(); + } + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public io.grafeas.v1beta1.source.AliasContext.Builder getAliasContextBuilder() { + return getAliasContextFieldBuilder().getBuilder(); + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + public io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder() { + if ((revisionCase_ == 3) && (aliasContextBuilder_ != null)) { + return aliasContextBuilder_.getMessageOrBuilder(); + } else { + if (revisionCase_ == 3) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder> + getAliasContextFieldBuilder() { + if (aliasContextBuilder_ == null) { + if (!(revisionCase_ == 3)) { + revision_ = io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + aliasContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder>( + (io.grafeas.v1beta1.source.AliasContext) revision_, + getParentForChildren(), + isClean()); + revision_ = null; + } + revisionCase_ = 3; + onChanged();; + return aliasContextBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.CloudRepoSourceContext) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.CloudRepoSourceContext) + private static final io.grafeas.v1beta1.source.CloudRepoSourceContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.CloudRepoSourceContext(); + } + + public static io.grafeas.v1beta1.source.CloudRepoSourceContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudRepoSourceContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudRepoSourceContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.CloudRepoSourceContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContextOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContextOrBuilder.java new file mode 100644 index 000000000000..df998417b56e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/CloudRepoSourceContextOrBuilder.java @@ -0,0 +1,79 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface CloudRepoSourceContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.CloudRepoSourceContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + boolean hasRepoId(); + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + io.grafeas.v1beta1.source.RepoId getRepoId(); + /** + *
+   * The ID of the repo.
+   * 
+ * + * .grafeas.v1beta1.source.RepoId repo_id = 1; + */ + io.grafeas.v1beta1.source.RepoIdOrBuilder getRepoIdOrBuilder(); + + /** + *
+   * A revision ID.
+   * 
+ * + * string revision_id = 2; + */ + java.lang.String getRevisionId(); + /** + *
+   * A revision ID.
+   * 
+ * + * string revision_id = 2; + */ + com.google.protobuf.ByteString + getRevisionIdBytes(); + + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + boolean hasAliasContext(); + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + io.grafeas.v1beta1.source.AliasContext getAliasContext(); + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 3; + */ + io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder(); + + public io.grafeas.v1beta1.source.CloudRepoSourceContext.RevisionCase getRevisionCase(); +} 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 new file mode 100644 index 000000000000..64173b4eff07 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContext.java @@ -0,0 +1,1248 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * A SourceContext referring to a Gerrit project.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.GerritSourceContext} + */ +public final class GerritSourceContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.GerritSourceContext) + GerritSourceContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use GerritSourceContext.newBuilder() to construct. + private GerritSourceContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GerritSourceContext() { + hostUri_ = ""; + gerritProject_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GerritSourceContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + hostUri_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + gerritProject_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + revisionCase_ = 3; + revision_ = s; + break; + } + case 34: { + io.grafeas.v1beta1.source.AliasContext.Builder subBuilder = null; + if (revisionCase_ == 4) { + subBuilder = ((io.grafeas.v1beta1.source.AliasContext) revision_).toBuilder(); + } + revision_ = + input.readMessage(io.grafeas.v1beta1.source.AliasContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.AliasContext) revision_); + revision_ = subBuilder.buildPartial(); + } + revisionCase_ = 4; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GerritSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.GerritSourceContext.class, io.grafeas.v1beta1.source.GerritSourceContext.Builder.class); + } + + private int revisionCase_ = 0; + private java.lang.Object revision_; + public enum RevisionCase + implements com.google.protobuf.Internal.EnumLite { + REVISION_ID(3), + ALIAS_CONTEXT(4), + REVISION_NOT_SET(0); + private final int value; + private RevisionCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RevisionCase valueOf(int value) { + return forNumber(value); + } + + public static RevisionCase forNumber(int value) { + switch (value) { + case 3: return REVISION_ID; + case 4: return ALIAS_CONTEXT; + case 0: return REVISION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public RevisionCase + getRevisionCase() { + return RevisionCase.forNumber( + revisionCase_); + } + + public static final int HOST_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object hostUri_; + /** + *
+   * The URI of a running Gerrit instance.
+   * 
+ * + * string host_uri = 1; + */ + public java.lang.String getHostUri() { + java.lang.Object ref = hostUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostUri_ = s; + return s; + } + } + /** + *
+   * The URI of a running Gerrit instance.
+   * 
+ * + * string host_uri = 1; + */ + public com.google.protobuf.ByteString + getHostUriBytes() { + java.lang.Object ref = hostUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GERRIT_PROJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object gerritProject_; + /** + *
+   * The full project name within the host. Projects may be nested, so
+   * "project/subproject" is a valid project name. The "repo name" is the
+   * hostURI/project.
+   * 
+ * + * string gerrit_project = 2; + */ + public java.lang.String getGerritProject() { + java.lang.Object ref = gerritProject_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gerritProject_ = s; + return s; + } + } + /** + *
+   * The full project name within the host. Projects may be nested, so
+   * "project/subproject" is a valid project name. The "repo name" is the
+   * hostURI/project.
+   * 
+ * + * string gerrit_project = 2; + */ + public com.google.protobuf.ByteString + getGerritProjectBytes() { + java.lang.Object ref = gerritProject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gerritProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVISION_ID_FIELD_NUMBER = 3; + /** + *
+   * A revision (commit) ID.
+   * 
+ * + * string revision_id = 3; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } + } + /** + *
+   * A revision (commit) ID.
+   * 
+ * + * string revision_id = 3; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ALIAS_CONTEXT_FIELD_NUMBER = 4; + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public boolean hasAliasContext() { + return revisionCase_ == 4; + } + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public io.grafeas.v1beta1.source.AliasContext getAliasContext() { + if (revisionCase_ == 4) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder() { + if (revisionCase_ == 4) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getHostUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hostUri_); + } + if (!getGerritProjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gerritProject_); + } + if (revisionCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, revision_); + } + if (revisionCase_ == 4) { + output.writeMessage(4, (io.grafeas.v1beta1.source.AliasContext) revision_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getHostUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hostUri_); + } + if (!getGerritProjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gerritProject_); + } + if (revisionCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, revision_); + } + if (revisionCase_ == 4) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, (io.grafeas.v1beta1.source.AliasContext) revision_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.GerritSourceContext)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.GerritSourceContext other = (io.grafeas.v1beta1.source.GerritSourceContext) obj; + + boolean result = true; + result = result && getHostUri() + .equals(other.getHostUri()); + result = result && getGerritProject() + .equals(other.getGerritProject()); + result = result && getRevisionCase().equals( + other.getRevisionCase()); + if (!result) return false; + switch (revisionCase_) { + case 3: + result = result && getRevisionId() + .equals(other.getRevisionId()); + break; + case 4: + result = result && getAliasContext() + .equals(other.getAliasContext()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_URI_FIELD_NUMBER; + hash = (53 * hash) + getHostUri().hashCode(); + hash = (37 * hash) + GERRIT_PROJECT_FIELD_NUMBER; + hash = (53 * hash) + getGerritProject().hashCode(); + switch (revisionCase_) { + case 3: + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + break; + case 4: + hash = (37 * hash) + ALIAS_CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getAliasContext().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GerritSourceContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.GerritSourceContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.GerritSourceContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.GerritSourceContext) + io.grafeas.v1beta1.source.GerritSourceContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GerritSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.GerritSourceContext.class, io.grafeas.v1beta1.source.GerritSourceContext.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.GerritSourceContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + hostUri_ = ""; + + gerritProject_ = ""; + + revisionCase_ = 0; + revision_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GerritSourceContext getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GerritSourceContext build() { + io.grafeas.v1beta1.source.GerritSourceContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GerritSourceContext buildPartial() { + io.grafeas.v1beta1.source.GerritSourceContext result = new io.grafeas.v1beta1.source.GerritSourceContext(this); + result.hostUri_ = hostUri_; + result.gerritProject_ = gerritProject_; + if (revisionCase_ == 3) { + result.revision_ = revision_; + } + if (revisionCase_ == 4) { + if (aliasContextBuilder_ == null) { + result.revision_ = revision_; + } else { + result.revision_ = aliasContextBuilder_.build(); + } + } + result.revisionCase_ = revisionCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.GerritSourceContext) { + return mergeFrom((io.grafeas.v1beta1.source.GerritSourceContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.GerritSourceContext other) { + if (other == io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance()) return this; + if (!other.getHostUri().isEmpty()) { + hostUri_ = other.hostUri_; + onChanged(); + } + if (!other.getGerritProject().isEmpty()) { + gerritProject_ = other.gerritProject_; + onChanged(); + } + switch (other.getRevisionCase()) { + case REVISION_ID: { + revisionCase_ = 3; + revision_ = other.revision_; + onChanged(); + break; + } + case ALIAS_CONTEXT: { + mergeAliasContext(other.getAliasContext()); + break; + } + case REVISION_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.GerritSourceContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.GerritSourceContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int revisionCase_ = 0; + private java.lang.Object revision_; + public RevisionCase + getRevisionCase() { + return RevisionCase.forNumber( + revisionCase_); + } + + public Builder clearRevision() { + revisionCase_ = 0; + revision_ = null; + onChanged(); + return this; + } + + + private java.lang.Object hostUri_ = ""; + /** + *
+     * The URI of a running Gerrit instance.
+     * 
+ * + * string host_uri = 1; + */ + public java.lang.String getHostUri() { + java.lang.Object ref = hostUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The URI of a running Gerrit instance.
+     * 
+ * + * string host_uri = 1; + */ + public com.google.protobuf.ByteString + getHostUriBytes() { + java.lang.Object ref = hostUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hostUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The URI of a running Gerrit instance.
+     * 
+ * + * string host_uri = 1; + */ + public Builder setHostUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hostUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The URI of a running Gerrit instance.
+     * 
+ * + * string host_uri = 1; + */ + public Builder clearHostUri() { + + hostUri_ = getDefaultInstance().getHostUri(); + onChanged(); + return this; + } + /** + *
+     * The URI of a running Gerrit instance.
+     * 
+ * + * string host_uri = 1; + */ + public Builder setHostUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hostUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object gerritProject_ = ""; + /** + *
+     * The full project name within the host. Projects may be nested, so
+     * "project/subproject" is a valid project name. The "repo name" is the
+     * hostURI/project.
+     * 
+ * + * string gerrit_project = 2; + */ + public java.lang.String getGerritProject() { + java.lang.Object ref = gerritProject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + gerritProject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The full project name within the host. Projects may be nested, so
+     * "project/subproject" is a valid project name. The "repo name" is the
+     * hostURI/project.
+     * 
+ * + * string gerrit_project = 2; + */ + public com.google.protobuf.ByteString + getGerritProjectBytes() { + java.lang.Object ref = gerritProject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + gerritProject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The full project name within the host. Projects may be nested, so
+     * "project/subproject" is a valid project name. The "repo name" is the
+     * hostURI/project.
+     * 
+ * + * string gerrit_project = 2; + */ + public Builder setGerritProject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + gerritProject_ = value; + onChanged(); + return this; + } + /** + *
+     * The full project name within the host. Projects may be nested, so
+     * "project/subproject" is a valid project name. The "repo name" is the
+     * hostURI/project.
+     * 
+ * + * string gerrit_project = 2; + */ + public Builder clearGerritProject() { + + gerritProject_ = getDefaultInstance().getGerritProject(); + onChanged(); + return this; + } + /** + *
+     * The full project name within the host. Projects may be nested, so
+     * "project/subproject" is a valid project name. The "repo name" is the
+     * hostURI/project.
+     * 
+ * + * string gerrit_project = 2; + */ + public Builder setGerritProjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + gerritProject_ = value; + onChanged(); + return this; + } + + /** + *
+     * A revision (commit) ID.
+     * 
+ * + * string revision_id = 3; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (revisionCase_ == 3) { + revision_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A revision (commit) ID.
+     * 
+ * + * string revision_id = 3; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = ""; + if (revisionCase_ == 3) { + ref = revision_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (revisionCase_ == 3) { + revision_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A revision (commit) ID.
+     * 
+ * + * string revision_id = 3; + */ + public Builder setRevisionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + /** + *
+     * A revision (commit) ID.
+     * 
+ * + * string revision_id = 3; + */ + public Builder clearRevisionId() { + if (revisionCase_ == 3) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + return this; + } + /** + *
+     * A revision (commit) ID.
+     * 
+ * + * string revision_id = 3; + */ + public Builder setRevisionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + revisionCase_ = 3; + revision_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder> aliasContextBuilder_; + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public boolean hasAliasContext() { + return revisionCase_ == 4; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public io.grafeas.v1beta1.source.AliasContext getAliasContext() { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 4) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } else { + if (revisionCase_ == 4) { + return aliasContextBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public Builder setAliasContext(io.grafeas.v1beta1.source.AliasContext value) { + if (aliasContextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + revision_ = value; + onChanged(); + } else { + aliasContextBuilder_.setMessage(value); + } + revisionCase_ = 4; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public Builder setAliasContext( + io.grafeas.v1beta1.source.AliasContext.Builder builderForValue) { + if (aliasContextBuilder_ == null) { + revision_ = builderForValue.build(); + onChanged(); + } else { + aliasContextBuilder_.setMessage(builderForValue.build()); + } + revisionCase_ = 4; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public Builder mergeAliasContext(io.grafeas.v1beta1.source.AliasContext value) { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 4 && + revision_ != io.grafeas.v1beta1.source.AliasContext.getDefaultInstance()) { + revision_ = io.grafeas.v1beta1.source.AliasContext.newBuilder((io.grafeas.v1beta1.source.AliasContext) revision_) + .mergeFrom(value).buildPartial(); + } else { + revision_ = value; + } + onChanged(); + } else { + if (revisionCase_ == 4) { + aliasContextBuilder_.mergeFrom(value); + } + aliasContextBuilder_.setMessage(value); + } + revisionCase_ = 4; + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public Builder clearAliasContext() { + if (aliasContextBuilder_ == null) { + if (revisionCase_ == 4) { + revisionCase_ = 0; + revision_ = null; + onChanged(); + } + } else { + if (revisionCase_ == 4) { + revisionCase_ = 0; + revision_ = null; + } + aliasContextBuilder_.clear(); + } + return this; + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public io.grafeas.v1beta1.source.AliasContext.Builder getAliasContextBuilder() { + return getAliasContextFieldBuilder().getBuilder(); + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + public io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder() { + if ((revisionCase_ == 4) && (aliasContextBuilder_ != null)) { + return aliasContextBuilder_.getMessageOrBuilder(); + } else { + if (revisionCase_ == 4) { + return (io.grafeas.v1beta1.source.AliasContext) revision_; + } + return io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + } + /** + *
+     * An alias, which may be a branch or tag.
+     * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder> + getAliasContextFieldBuilder() { + if (aliasContextBuilder_ == null) { + if (!(revisionCase_ == 4)) { + revision_ = io.grafeas.v1beta1.source.AliasContext.getDefaultInstance(); + } + aliasContextBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.AliasContext, io.grafeas.v1beta1.source.AliasContext.Builder, io.grafeas.v1beta1.source.AliasContextOrBuilder>( + (io.grafeas.v1beta1.source.AliasContext) revision_, + getParentForChildren(), + isClean()); + revision_ = null; + } + revisionCase_ = 4; + onChanged();; + return aliasContextBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.GerritSourceContext) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.GerritSourceContext) + private static final io.grafeas.v1beta1.source.GerritSourceContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.GerritSourceContext(); + } + + public static io.grafeas.v1beta1.source.GerritSourceContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GerritSourceContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GerritSourceContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GerritSourceContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContextOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContextOrBuilder.java new file mode 100644 index 000000000000..a8446b54a390 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GerritSourceContextOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface GerritSourceContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.GerritSourceContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The URI of a running Gerrit instance.
+   * 
+ * + * string host_uri = 1; + */ + java.lang.String getHostUri(); + /** + *
+   * The URI of a running Gerrit instance.
+   * 
+ * + * string host_uri = 1; + */ + com.google.protobuf.ByteString + getHostUriBytes(); + + /** + *
+   * The full project name within the host. Projects may be nested, so
+   * "project/subproject" is a valid project name. The "repo name" is the
+   * hostURI/project.
+   * 
+ * + * string gerrit_project = 2; + */ + java.lang.String getGerritProject(); + /** + *
+   * The full project name within the host. Projects may be nested, so
+   * "project/subproject" is a valid project name. The "repo name" is the
+   * hostURI/project.
+   * 
+ * + * string gerrit_project = 2; + */ + com.google.protobuf.ByteString + getGerritProjectBytes(); + + /** + *
+   * A revision (commit) ID.
+   * 
+ * + * string revision_id = 3; + */ + java.lang.String getRevisionId(); + /** + *
+   * A revision (commit) ID.
+   * 
+ * + * string revision_id = 3; + */ + com.google.protobuf.ByteString + getRevisionIdBytes(); + + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + boolean hasAliasContext(); + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + io.grafeas.v1beta1.source.AliasContext getAliasContext(); + /** + *
+   * An alias, which may be a branch or tag.
+   * 
+ * + * .grafeas.v1beta1.source.AliasContext alias_context = 4; + */ + io.grafeas.v1beta1.source.AliasContextOrBuilder getAliasContextOrBuilder(); + + public io.grafeas.v1beta1.source.GerritSourceContext.RevisionCase getRevisionCase(); +} 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 new file mode 100644 index 000000000000..ef5b2cc19623 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContext.java @@ -0,0 +1,734 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * A GitSourceContext denotes a particular revision in a third party Git
+ * repository (e.g., GitHub).
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.GitSourceContext} + */ +public final class GitSourceContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.GitSourceContext) + GitSourceContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use GitSourceContext.newBuilder() to construct. + private GitSourceContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GitSourceContext() { + url_ = ""; + revisionId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GitSourceContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + revisionId_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GitSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.GitSourceContext.class, io.grafeas.v1beta1.source.GitSourceContext.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + *
+   * Git repository URL.
+   * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + *
+   * Git repository URL.
+   * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVISION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object revisionId_; + /** + *
+   * Git commit hash.
+   * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } + } + /** + *
+   * Git commit hash.
+   * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (!getRevisionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (!getRevisionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.GitSourceContext)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.GitSourceContext other = (io.grafeas.v1beta1.source.GitSourceContext) obj; + + boolean result = true; + result = result && getUrl() + .equals(other.getUrl()); + result = result && getRevisionId() + .equals(other.getRevisionId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.GitSourceContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.GitSourceContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A GitSourceContext denotes a particular revision in a third party Git
+   * repository (e.g., GitHub).
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.GitSourceContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.GitSourceContext) + io.grafeas.v1beta1.source.GitSourceContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GitSourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.GitSourceContext.class, io.grafeas.v1beta1.source.GitSourceContext.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.GitSourceContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + revisionId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GitSourceContext getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GitSourceContext build() { + io.grafeas.v1beta1.source.GitSourceContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GitSourceContext buildPartial() { + io.grafeas.v1beta1.source.GitSourceContext result = new io.grafeas.v1beta1.source.GitSourceContext(this); + result.url_ = url_; + result.revisionId_ = revisionId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.GitSourceContext) { + return mergeFrom((io.grafeas.v1beta1.source.GitSourceContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.GitSourceContext other) { + if (other == io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.GitSourceContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.GitSourceContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+     * Git repository URL.
+     * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Git repository URL.
+     * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Git repository URL.
+     * 
+ * + * string url = 1; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+     * Git repository URL.
+     * 
+ * + * string url = 1; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+     * Git repository URL.
+     * 
+ * + * string url = 1; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private java.lang.Object revisionId_ = ""; + /** + *
+     * Git commit hash.
+     * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Git commit hash.
+     * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Git commit hash.
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revisionId_ = value; + onChanged(); + return this; + } + /** + *
+     * Git commit hash.
+     * 
+ * + * string revision_id = 2; + */ + public Builder clearRevisionId() { + + revisionId_ = getDefaultInstance().getRevisionId(); + onChanged(); + return this; + } + /** + *
+     * Git commit hash.
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revisionId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.GitSourceContext) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.GitSourceContext) + private static final io.grafeas.v1beta1.source.GitSourceContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.GitSourceContext(); + } + + public static io.grafeas.v1beta1.source.GitSourceContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GitSourceContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GitSourceContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.GitSourceContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContextOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContextOrBuilder.java new file mode 100644 index 000000000000..2d4277517902 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/GitSourceContextOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface GitSourceContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.GitSourceContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Git repository URL.
+   * 
+ * + * string url = 1; + */ + java.lang.String getUrl(); + /** + *
+   * Git repository URL.
+   * 
+ * + * string url = 1; + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + *
+   * Git commit hash.
+   * 
+ * + * string revision_id = 2; + */ + java.lang.String getRevisionId(); + /** + *
+   * Git commit hash.
+   * 
+ * + * string revision_id = 2; + */ + com.google.protobuf.ByteString + getRevisionIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/NoteName.java new file mode 100644 index 000000000000..b5ed572b5010 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.source; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/source/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/OccurrenceName.java new file mode 100644 index 000000000000..74a9f9fdba29 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.source; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectName.java new file mode 100644 index 000000000000..4f0e3ef3d87b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.source; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-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 new file mode 100644 index 000000000000..c605892ab5f6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoId.java @@ -0,0 +1,734 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * Selects a repo using a Google Cloud Platform project ID (e.g.,
+ * winged-cargo-31) and a repo name within that project.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.ProjectRepoId} + */ +public final class ProjectRepoId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.ProjectRepoId) + ProjectRepoIdOrBuilder { +private static final long serialVersionUID = 0L; + // Use ProjectRepoId.newBuilder() to construct. + private ProjectRepoId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ProjectRepoId() { + projectId_ = ""; + repoName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProjectRepoId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + projectId_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + repoName_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_ProjectRepoId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.ProjectRepoId.class, io.grafeas.v1beta1.source.ProjectRepoId.Builder.class); + } + + public static final int PROJECT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object projectId_; + /** + *
+   * The ID of the project.
+   * 
+ * + * string project_id = 1; + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + *
+   * The ID of the project.
+   * 
+ * + * string project_id = 1; + */ + public com.google.protobuf.ByteString + getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPO_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object repoName_; + /** + *
+   * The name of the repo. Leave empty for the default repo.
+   * 
+ * + * string repo_name = 2; + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } + } + /** + *
+   * The name of the repo. Leave empty for the default repo.
+   * 
+ * + * string repo_name = 2; + */ + public com.google.protobuf.ByteString + getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getProjectIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, projectId_); + } + if (!getRepoNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, repoName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getProjectIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, projectId_); + } + if (!getRepoNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, repoName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.ProjectRepoId)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.ProjectRepoId other = (io.grafeas.v1beta1.source.ProjectRepoId) obj; + + boolean result = true; + result = result && getProjectId() + .equals(other.getProjectId()); + result = result && getRepoName() + .equals(other.getRepoName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + REPO_NAME_FIELD_NUMBER; + hash = (53 * hash) + getRepoName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.ProjectRepoId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.ProjectRepoId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Selects a repo using a Google Cloud Platform project ID (e.g.,
+   * winged-cargo-31) and a repo name within that project.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.ProjectRepoId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.ProjectRepoId) + io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_ProjectRepoId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.ProjectRepoId.class, io.grafeas.v1beta1.source.ProjectRepoId.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.ProjectRepoId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + projectId_ = ""; + + repoName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.ProjectRepoId getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.ProjectRepoId build() { + io.grafeas.v1beta1.source.ProjectRepoId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.ProjectRepoId buildPartial() { + io.grafeas.v1beta1.source.ProjectRepoId result = new io.grafeas.v1beta1.source.ProjectRepoId(this); + result.projectId_ = projectId_; + result.repoName_ = repoName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.ProjectRepoId) { + return mergeFrom((io.grafeas.v1beta1.source.ProjectRepoId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.ProjectRepoId other) { + if (other == io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance()) return this; + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + onChanged(); + } + if (!other.getRepoName().isEmpty()) { + repoName_ = other.repoName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.ProjectRepoId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.ProjectRepoId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object projectId_ = ""; + /** + *
+     * The ID of the project.
+     * 
+ * + * string project_id = 1; + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The ID of the project.
+     * 
+ * + * string project_id = 1; + */ + public com.google.protobuf.ByteString + getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The ID of the project.
+     * 
+ * + * string project_id = 1; + */ + public Builder setProjectId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + projectId_ = value; + onChanged(); + return this; + } + /** + *
+     * The ID of the project.
+     * 
+ * + * string project_id = 1; + */ + public Builder clearProjectId() { + + projectId_ = getDefaultInstance().getProjectId(); + onChanged(); + return this; + } + /** + *
+     * The ID of the project.
+     * 
+ * + * string project_id = 1; + */ + public Builder setProjectIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + projectId_ = value; + onChanged(); + return this; + } + + private java.lang.Object repoName_ = ""; + /** + *
+     * The name of the repo. Leave empty for the default repo.
+     * 
+ * + * string repo_name = 2; + */ + public java.lang.String getRepoName() { + java.lang.Object ref = repoName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repoName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the repo. Leave empty for the default repo.
+     * 
+ * + * string repo_name = 2; + */ + public com.google.protobuf.ByteString + getRepoNameBytes() { + java.lang.Object ref = repoName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repoName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the repo. Leave empty for the default repo.
+     * 
+ * + * string repo_name = 2; + */ + public Builder setRepoName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repoName_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the repo. Leave empty for the default repo.
+     * 
+ * + * string repo_name = 2; + */ + public Builder clearRepoName() { + + repoName_ = getDefaultInstance().getRepoName(); + onChanged(); + return this; + } + /** + *
+     * The name of the repo. Leave empty for the default repo.
+     * 
+ * + * string repo_name = 2; + */ + public Builder setRepoNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repoName_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.ProjectRepoId) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.ProjectRepoId) + private static final io.grafeas.v1beta1.source.ProjectRepoId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.ProjectRepoId(); + } + + public static io.grafeas.v1beta1.source.ProjectRepoId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ProjectRepoId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProjectRepoId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.ProjectRepoId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoIdOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoIdOrBuilder.java new file mode 100644 index 000000000000..ce4cf336b6ab --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ProjectRepoIdOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface ProjectRepoIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.ProjectRepoId) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The ID of the project.
+   * 
+ * + * string project_id = 1; + */ + java.lang.String getProjectId(); + /** + *
+   * The ID of the project.
+   * 
+ * + * string project_id = 1; + */ + com.google.protobuf.ByteString + getProjectIdBytes(); + + /** + *
+   * The name of the repo. Leave empty for the default repo.
+   * 
+ * + * string repo_name = 2; + */ + java.lang.String getRepoName(); + /** + *
+   * The name of the repo. Leave empty for the default repo.
+   * 
+ * + * string repo_name = 2; + */ + com.google.protobuf.ByteString + getRepoNameBytes(); +} 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 new file mode 100644 index 000000000000..47cbd6623831 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoId.java @@ -0,0 +1,924 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * A unique identifier for a Cloud Repo.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.RepoId} + */ +public final class RepoId extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.RepoId) + RepoIdOrBuilder { +private static final long serialVersionUID = 0L; + // Use RepoId.newBuilder() to construct. + private RepoId(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RepoId() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RepoId( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.source.ProjectRepoId.Builder subBuilder = null; + if (idCase_ == 1) { + subBuilder = ((io.grafeas.v1beta1.source.ProjectRepoId) id_).toBuilder(); + } + id_ = + input.readMessage(io.grafeas.v1beta1.source.ProjectRepoId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.ProjectRepoId) id_); + id_ = subBuilder.buildPartial(); + } + idCase_ = 1; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + idCase_ = 2; + id_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_RepoId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_RepoId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.RepoId.class, io.grafeas.v1beta1.source.RepoId.Builder.class); + } + + private int idCase_ = 0; + private java.lang.Object id_; + public enum IdCase + implements com.google.protobuf.Internal.EnumLite { + PROJECT_REPO_ID(1), + UID(2), + ID_NOT_SET(0); + private final int value; + private IdCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IdCase valueOf(int value) { + return forNumber(value); + } + + public static IdCase forNumber(int value) { + switch (value) { + case 1: return PROJECT_REPO_ID; + case 2: return UID; + case 0: return ID_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public IdCase + getIdCase() { + return IdCase.forNumber( + idCase_); + } + + public static final int PROJECT_REPO_ID_FIELD_NUMBER = 1; + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public boolean hasProjectRepoId() { + return idCase_ == 1; + } + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public io.grafeas.v1beta1.source.ProjectRepoId getProjectRepoId() { + if (idCase_ == 1) { + return (io.grafeas.v1beta1.source.ProjectRepoId) id_; + } + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder getProjectRepoIdOrBuilder() { + if (idCase_ == 1) { + return (io.grafeas.v1beta1.source.ProjectRepoId) id_; + } + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + + public static final int UID_FIELD_NUMBER = 2; + /** + *
+   * A server-assigned, globally unique identifier.
+   * 
+ * + * string uid = 2; + */ + public java.lang.String getUid() { + java.lang.Object ref = ""; + if (idCase_ == 2) { + ref = id_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (idCase_ == 2) { + id_ = s; + } + return s; + } + } + /** + *
+   * A server-assigned, globally unique identifier.
+   * 
+ * + * string uid = 2; + */ + public com.google.protobuf.ByteString + getUidBytes() { + java.lang.Object ref = ""; + if (idCase_ == 2) { + ref = id_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (idCase_ == 2) { + id_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (idCase_ == 1) { + output.writeMessage(1, (io.grafeas.v1beta1.source.ProjectRepoId) id_); + } + if (idCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, id_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (idCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.grafeas.v1beta1.source.ProjectRepoId) id_); + } + if (idCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, id_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.RepoId)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.RepoId other = (io.grafeas.v1beta1.source.RepoId) obj; + + boolean result = true; + result = result && getIdCase().equals( + other.getIdCase()); + if (!result) return false; + switch (idCase_) { + case 1: + result = result && getProjectRepoId() + .equals(other.getProjectRepoId()); + break; + case 2: + result = result && getUid() + .equals(other.getUid()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (idCase_) { + case 1: + hash = (37 * hash) + PROJECT_REPO_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectRepoId().hashCode(); + break; + case 2: + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.RepoId parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.RepoId parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.RepoId parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.RepoId parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.RepoId prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A unique identifier for a Cloud Repo.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.RepoId} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.RepoId) + io.grafeas.v1beta1.source.RepoIdOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_RepoId_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_RepoId_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.RepoId.class, io.grafeas.v1beta1.source.RepoId.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.RepoId.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + idCase_ = 0; + id_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_RepoId_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.RepoId getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.RepoId.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.RepoId build() { + io.grafeas.v1beta1.source.RepoId result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.RepoId buildPartial() { + io.grafeas.v1beta1.source.RepoId result = new io.grafeas.v1beta1.source.RepoId(this); + if (idCase_ == 1) { + if (projectRepoIdBuilder_ == null) { + result.id_ = id_; + } else { + result.id_ = projectRepoIdBuilder_.build(); + } + } + if (idCase_ == 2) { + result.id_ = id_; + } + result.idCase_ = idCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.RepoId) { + return mergeFrom((io.grafeas.v1beta1.source.RepoId)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.RepoId other) { + if (other == io.grafeas.v1beta1.source.RepoId.getDefaultInstance()) return this; + switch (other.getIdCase()) { + case PROJECT_REPO_ID: { + mergeProjectRepoId(other.getProjectRepoId()); + break; + } + case UID: { + idCase_ = 2; + id_ = other.id_; + onChanged(); + break; + } + case ID_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.RepoId parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.RepoId) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int idCase_ = 0; + private java.lang.Object id_; + public IdCase + getIdCase() { + return IdCase.forNumber( + idCase_); + } + + public Builder clearId() { + idCase_ = 0; + id_ = null; + onChanged(); + return this; + } + + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.ProjectRepoId, io.grafeas.v1beta1.source.ProjectRepoId.Builder, io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder> projectRepoIdBuilder_; + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public boolean hasProjectRepoId() { + return idCase_ == 1; + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public io.grafeas.v1beta1.source.ProjectRepoId getProjectRepoId() { + if (projectRepoIdBuilder_ == null) { + if (idCase_ == 1) { + return (io.grafeas.v1beta1.source.ProjectRepoId) id_; + } + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } else { + if (idCase_ == 1) { + return projectRepoIdBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public Builder setProjectRepoId(io.grafeas.v1beta1.source.ProjectRepoId value) { + if (projectRepoIdBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + id_ = value; + onChanged(); + } else { + projectRepoIdBuilder_.setMessage(value); + } + idCase_ = 1; + return this; + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public Builder setProjectRepoId( + io.grafeas.v1beta1.source.ProjectRepoId.Builder builderForValue) { + if (projectRepoIdBuilder_ == null) { + id_ = builderForValue.build(); + onChanged(); + } else { + projectRepoIdBuilder_.setMessage(builderForValue.build()); + } + idCase_ = 1; + return this; + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public Builder mergeProjectRepoId(io.grafeas.v1beta1.source.ProjectRepoId value) { + if (projectRepoIdBuilder_ == null) { + if (idCase_ == 1 && + id_ != io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance()) { + id_ = io.grafeas.v1beta1.source.ProjectRepoId.newBuilder((io.grafeas.v1beta1.source.ProjectRepoId) id_) + .mergeFrom(value).buildPartial(); + } else { + id_ = value; + } + onChanged(); + } else { + if (idCase_ == 1) { + projectRepoIdBuilder_.mergeFrom(value); + } + projectRepoIdBuilder_.setMessage(value); + } + idCase_ = 1; + return this; + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public Builder clearProjectRepoId() { + if (projectRepoIdBuilder_ == null) { + if (idCase_ == 1) { + idCase_ = 0; + id_ = null; + onChanged(); + } + } else { + if (idCase_ == 1) { + idCase_ = 0; + id_ = null; + } + projectRepoIdBuilder_.clear(); + } + return this; + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public io.grafeas.v1beta1.source.ProjectRepoId.Builder getProjectRepoIdBuilder() { + return getProjectRepoIdFieldBuilder().getBuilder(); + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + public io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder getProjectRepoIdOrBuilder() { + if ((idCase_ == 1) && (projectRepoIdBuilder_ != null)) { + return projectRepoIdBuilder_.getMessageOrBuilder(); + } else { + if (idCase_ == 1) { + return (io.grafeas.v1beta1.source.ProjectRepoId) id_; + } + return io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + } + /** + *
+     * A combination of a project ID and a repo name.
+     * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.ProjectRepoId, io.grafeas.v1beta1.source.ProjectRepoId.Builder, io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder> + getProjectRepoIdFieldBuilder() { + if (projectRepoIdBuilder_ == null) { + if (!(idCase_ == 1)) { + id_ = io.grafeas.v1beta1.source.ProjectRepoId.getDefaultInstance(); + } + projectRepoIdBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.ProjectRepoId, io.grafeas.v1beta1.source.ProjectRepoId.Builder, io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder>( + (io.grafeas.v1beta1.source.ProjectRepoId) id_, + getParentForChildren(), + isClean()); + id_ = null; + } + idCase_ = 1; + onChanged();; + return projectRepoIdBuilder_; + } + + /** + *
+     * A server-assigned, globally unique identifier.
+     * 
+ * + * string uid = 2; + */ + public java.lang.String getUid() { + java.lang.Object ref = ""; + if (idCase_ == 2) { + ref = id_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (idCase_ == 2) { + id_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A server-assigned, globally unique identifier.
+     * 
+ * + * string uid = 2; + */ + public com.google.protobuf.ByteString + getUidBytes() { + java.lang.Object ref = ""; + if (idCase_ == 2) { + ref = id_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (idCase_ == 2) { + id_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A server-assigned, globally unique identifier.
+     * 
+ * + * string uid = 2; + */ + public Builder setUid( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + idCase_ = 2; + id_ = value; + onChanged(); + return this; + } + /** + *
+     * A server-assigned, globally unique identifier.
+     * 
+ * + * string uid = 2; + */ + public Builder clearUid() { + if (idCase_ == 2) { + idCase_ = 0; + id_ = null; + onChanged(); + } + return this; + } + /** + *
+     * A server-assigned, globally unique identifier.
+     * 
+ * + * string uid = 2; + */ + public Builder setUidBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + idCase_ = 2; + id_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.RepoId) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.RepoId) + private static final io.grafeas.v1beta1.source.RepoId DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.RepoId(); + } + + public static io.grafeas.v1beta1.source.RepoId getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RepoId parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RepoId(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.RepoId getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoIdOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoIdOrBuilder.java new file mode 100644 index 000000000000..b2f828266cf9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/RepoIdOrBuilder.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface RepoIdOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.RepoId) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + boolean hasProjectRepoId(); + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + io.grafeas.v1beta1.source.ProjectRepoId getProjectRepoId(); + /** + *
+   * A combination of a project ID and a repo name.
+   * 
+ * + * .grafeas.v1beta1.source.ProjectRepoId project_repo_id = 1; + */ + io.grafeas.v1beta1.source.ProjectRepoIdOrBuilder getProjectRepoIdOrBuilder(); + + /** + *
+   * A server-assigned, globally unique identifier.
+   * 
+ * + * string uid = 2; + */ + java.lang.String getUid(); + /** + *
+   * A server-assigned, globally unique identifier.
+   * 
+ * + * string uid = 2; + */ + com.google.protobuf.ByteString + getUidBytes(); + + public io.grafeas.v1beta1.source.RepoId.IdCase getIdCase(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ScanConfigName.java new file mode 100644 index 000000000000..e5fa8aceb0c1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.source; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + 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 new file mode 100644 index 000000000000..3a4bd1ddf010 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/Source.java @@ -0,0 +1,162 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public final class Source { + private Source() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_SourceContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_SourceContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_AliasContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_AliasContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_GerritSourceContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_GitSourceContext_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_RepoId_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_RepoId_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_source_ProjectRepoId_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n=google/devtools/containeranalysis/v1be" + + "ta1/source/source.proto\022\026grafeas.v1beta1" + + ".source\"\312\002\n\rSourceContext\022D\n\ncloud_repo\030" + + "\001 \001(\0132..grafeas.v1beta1.source.CloudRepo" + + "SourceContextH\000\022=\n\006gerrit\030\002 \001(\0132+.grafea" + + "s.v1beta1.source.GerritSourceContextH\000\0227" + + "\n\003git\030\003 \001(\0132(.grafeas.v1beta1.source.Git" + + "SourceContextH\000\022A\n\006labels\030\004 \003(\01321.grafea" + + "s.v1beta1.source.SourceContext.LabelsEnt" + + "ry\032-\n\013LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" + + "\002 \001(\t:\0028\001B\t\n\007context\"\226\001\n\014AliasContext\0227\n" + + "\004kind\030\001 \001(\0162).grafeas.v1beta1.source.Ali" + + "asContext.Kind\022\014\n\004name\030\002 \001(\t\"?\n\004Kind\022\024\n\020" + + "KIND_UNSPECIFIED\020\000\022\t\n\005FIXED\020\001\022\013\n\007MOVABLE" + + "\020\002\022\t\n\005OTHER\020\004\"\253\001\n\026CloudRepoSourceContext" + + "\022/\n\007repo_id\030\001 \001(\0132\036.grafeas.v1beta1.sour" + + "ce.RepoId\022\025\n\013revision_id\030\002 \001(\tH\000\022=\n\ralia" + + "s_context\030\003 \001(\0132$.grafeas.v1beta1.source" + + ".AliasContextH\000B\n\n\010revision\"\241\001\n\023GerritSo" + + "urceContext\022\020\n\010host_uri\030\001 \001(\t\022\026\n\016gerrit_" + + "project\030\002 \001(\t\022\025\n\013revision_id\030\003 \001(\tH\000\022=\n\r" + + "alias_context\030\004 \001(\0132$.grafeas.v1beta1.so" + + "urce.AliasContextH\000B\n\n\010revision\"4\n\020GitSo" + + "urceContext\022\013\n\003url\030\001 \001(\t\022\023\n\013revision_id\030" + + "\002 \001(\t\"_\n\006RepoId\022@\n\017project_repo_id\030\001 \001(\013" + + "2%.grafeas.v1beta1.source.ProjectRepoIdH" + + "\000\022\r\n\003uid\030\002 \001(\tH\000B\004\n\002id\"6\n\rProjectRepoId\022" + + "\022\n\nproject_id\030\001 \001(\t\022\021\n\trepo_name\030\002 \001(\tB{" + + "\n\031io.grafeas.v1beta1.sourceP\001ZVgoogle.go" + + "lang.org/genproto/googleapis/devtools/co" + + "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); + internal_static_grafeas_v1beta1_source_SourceContext_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_source_SourceContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_SourceContext_descriptor, + new java.lang.String[] { "CloudRepo", "Gerrit", "Git", "Labels", "Context", }); + internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_descriptor = + internal_static_grafeas_v1beta1_source_SourceContext_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_grafeas_v1beta1_source_AliasContext_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_source_AliasContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_AliasContext_descriptor, + new java.lang.String[] { "Kind", "Name", }); + internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_CloudRepoSourceContext_descriptor, + new java.lang.String[] { "RepoId", "RevisionId", "AliasContext", "Revision", }); + internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_source_GerritSourceContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_GerritSourceContext_descriptor, + new java.lang.String[] { "HostUri", "GerritProject", "RevisionId", "AliasContext", "Revision", }); + internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_grafeas_v1beta1_source_GitSourceContext_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_GitSourceContext_descriptor, + new java.lang.String[] { "Url", "RevisionId", }); + internal_static_grafeas_v1beta1_source_RepoId_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_grafeas_v1beta1_source_RepoId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_RepoId_descriptor, + new java.lang.String[] { "ProjectRepoId", "Uid", "Id", }); + internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_grafeas_v1beta1_source_ProjectRepoId_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_source_ProjectRepoId_descriptor, + new java.lang.String[] { "ProjectId", "RepoName", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} 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 new file mode 100644 index 000000000000..3880abf0a4a0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContext.java @@ -0,0 +1,1570 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +/** + *
+ * A SourceContext is a reference to a tree of files. A SourceContext together
+ * with a path point to a unique revision of a single file or directory.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.SourceContext} + */ +public final class SourceContext extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.source.SourceContext) + SourceContextOrBuilder { +private static final long serialVersionUID = 0L; + // Use SourceContext.newBuilder() to construct. + private SourceContext(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SourceContext() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SourceContext( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder subBuilder = null; + if (contextCase_ == 1) { + subBuilder = ((io.grafeas.v1beta1.source.CloudRepoSourceContext) context_).toBuilder(); + } + context_ = + input.readMessage(io.grafeas.v1beta1.source.CloudRepoSourceContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.CloudRepoSourceContext) context_); + context_ = subBuilder.buildPartial(); + } + contextCase_ = 1; + break; + } + case 18: { + io.grafeas.v1beta1.source.GerritSourceContext.Builder subBuilder = null; + if (contextCase_ == 2) { + subBuilder = ((io.grafeas.v1beta1.source.GerritSourceContext) context_).toBuilder(); + } + context_ = + input.readMessage(io.grafeas.v1beta1.source.GerritSourceContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.GerritSourceContext) context_); + context_ = subBuilder.buildPartial(); + } + contextCase_ = 2; + break; + } + case 26: { + io.grafeas.v1beta1.source.GitSourceContext.Builder subBuilder = null; + if (contextCase_ == 3) { + subBuilder = ((io.grafeas.v1beta1.source.GitSourceContext) context_).toBuilder(); + } + context_ = + input.readMessage(io.grafeas.v1beta1.source.GitSourceContext.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((io.grafeas.v1beta1.source.GitSourceContext) context_); + context_ = subBuilder.buildPartial(); + } + contextCase_ = 3; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000008; + } + com.google.protobuf.MapEntry + labels__ = input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + labels_.getMutableMap().put( + labels__.getKey(), labels__.getValue()); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.SourceContext.class, io.grafeas.v1beta1.source.SourceContext.Builder.class); + } + + private int bitField0_; + private int contextCase_ = 0; + private java.lang.Object context_; + public enum ContextCase + implements com.google.protobuf.Internal.EnumLite { + CLOUD_REPO(1), + GERRIT(2), + GIT(3), + CONTEXT_NOT_SET(0); + private final int value; + private ContextCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ContextCase valueOf(int value) { + return forNumber(value); + } + + public static ContextCase forNumber(int value) { + switch (value) { + case 1: return CLOUD_REPO; + case 2: return GERRIT; + case 3: return GIT; + case 0: return CONTEXT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ContextCase + getContextCase() { + return ContextCase.forNumber( + contextCase_); + } + + public static final int CLOUD_REPO_FIELD_NUMBER = 1; + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public boolean hasCloudRepo() { + return contextCase_ == 1; + } + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public io.grafeas.v1beta1.source.CloudRepoSourceContext getCloudRepo() { + if (contextCase_ == 1) { + return (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_; + } + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder getCloudRepoOrBuilder() { + if (contextCase_ == 1) { + return (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_; + } + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + + public static final int GERRIT_FIELD_NUMBER = 2; + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public boolean hasGerrit() { + return contextCase_ == 2; + } + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public io.grafeas.v1beta1.source.GerritSourceContext getGerrit() { + if (contextCase_ == 2) { + return (io.grafeas.v1beta1.source.GerritSourceContext) context_; + } + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public io.grafeas.v1beta1.source.GerritSourceContextOrBuilder getGerritOrBuilder() { + if (contextCase_ == 2) { + return (io.grafeas.v1beta1.source.GerritSourceContext) context_; + } + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + + public static final int GIT_FIELD_NUMBER = 3; + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public boolean hasGit() { + return contextCase_ == 3; + } + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public io.grafeas.v1beta1.source.GitSourceContext getGit() { + if (contextCase_ == 3) { + return (io.grafeas.v1beta1.source.GitSourceContext) context_; + } + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public io.grafeas.v1beta1.source.GitSourceContextOrBuilder getGitOrBuilder() { + if (contextCase_ == 3) { + return (io.grafeas.v1beta1.source.GitSourceContext) context_; + } + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + + public static final int LABELS_FIELD_NUMBER = 4; + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (contextCase_ == 1) { + output.writeMessage(1, (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_); + } + if (contextCase_ == 2) { + output.writeMessage(2, (io.grafeas.v1beta1.source.GerritSourceContext) context_); + } + if (contextCase_ == 3) { + output.writeMessage(3, (io.grafeas.v1beta1.source.GitSourceContext) context_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetLabels(), + LabelsDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (contextCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_); + } + if (contextCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (io.grafeas.v1beta1.source.GerritSourceContext) context_); + } + if (contextCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (io.grafeas.v1beta1.source.GitSourceContext) context_); + } + for (java.util.Map.Entry entry + : internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry + labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, labels__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.source.SourceContext)) { + return super.equals(obj); + } + io.grafeas.v1beta1.source.SourceContext other = (io.grafeas.v1beta1.source.SourceContext) obj; + + boolean result = true; + result = result && internalGetLabels().equals( + other.internalGetLabels()); + result = result && getContextCase().equals( + other.getContextCase()); + if (!result) return false; + switch (contextCase_) { + case 1: + result = result && getCloudRepo() + .equals(other.getCloudRepo()); + break; + case 2: + result = result && getGerrit() + .equals(other.getGerrit()); + break; + case 3: + result = result && getGit() + .equals(other.getGit()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + switch (contextCase_) { + case 1: + hash = (37 * hash) + CLOUD_REPO_FIELD_NUMBER; + hash = (53 * hash) + getCloudRepo().hashCode(); + break; + case 2: + hash = (37 * hash) + GERRIT_FIELD_NUMBER; + hash = (53 * hash) + getGerrit().hashCode(); + break; + case 3: + hash = (37 * hash) + GIT_FIELD_NUMBER; + hash = (53 * hash) + getGit().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.SourceContext parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.SourceContext parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.source.SourceContext parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.source.SourceContext prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A SourceContext is a reference to a tree of files. A SourceContext together
+   * with a path point to a unique revision of a single file or directory.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.source.SourceContext} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.source.SourceContext) + io.grafeas.v1beta1.source.SourceContextOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.source.SourceContext.class, io.grafeas.v1beta1.source.SourceContext.Builder.class); + } + + // Construct using io.grafeas.v1beta1.source.SourceContext.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableLabels().clear(); + contextCase_ = 0; + context_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.source.Source.internal_static_grafeas_v1beta1_source_SourceContext_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.SourceContext getDefaultInstanceForType() { + return io.grafeas.v1beta1.source.SourceContext.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.source.SourceContext build() { + io.grafeas.v1beta1.source.SourceContext result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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_; + } else { + result.context_ = cloudRepoBuilder_.build(); + } + } + if (contextCase_ == 2) { + if (gerritBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = gerritBuilder_.build(); + } + } + if (contextCase_ == 3) { + if (gitBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = gitBuilder_.build(); + } + } + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + result.bitField0_ = to_bitField0_; + result.contextCase_ = contextCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.source.SourceContext) { + return mergeFrom((io.grafeas.v1beta1.source.SourceContext)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.source.SourceContext other) { + if (other == io.grafeas.v1beta1.source.SourceContext.getDefaultInstance()) return this; + internalGetMutableLabels().mergeFrom( + other.internalGetLabels()); + switch (other.getContextCase()) { + case CLOUD_REPO: { + mergeCloudRepo(other.getCloudRepo()); + break; + } + case GERRIT: { + mergeGerrit(other.getGerrit()); + break; + } + case GIT: { + mergeGit(other.getGit()); + break; + } + case CONTEXT_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.source.SourceContext parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.source.SourceContext) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int contextCase_ = 0; + private java.lang.Object context_; + public ContextCase + getContextCase() { + return ContextCase.forNumber( + contextCase_); + } + + public Builder clearContext() { + contextCase_ = 0; + context_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.CloudRepoSourceContext, io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder, io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder> cloudRepoBuilder_; + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public boolean hasCloudRepo() { + return contextCase_ == 1; + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public io.grafeas.v1beta1.source.CloudRepoSourceContext getCloudRepo() { + if (cloudRepoBuilder_ == null) { + if (contextCase_ == 1) { + return (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_; + } + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } else { + if (contextCase_ == 1) { + return cloudRepoBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public Builder setCloudRepo(io.grafeas.v1beta1.source.CloudRepoSourceContext value) { + if (cloudRepoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + cloudRepoBuilder_.setMessage(value); + } + contextCase_ = 1; + return this; + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public Builder setCloudRepo( + io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder builderForValue) { + if (cloudRepoBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + cloudRepoBuilder_.setMessage(builderForValue.build()); + } + contextCase_ = 1; + return this; + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public Builder mergeCloudRepo(io.grafeas.v1beta1.source.CloudRepoSourceContext value) { + if (cloudRepoBuilder_ == null) { + if (contextCase_ == 1 && + context_ != io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance()) { + context_ = io.grafeas.v1beta1.source.CloudRepoSourceContext.newBuilder((io.grafeas.v1beta1.source.CloudRepoSourceContext) context_) + .mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + if (contextCase_ == 1) { + cloudRepoBuilder_.mergeFrom(value); + } + cloudRepoBuilder_.setMessage(value); + } + contextCase_ = 1; + return this; + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public Builder clearCloudRepo() { + if (cloudRepoBuilder_ == null) { + if (contextCase_ == 1) { + contextCase_ = 0; + context_ = null; + onChanged(); + } + } else { + if (contextCase_ == 1) { + contextCase_ = 0; + context_ = null; + } + cloudRepoBuilder_.clear(); + } + return this; + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder getCloudRepoBuilder() { + return getCloudRepoFieldBuilder().getBuilder(); + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + public io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder getCloudRepoOrBuilder() { + if ((contextCase_ == 1) && (cloudRepoBuilder_ != null)) { + return cloudRepoBuilder_.getMessageOrBuilder(); + } else { + if (contextCase_ == 1) { + return (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_; + } + return io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to a revision in a Google Cloud Source Repo.
+     * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.CloudRepoSourceContext, io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder, io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder> + getCloudRepoFieldBuilder() { + if (cloudRepoBuilder_ == null) { + if (!(contextCase_ == 1)) { + context_ = io.grafeas.v1beta1.source.CloudRepoSourceContext.getDefaultInstance(); + } + cloudRepoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.CloudRepoSourceContext, io.grafeas.v1beta1.source.CloudRepoSourceContext.Builder, io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder>( + (io.grafeas.v1beta1.source.CloudRepoSourceContext) context_, + getParentForChildren(), + isClean()); + context_ = null; + } + contextCase_ = 1; + onChanged();; + return cloudRepoBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GerritSourceContext, io.grafeas.v1beta1.source.GerritSourceContext.Builder, io.grafeas.v1beta1.source.GerritSourceContextOrBuilder> gerritBuilder_; + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public boolean hasGerrit() { + return contextCase_ == 2; + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public io.grafeas.v1beta1.source.GerritSourceContext getGerrit() { + if (gerritBuilder_ == null) { + if (contextCase_ == 2) { + return (io.grafeas.v1beta1.source.GerritSourceContext) context_; + } + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } else { + if (contextCase_ == 2) { + return gerritBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public Builder setGerrit(io.grafeas.v1beta1.source.GerritSourceContext value) { + if (gerritBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + gerritBuilder_.setMessage(value); + } + contextCase_ = 2; + return this; + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public Builder setGerrit( + io.grafeas.v1beta1.source.GerritSourceContext.Builder builderForValue) { + if (gerritBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + gerritBuilder_.setMessage(builderForValue.build()); + } + contextCase_ = 2; + return this; + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public Builder mergeGerrit(io.grafeas.v1beta1.source.GerritSourceContext value) { + if (gerritBuilder_ == null) { + if (contextCase_ == 2 && + context_ != io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance()) { + context_ = io.grafeas.v1beta1.source.GerritSourceContext.newBuilder((io.grafeas.v1beta1.source.GerritSourceContext) context_) + .mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + if (contextCase_ == 2) { + gerritBuilder_.mergeFrom(value); + } + gerritBuilder_.setMessage(value); + } + contextCase_ = 2; + return this; + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public Builder clearGerrit() { + if (gerritBuilder_ == null) { + if (contextCase_ == 2) { + contextCase_ = 0; + context_ = null; + onChanged(); + } + } else { + if (contextCase_ == 2) { + contextCase_ = 0; + context_ = null; + } + gerritBuilder_.clear(); + } + return this; + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public io.grafeas.v1beta1.source.GerritSourceContext.Builder getGerritBuilder() { + return getGerritFieldBuilder().getBuilder(); + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + public io.grafeas.v1beta1.source.GerritSourceContextOrBuilder getGerritOrBuilder() { + if ((contextCase_ == 2) && (gerritBuilder_ != null)) { + return gerritBuilder_.getMessageOrBuilder(); + } else { + if (contextCase_ == 2) { + return (io.grafeas.v1beta1.source.GerritSourceContext) context_; + } + return io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to a Gerrit project.
+     * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GerritSourceContext, io.grafeas.v1beta1.source.GerritSourceContext.Builder, io.grafeas.v1beta1.source.GerritSourceContextOrBuilder> + getGerritFieldBuilder() { + if (gerritBuilder_ == null) { + if (!(contextCase_ == 2)) { + context_ = io.grafeas.v1beta1.source.GerritSourceContext.getDefaultInstance(); + } + gerritBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GerritSourceContext, io.grafeas.v1beta1.source.GerritSourceContext.Builder, io.grafeas.v1beta1.source.GerritSourceContextOrBuilder>( + (io.grafeas.v1beta1.source.GerritSourceContext) context_, + getParentForChildren(), + isClean()); + context_ = null; + } + contextCase_ = 2; + onChanged();; + return gerritBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GitSourceContext, io.grafeas.v1beta1.source.GitSourceContext.Builder, io.grafeas.v1beta1.source.GitSourceContextOrBuilder> gitBuilder_; + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public boolean hasGit() { + return contextCase_ == 3; + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public io.grafeas.v1beta1.source.GitSourceContext getGit() { + if (gitBuilder_ == null) { + if (contextCase_ == 3) { + return (io.grafeas.v1beta1.source.GitSourceContext) context_; + } + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } else { + if (contextCase_ == 3) { + return gitBuilder_.getMessage(); + } + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public Builder setGit(io.grafeas.v1beta1.source.GitSourceContext value) { + if (gitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + gitBuilder_.setMessage(value); + } + contextCase_ = 3; + return this; + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public Builder setGit( + io.grafeas.v1beta1.source.GitSourceContext.Builder builderForValue) { + if (gitBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + gitBuilder_.setMessage(builderForValue.build()); + } + contextCase_ = 3; + return this; + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public Builder mergeGit(io.grafeas.v1beta1.source.GitSourceContext value) { + if (gitBuilder_ == null) { + if (contextCase_ == 3 && + context_ != io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance()) { + context_ = io.grafeas.v1beta1.source.GitSourceContext.newBuilder((io.grafeas.v1beta1.source.GitSourceContext) context_) + .mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + if (contextCase_ == 3) { + gitBuilder_.mergeFrom(value); + } + gitBuilder_.setMessage(value); + } + contextCase_ = 3; + return this; + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public Builder clearGit() { + if (gitBuilder_ == null) { + if (contextCase_ == 3) { + contextCase_ = 0; + context_ = null; + onChanged(); + } + } else { + if (contextCase_ == 3) { + contextCase_ = 0; + context_ = null; + } + gitBuilder_.clear(); + } + return this; + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public io.grafeas.v1beta1.source.GitSourceContext.Builder getGitBuilder() { + return getGitFieldBuilder().getBuilder(); + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + public io.grafeas.v1beta1.source.GitSourceContextOrBuilder getGitOrBuilder() { + if ((contextCase_ == 3) && (gitBuilder_ != null)) { + return gitBuilder_.getMessageOrBuilder(); + } else { + if (contextCase_ == 3) { + return (io.grafeas.v1beta1.source.GitSourceContext) context_; + } + return io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + } + /** + *
+     * A SourceContext referring to any third party Git repo (e.g., GitHub).
+     * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GitSourceContext, io.grafeas.v1beta1.source.GitSourceContext.Builder, io.grafeas.v1beta1.source.GitSourceContextOrBuilder> + getGitFieldBuilder() { + if (gitBuilder_ == null) { + if (!(contextCase_ == 3)) { + context_ = io.grafeas.v1beta1.source.GitSourceContext.getDefaultInstance(); + } + gitBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.source.GitSourceContext, io.grafeas.v1beta1.source.GitSourceContext.Builder, io.grafeas.v1beta1.source.GitSourceContextOrBuilder>( + (io.grafeas.v1beta1.source.GitSourceContext) context_, + getParentForChildren(), + isClean()); + context_ = null; + } + contextCase_ = 3; + onChanged();; + return gitBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> labels_; + private com.google.protobuf.MapField + internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + private com.google.protobuf.MapField + internalGetMutableLabels() { + onChanged();; + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public boolean containsLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetLabels().getMap().containsKey(key); + } + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public java.lang.String getLabelsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + internalGetMutableLabels().getMutableMap() + .clear(); + return this; + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public Builder removeLabels( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableLabels() { + return internalGetMutableLabels().getMutableMap(); + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + public Builder putLabels( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableLabels().getMutableMap() + .put(key, value); + return this; + } + /** + *
+     * Labels with user defined metadata.
+     * 
+ * + * map<string, string> labels = 4; + */ + + public Builder putAllLabels( + java.util.Map values) { + internalGetMutableLabels().getMutableMap() + .putAll(values); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.source.SourceContext) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.source.SourceContext) + private static final io.grafeas.v1beta1.source.SourceContext DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.source.SourceContext(); + } + + public static io.grafeas.v1beta1.source.SourceContext getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SourceContext parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceContext(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.source.SourceContext getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContextOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContextOrBuilder.java new file mode 100644 index 000000000000..ba1ea958ec7e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/source/SourceContextOrBuilder.java @@ -0,0 +1,140 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/source/source.proto + +package io.grafeas.v1beta1.source; + +public interface SourceContextOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.source.SourceContext) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + boolean hasCloudRepo(); + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + io.grafeas.v1beta1.source.CloudRepoSourceContext getCloudRepo(); + /** + *
+   * A SourceContext referring to a revision in a Google Cloud Source Repo.
+   * 
+ * + * .grafeas.v1beta1.source.CloudRepoSourceContext cloud_repo = 1; + */ + io.grafeas.v1beta1.source.CloudRepoSourceContextOrBuilder getCloudRepoOrBuilder(); + + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + boolean hasGerrit(); + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + io.grafeas.v1beta1.source.GerritSourceContext getGerrit(); + /** + *
+   * A SourceContext referring to a Gerrit project.
+   * 
+ * + * .grafeas.v1beta1.source.GerritSourceContext gerrit = 2; + */ + io.grafeas.v1beta1.source.GerritSourceContextOrBuilder getGerritOrBuilder(); + + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + boolean hasGit(); + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + io.grafeas.v1beta1.source.GitSourceContext getGit(); + /** + *
+   * A SourceContext referring to any third party Git repo (e.g., GitHub).
+   * 
+ * + * .grafeas.v1beta1.source.GitSourceContext git = 3; + */ + io.grafeas.v1beta1.source.GitSourceContextOrBuilder getGitOrBuilder(); + + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + int getLabelsCount(); + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + boolean containsLabels( + java.lang.String key); + /** + * Use {@link #getLabelsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getLabels(); + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + java.util.Map + getLabelsMap(); + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + java.lang.String getLabelsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+   * Labels with user defined metadata.
+   * 
+ * + * map<string, string> labels = 4; + */ + + java.lang.String getLabelsOrThrow( + java.lang.String key); + + public io.grafeas.v1beta1.source.SourceContext.ContextCase getContextCase(); +} 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 new file mode 100644 index 000000000000..ab2d3382cd1d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Details.java @@ -0,0 +1,1990 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +/** + *
+ * Details of a vulnerability occurrence.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Details} + */ +public final class Details extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.vulnerability.Details) + DetailsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Details() { + type_ = ""; + severity_ = 0; + cvssScore_ = 0F; + packageIssue_ = java.util.Collections.emptyList(); + shortDescription_ = ""; + longDescription_ = ""; + relatedUrls_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Details( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 29: { + + cvssScore_ = input.readFloat(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + packageIssue_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + packageIssue_.add( + input.readMessage(io.grafeas.v1beta1.vulnerability.PackageIssue.parser(), extensionRegistry)); + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + shortDescription_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + longDescription_ = s; + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + relatedUrls_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + relatedUrls_.add( + input.readMessage(io.grafeas.v1beta1.common.RelatedUrl.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Details.class, io.grafeas.v1beta1.vulnerability.Details.Builder.class); + } + + private int bitField0_; + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + *
+   * The type of package; whether native or non native(ruby gems, node.js
+   * packages etc)
+   * 
+ * + * string type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + *
+   * The type of package; whether native or non native(ruby gems, node.js
+   * packages etc)
+   * 
+ * + * string type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+   * Output only. The note provider assigned Severity of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+   * Output only. The note provider assigned Severity of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + + public static final int CVSS_SCORE_FIELD_NUMBER = 3; + private float cvssScore_; + /** + *
+   * Output only. The CVSS score of this vulnerability. CVSS score is on a
+   * scale of 0-10 where 0 indicates low severity and 10 indicates high
+   * severity.
+   * 
+ * + * float cvss_score = 3; + */ + public float getCvssScore() { + return cvssScore_; + } + + public static final int PACKAGE_ISSUE_FIELD_NUMBER = 4; + private java.util.List packageIssue_; + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public java.util.List getPackageIssueList() { + return packageIssue_; + } + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public java.util.List + getPackageIssueOrBuilderList() { + return packageIssue_; + } + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public int getPackageIssueCount() { + return packageIssue_.size(); + } + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssue getPackageIssue(int index) { + return packageIssue_.get(index); + } + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder getPackageIssueOrBuilder( + int index) { + return packageIssue_.get(index); + } + + public static final int SHORT_DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object shortDescription_; + /** + *
+   * Output only. A one sentence description of this vulnerability.
+   * 
+ * + * string short_description = 5; + */ + public java.lang.String getShortDescription() { + java.lang.Object ref = shortDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortDescription_ = s; + return s; + } + } + /** + *
+   * Output only. A one sentence description of this vulnerability.
+   * 
+ * + * string short_description = 5; + */ + public com.google.protobuf.ByteString + getShortDescriptionBytes() { + java.lang.Object ref = shortDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shortDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LONG_DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object longDescription_; + /** + *
+   * Output only. A detailed description of this vulnerability.
+   * 
+ * + * string long_description = 6; + */ + public java.lang.String getLongDescription() { + java.lang.Object ref = longDescription_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + longDescription_ = s; + return s; + } + } + /** + *
+   * Output only. A detailed description of this vulnerability.
+   * 
+ * + * string long_description = 6; + */ + public com.google.protobuf.ByteString + getLongDescriptionBytes() { + java.lang.Object ref = longDescription_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RELATED_URLS_FIELD_NUMBER = 7; + private java.util.List relatedUrls_; + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public java.util.List getRelatedUrlsList() { + return relatedUrls_; + } + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public java.util.List + getRelatedUrlsOrBuilderList() { + return relatedUrls_; + } + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public int getRelatedUrlsCount() { + return relatedUrls_.size(); + } + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrl getRelatedUrls(int index) { + return relatedUrls_.get(index); + } + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlsOrBuilder( + int index) { + return relatedUrls_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + if (cvssScore_ != 0F) { + output.writeFloat(3, cvssScore_); + } + for (int i = 0; i < packageIssue_.size(); i++) { + output.writeMessage(4, packageIssue_.get(i)); + } + if (!getShortDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, shortDescription_); + } + if (!getLongDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, longDescription_); + } + for (int i = 0; i < relatedUrls_.size(); i++) { + output.writeMessage(7, relatedUrls_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + if (cvssScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(3, cvssScore_); + } + for (int i = 0; i < packageIssue_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, packageIssue_.get(i)); + } + if (!getShortDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, shortDescription_); + } + if (!getLongDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, longDescription_); + } + for (int i = 0; i < relatedUrls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, relatedUrls_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.vulnerability.Details)) { + return super.equals(obj); + } + io.grafeas.v1beta1.vulnerability.Details other = (io.grafeas.v1beta1.vulnerability.Details) obj; + + boolean result = true; + result = result && getType() + .equals(other.getType()); + result = result && severity_ == other.severity_; + result = result && ( + java.lang.Float.floatToIntBits(getCvssScore()) + == java.lang.Float.floatToIntBits( + other.getCvssScore())); + result = result && getPackageIssueList() + .equals(other.getPackageIssueList()); + result = result && getShortDescription() + .equals(other.getShortDescription()); + result = result && getLongDescription() + .equals(other.getLongDescription()); + result = result && getRelatedUrlsList() + .equals(other.getRelatedUrlsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + CVSS_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getCvssScore()); + if (getPackageIssueCount() > 0) { + hash = (37 * hash) + PACKAGE_ISSUE_FIELD_NUMBER; + hash = (53 * hash) + getPackageIssueList().hashCode(); + } + hash = (37 * hash) + SHORT_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getShortDescription().hashCode(); + hash = (37 * hash) + LONG_DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getLongDescription().hashCode(); + if (getRelatedUrlsCount() > 0) { + hash = (37 * hash) + RELATED_URLS_FIELD_NUMBER; + hash = (53 * hash) + getRelatedUrlsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Details parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Details parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Details parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.vulnerability.Details prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Details of a vulnerability occurrence.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Details} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.vulnerability.Details) + io.grafeas.v1beta1.vulnerability.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Details.class, io.grafeas.v1beta1.vulnerability.Details.Builder.class); + } + + // Construct using io.grafeas.v1beta1.vulnerability.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPackageIssueFieldBuilder(); + getRelatedUrlsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + severity_ = 0; + + cvssScore_ = 0F; + + if (packageIssueBuilder_ == null) { + packageIssue_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + packageIssueBuilder_.clear(); + } + shortDescription_ = ""; + + longDescription_ = ""; + + if (relatedUrlsBuilder_ == null) { + relatedUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + } else { + relatedUrlsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Details_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Details getDefaultInstanceForType() { + return io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Details build() { + io.grafeas.v1beta1.vulnerability.Details result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000008)) { + packageIssue_ = java.util.Collections.unmodifiableList(packageIssue_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.packageIssue_ = packageIssue_; + } else { + result.packageIssue_ = packageIssueBuilder_.build(); + } + result.shortDescription_ = shortDescription_; + result.longDescription_ = longDescription_; + if (relatedUrlsBuilder_ == null) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { + relatedUrls_ = java.util.Collections.unmodifiableList(relatedUrls_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.relatedUrls_ = relatedUrls_; + } else { + result.relatedUrls_ = relatedUrlsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.vulnerability.Details) { + return mergeFrom((io.grafeas.v1beta1.vulnerability.Details)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Details other) { + if (other == io.grafeas.v1beta1.vulnerability.Details.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (other.getCvssScore() != 0F) { + setCvssScore(other.getCvssScore()); + } + if (packageIssueBuilder_ == null) { + if (!other.packageIssue_.isEmpty()) { + if (packageIssue_.isEmpty()) { + packageIssue_ = other.packageIssue_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensurePackageIssueIsMutable(); + packageIssue_.addAll(other.packageIssue_); + } + onChanged(); + } + } else { + if (!other.packageIssue_.isEmpty()) { + if (packageIssueBuilder_.isEmpty()) { + packageIssueBuilder_.dispose(); + packageIssueBuilder_ = null; + packageIssue_ = other.packageIssue_; + bitField0_ = (bitField0_ & ~0x00000008); + packageIssueBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPackageIssueFieldBuilder() : null; + } else { + packageIssueBuilder_.addAllMessages(other.packageIssue_); + } + } + } + if (!other.getShortDescription().isEmpty()) { + shortDescription_ = other.shortDescription_; + onChanged(); + } + if (!other.getLongDescription().isEmpty()) { + longDescription_ = other.longDescription_; + onChanged(); + } + if (relatedUrlsBuilder_ == null) { + if (!other.relatedUrls_.isEmpty()) { + if (relatedUrls_.isEmpty()) { + relatedUrls_ = other.relatedUrls_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureRelatedUrlsIsMutable(); + relatedUrls_.addAll(other.relatedUrls_); + } + onChanged(); + } + } else { + if (!other.relatedUrls_.isEmpty()) { + if (relatedUrlsBuilder_.isEmpty()) { + relatedUrlsBuilder_.dispose(); + relatedUrlsBuilder_ = null; + relatedUrls_ = other.relatedUrls_; + bitField0_ = (bitField0_ & ~0x00000040); + relatedUrlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRelatedUrlsFieldBuilder() : null; + } else { + relatedUrlsBuilder_.addAllMessages(other.relatedUrls_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.vulnerability.Details parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.vulnerability.Details) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object type_ = ""; + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc)
+     * 
+ * + * string type = 1; + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc)
+     * 
+ * + * string type = 1; + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc)
+     * 
+ * + * string type = 1; + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc)
+     * 
+ * + * string type = 1; + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc)
+     * 
+ * + * string type = 1; + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + *
+     * Output only. The note provider assigned Severity of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+     * Output only. The note provider assigned Severity of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverityValue(int value) { + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The note provider assigned Severity of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + /** + *
+     * Output only. The note provider assigned Severity of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverity(io.grafeas.v1beta1.vulnerability.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Output only. The note provider assigned Severity of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private float cvssScore_ ; + /** + *
+     * Output only. The CVSS score of this vulnerability. CVSS score is on a
+     * scale of 0-10 where 0 indicates low severity and 10 indicates high
+     * severity.
+     * 
+ * + * float cvss_score = 3; + */ + public float getCvssScore() { + return cvssScore_; + } + /** + *
+     * Output only. The CVSS score of this vulnerability. CVSS score is on a
+     * scale of 0-10 where 0 indicates low severity and 10 indicates high
+     * severity.
+     * 
+ * + * float cvss_score = 3; + */ + public Builder setCvssScore(float value) { + + cvssScore_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. The CVSS score of this vulnerability. CVSS score is on a
+     * scale of 0-10 where 0 indicates low severity and 10 indicates high
+     * severity.
+     * 
+ * + * float cvss_score = 3; + */ + public Builder clearCvssScore() { + + cvssScore_ = 0F; + onChanged(); + return this; + } + + private java.util.List packageIssue_ = + java.util.Collections.emptyList(); + private void ensurePackageIssueIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + packageIssue_ = new java.util.ArrayList(packageIssue_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.PackageIssue, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder, io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder> packageIssueBuilder_; + + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public java.util.List getPackageIssueList() { + if (packageIssueBuilder_ == null) { + return java.util.Collections.unmodifiableList(packageIssue_); + } else { + return packageIssueBuilder_.getMessageList(); + } + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public int getPackageIssueCount() { + if (packageIssueBuilder_ == null) { + return packageIssue_.size(); + } else { + return packageIssueBuilder_.getCount(); + } + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssue getPackageIssue(int index) { + if (packageIssueBuilder_ == null) { + return packageIssue_.get(index); + } else { + return packageIssueBuilder_.getMessage(index); + } + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder setPackageIssue( + int index, io.grafeas.v1beta1.vulnerability.PackageIssue value) { + if (packageIssueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePackageIssueIsMutable(); + packageIssue_.set(index, value); + onChanged(); + } else { + packageIssueBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder setPackageIssue( + int index, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder builderForValue) { + if (packageIssueBuilder_ == null) { + ensurePackageIssueIsMutable(); + packageIssue_.set(index, builderForValue.build()); + onChanged(); + } else { + packageIssueBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder addPackageIssue(io.grafeas.v1beta1.vulnerability.PackageIssue value) { + if (packageIssueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePackageIssueIsMutable(); + packageIssue_.add(value); + onChanged(); + } else { + packageIssueBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder addPackageIssue( + int index, io.grafeas.v1beta1.vulnerability.PackageIssue value) { + if (packageIssueBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePackageIssueIsMutable(); + packageIssue_.add(index, value); + onChanged(); + } else { + packageIssueBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder addPackageIssue( + io.grafeas.v1beta1.vulnerability.PackageIssue.Builder builderForValue) { + if (packageIssueBuilder_ == null) { + ensurePackageIssueIsMutable(); + packageIssue_.add(builderForValue.build()); + onChanged(); + } else { + packageIssueBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder addPackageIssue( + int index, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder builderForValue) { + if (packageIssueBuilder_ == null) { + ensurePackageIssueIsMutable(); + packageIssue_.add(index, builderForValue.build()); + onChanged(); + } else { + packageIssueBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder addAllPackageIssue( + java.lang.Iterable values) { + if (packageIssueBuilder_ == null) { + ensurePackageIssueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, packageIssue_); + onChanged(); + } else { + packageIssueBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder clearPackageIssue() { + if (packageIssueBuilder_ == null) { + packageIssue_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + packageIssueBuilder_.clear(); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public Builder removePackageIssue(int index) { + if (packageIssueBuilder_ == null) { + ensurePackageIssueIsMutable(); + packageIssue_.remove(index); + onChanged(); + } else { + packageIssueBuilder_.remove(index); + } + return this; + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssue.Builder getPackageIssueBuilder( + int index) { + return getPackageIssueFieldBuilder().getBuilder(index); + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder getPackageIssueOrBuilder( + int index) { + if (packageIssueBuilder_ == null) { + return packageIssue_.get(index); } else { + return packageIssueBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public java.util.List + getPackageIssueOrBuilderList() { + if (packageIssueBuilder_ != null) { + return packageIssueBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(packageIssue_); + } + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssue.Builder addPackageIssueBuilder() { + return getPackageIssueFieldBuilder().addBuilder( + io.grafeas.v1beta1.vulnerability.PackageIssue.getDefaultInstance()); + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public io.grafeas.v1beta1.vulnerability.PackageIssue.Builder addPackageIssueBuilder( + int index) { + return getPackageIssueFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.vulnerability.PackageIssue.getDefaultInstance()); + } + /** + *
+     * The set of affected locations and their fixes (if available) within the
+     * associated resource.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + public java.util.List + getPackageIssueBuilderList() { + return getPackageIssueFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.PackageIssue, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder, io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder> + getPackageIssueFieldBuilder() { + if (packageIssueBuilder_ == null) { + packageIssueBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.PackageIssue, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder, io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder>( + packageIssue_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + packageIssue_ = null; + } + return packageIssueBuilder_; + } + + private java.lang.Object shortDescription_ = ""; + /** + *
+     * Output only. A one sentence description of this vulnerability.
+     * 
+ * + * string short_description = 5; + */ + public java.lang.String getShortDescription() { + java.lang.Object ref = shortDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + shortDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. A one sentence description of this vulnerability.
+     * 
+ * + * string short_description = 5; + */ + public com.google.protobuf.ByteString + getShortDescriptionBytes() { + java.lang.Object ref = shortDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + shortDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. A one sentence description of this vulnerability.
+     * 
+ * + * string short_description = 5; + */ + public Builder setShortDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + shortDescription_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. A one sentence description of this vulnerability.
+     * 
+ * + * string short_description = 5; + */ + public Builder clearShortDescription() { + + shortDescription_ = getDefaultInstance().getShortDescription(); + onChanged(); + return this; + } + /** + *
+     * Output only. A one sentence description of this vulnerability.
+     * 
+ * + * string short_description = 5; + */ + public Builder setShortDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + shortDescription_ = value; + onChanged(); + return this; + } + + private java.lang.Object longDescription_ = ""; + /** + *
+     * Output only. A detailed description of this vulnerability.
+     * 
+ * + * string long_description = 6; + */ + public java.lang.String getLongDescription() { + java.lang.Object ref = longDescription_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + longDescription_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Output only. A detailed description of this vulnerability.
+     * 
+ * + * string long_description = 6; + */ + public com.google.protobuf.ByteString + getLongDescriptionBytes() { + java.lang.Object ref = longDescription_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + longDescription_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Output only. A detailed description of this vulnerability.
+     * 
+ * + * string long_description = 6; + */ + public Builder setLongDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + longDescription_ = value; + onChanged(); + return this; + } + /** + *
+     * Output only. A detailed description of this vulnerability.
+     * 
+ * + * string long_description = 6; + */ + public Builder clearLongDescription() { + + longDescription_ = getDefaultInstance().getLongDescription(); + onChanged(); + return this; + } + /** + *
+     * Output only. A detailed description of this vulnerability.
+     * 
+ * + * string long_description = 6; + */ + public Builder setLongDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + longDescription_ = value; + onChanged(); + return this; + } + + private java.util.List relatedUrls_ = + java.util.Collections.emptyList(); + private void ensureRelatedUrlsIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + relatedUrls_ = new java.util.ArrayList(relatedUrls_); + bitField0_ |= 0x00000040; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder> relatedUrlsBuilder_; + + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public java.util.List getRelatedUrlsList() { + if (relatedUrlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(relatedUrls_); + } else { + return relatedUrlsBuilder_.getMessageList(); + } + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public int getRelatedUrlsCount() { + if (relatedUrlsBuilder_ == null) { + return relatedUrls_.size(); + } else { + return relatedUrlsBuilder_.getCount(); + } + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrl getRelatedUrls(int index) { + if (relatedUrlsBuilder_ == null) { + return relatedUrls_.get(index); + } else { + return relatedUrlsBuilder_.getMessage(index); + } + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder setRelatedUrls( + int index, io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlsIsMutable(); + relatedUrls_.set(index, value); + onChanged(); + } else { + relatedUrlsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder setRelatedUrls( + int index, io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlsBuilder_ == null) { + ensureRelatedUrlsIsMutable(); + relatedUrls_.set(index, builderForValue.build()); + onChanged(); + } else { + relatedUrlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder addRelatedUrls(io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlsIsMutable(); + relatedUrls_.add(value); + onChanged(); + } else { + relatedUrlsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder addRelatedUrls( + int index, io.grafeas.v1beta1.common.RelatedUrl value) { + if (relatedUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelatedUrlsIsMutable(); + relatedUrls_.add(index, value); + onChanged(); + } else { + relatedUrlsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder addRelatedUrls( + io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlsBuilder_ == null) { + ensureRelatedUrlsIsMutable(); + relatedUrls_.add(builderForValue.build()); + onChanged(); + } else { + relatedUrlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder addRelatedUrls( + int index, io.grafeas.v1beta1.common.RelatedUrl.Builder builderForValue) { + if (relatedUrlsBuilder_ == null) { + ensureRelatedUrlsIsMutable(); + relatedUrls_.add(index, builderForValue.build()); + onChanged(); + } else { + relatedUrlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder addAllRelatedUrls( + java.lang.Iterable values) { + if (relatedUrlsBuilder_ == null) { + ensureRelatedUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, relatedUrls_); + onChanged(); + } else { + relatedUrlsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder clearRelatedUrls() { + if (relatedUrlsBuilder_ == null) { + relatedUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + } else { + relatedUrlsBuilder_.clear(); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public Builder removeRelatedUrls(int index) { + if (relatedUrlsBuilder_ == null) { + ensureRelatedUrlsIsMutable(); + relatedUrls_.remove(index); + onChanged(); + } else { + relatedUrlsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder getRelatedUrlsBuilder( + int index) { + return getRelatedUrlsFieldBuilder().getBuilder(index); + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlsOrBuilder( + int index) { + if (relatedUrlsBuilder_ == null) { + return relatedUrls_.get(index); } else { + return relatedUrlsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public java.util.List + getRelatedUrlsOrBuilderList() { + if (relatedUrlsBuilder_ != null) { + return relatedUrlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(relatedUrls_); + } + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder addRelatedUrlsBuilder() { + return getRelatedUrlsFieldBuilder().addBuilder( + io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance()); + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public io.grafeas.v1beta1.common.RelatedUrl.Builder addRelatedUrlsBuilder( + int index) { + return getRelatedUrlsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.common.RelatedUrl.getDefaultInstance()); + } + /** + *
+     * Output only. URLs related to this vulnerability.
+     * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + public java.util.List + getRelatedUrlsBuilderList() { + return getRelatedUrlsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder> + getRelatedUrlsFieldBuilder() { + if (relatedUrlsBuilder_ == null) { + relatedUrlsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.common.RelatedUrl, io.grafeas.v1beta1.common.RelatedUrl.Builder, io.grafeas.v1beta1.common.RelatedUrlOrBuilder>( + relatedUrls_, + ((bitField0_ & 0x00000040) == 0x00000040), + getParentForChildren(), + isClean()); + relatedUrls_ = null; + } + return relatedUrlsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.vulnerability.Details) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.vulnerability.Details) + private static final io.grafeas.v1beta1.vulnerability.Details DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.vulnerability.Details(); + } + + public static io.grafeas.v1beta1.vulnerability.Details getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Details getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/DetailsOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/DetailsOrBuilder.java new file mode 100644 index 000000000000..837cafd26b99 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/DetailsOrBuilder.java @@ -0,0 +1,186 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +public interface DetailsOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.vulnerability.Details) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The type of package; whether native or non native(ruby gems, node.js
+   * packages etc)
+   * 
+ * + * string type = 1; + */ + java.lang.String getType(); + /** + *
+   * The type of package; whether native or non native(ruby gems, node.js
+   * packages etc)
+   * 
+ * + * string type = 1; + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
+   * Output only. The note provider assigned Severity of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + int getSeverityValue(); + /** + *
+   * Output only. The note provider assigned Severity of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + io.grafeas.v1beta1.vulnerability.Severity getSeverity(); + + /** + *
+   * Output only. The CVSS score of this vulnerability. CVSS score is on a
+   * scale of 0-10 where 0 indicates low severity and 10 indicates high
+   * severity.
+   * 
+ * + * float cvss_score = 3; + */ + float getCvssScore(); + + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + java.util.List + getPackageIssueList(); + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + io.grafeas.v1beta1.vulnerability.PackageIssue getPackageIssue(int index); + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + int getPackageIssueCount(); + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + java.util.List + getPackageIssueOrBuilderList(); + /** + *
+   * The set of affected locations and their fixes (if available) within the
+   * associated resource.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.PackageIssue package_issue = 4; + */ + io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder getPackageIssueOrBuilder( + int index); + + /** + *
+   * Output only. A one sentence description of this vulnerability.
+   * 
+ * + * string short_description = 5; + */ + java.lang.String getShortDescription(); + /** + *
+   * Output only. A one sentence description of this vulnerability.
+   * 
+ * + * string short_description = 5; + */ + com.google.protobuf.ByteString + getShortDescriptionBytes(); + + /** + *
+   * Output only. A detailed description of this vulnerability.
+   * 
+ * + * string long_description = 6; + */ + java.lang.String getLongDescription(); + /** + *
+   * Output only. A detailed description of this vulnerability.
+   * 
+ * + * string long_description = 6; + */ + com.google.protobuf.ByteString + getLongDescriptionBytes(); + + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + java.util.List + getRelatedUrlsList(); + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + io.grafeas.v1beta1.common.RelatedUrl getRelatedUrls(int index); + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + int getRelatedUrlsCount(); + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + java.util.List + getRelatedUrlsOrBuilderList(); + /** + *
+   * Output only. URLs related to this vulnerability.
+   * 
+ * + * repeated .grafeas.v1beta1.RelatedUrl related_urls = 7; + */ + io.grafeas.v1beta1.common.RelatedUrlOrBuilder getRelatedUrlsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/NoteName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/NoteName.java new file mode 100644 index 000000000000..ae7aeccf2cd9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/NoteName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.vulnerability; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class NoteName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private volatile Map 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-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/OccurrenceName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/OccurrenceName.java new file mode 100644 index 000000000000..c298ab50c2aa --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/OccurrenceName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.vulnerability; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class OccurrenceName implements ResourceName { + + 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-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 new file mode 100644 index 000000000000..f1f721ad8e90 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssue.java @@ -0,0 +1,1037 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +/** + *
+ * This message wraps a location affected by a vulnerability and its
+ * associated fix (if one is available).
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.PackageIssue} + */ +public final class PackageIssue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.vulnerability.PackageIssue) + PackageIssueOrBuilder { +private static final long serialVersionUID = 0L; + // Use PackageIssue.newBuilder() to construct. + private PackageIssue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PackageIssue() { + severityName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PackageIssue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder subBuilder = null; + if (affectedLocation_ != null) { + subBuilder = affectedLocation_.toBuilder(); + } + affectedLocation_ = input.readMessage(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(affectedLocation_); + affectedLocation_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder subBuilder = null; + if (fixedLocation_ != null) { + subBuilder = fixedLocation_.toBuilder(); + } + fixedLocation_ = input.readMessage(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fixedLocation_); + fixedLocation_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + severityName_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_PackageIssue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.PackageIssue.class, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder.class); + } + + public static final int AFFECTED_LOCATION_FIELD_NUMBER = 1; + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation affectedLocation_; + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public boolean hasAffectedLocation() { + return affectedLocation_ != null; + } + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getAffectedLocation() { + return affectedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : affectedLocation_; + } + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getAffectedLocationOrBuilder() { + return getAffectedLocation(); + } + + public static final int FIXED_LOCATION_FIELD_NUMBER = 2; + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation fixedLocation_; + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public boolean hasFixedLocation() { + return fixedLocation_ != null; + } + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation() { + return fixedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder() { + return getFixedLocation(); + } + + public static final int SEVERITY_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object severityName_; + /** + *
+   * The severity (e.g., distro assigned severity) for this vulnerability.
+   * 
+ * + * string severity_name = 3; + */ + public java.lang.String getSeverityName() { + java.lang.Object ref = severityName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severityName_ = s; + return s; + } + } + /** + *
+   * The severity (e.g., distro assigned severity) for this vulnerability.
+   * 
+ * + * string severity_name = 3; + */ + public com.google.protobuf.ByteString + getSeverityNameBytes() { + java.lang.Object ref = severityName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + severityName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (affectedLocation_ != null) { + output.writeMessage(1, getAffectedLocation()); + } + if (fixedLocation_ != null) { + output.writeMessage(2, getFixedLocation()); + } + if (!getSeverityNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, severityName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (affectedLocation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getAffectedLocation()); + } + if (fixedLocation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getFixedLocation()); + } + if (!getSeverityNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, severityName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.vulnerability.PackageIssue)) { + return super.equals(obj); + } + io.grafeas.v1beta1.vulnerability.PackageIssue other = (io.grafeas.v1beta1.vulnerability.PackageIssue) obj; + + boolean result = true; + result = result && (hasAffectedLocation() == other.hasAffectedLocation()); + if (hasAffectedLocation()) { + result = result && getAffectedLocation() + .equals(other.getAffectedLocation()); + } + result = result && (hasFixedLocation() == other.hasFixedLocation()); + if (hasFixedLocation()) { + result = result && getFixedLocation() + .equals(other.getFixedLocation()); + } + result = result && getSeverityName() + .equals(other.getSeverityName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasAffectedLocation()) { + hash = (37 * hash) + AFFECTED_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getAffectedLocation().hashCode(); + } + if (hasFixedLocation()) { + hash = (37 * hash) + FIXED_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getFixedLocation().hashCode(); + } + hash = (37 * hash) + SEVERITY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSeverityName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.PackageIssue parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.vulnerability.PackageIssue prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * This message wraps a location affected by a vulnerability and its
+   * associated fix (if one is available).
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.PackageIssue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.vulnerability.PackageIssue) + io.grafeas.v1beta1.vulnerability.PackageIssueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_PackageIssue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.PackageIssue.class, io.grafeas.v1beta1.vulnerability.PackageIssue.Builder.class); + } + + // Construct using io.grafeas.v1beta1.vulnerability.PackageIssue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (affectedLocationBuilder_ == null) { + affectedLocation_ = null; + } else { + affectedLocation_ = null; + affectedLocationBuilder_ = null; + } + if (fixedLocationBuilder_ == null) { + fixedLocation_ = null; + } else { + fixedLocation_ = null; + fixedLocationBuilder_ = null; + } + severityName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.PackageIssue getDefaultInstanceForType() { + return io.grafeas.v1beta1.vulnerability.PackageIssue.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.PackageIssue build() { + io.grafeas.v1beta1.vulnerability.PackageIssue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.PackageIssue buildPartial() { + io.grafeas.v1beta1.vulnerability.PackageIssue result = new io.grafeas.v1beta1.vulnerability.PackageIssue(this); + if (affectedLocationBuilder_ == null) { + result.affectedLocation_ = affectedLocation_; + } else { + result.affectedLocation_ = affectedLocationBuilder_.build(); + } + if (fixedLocationBuilder_ == null) { + result.fixedLocation_ = fixedLocation_; + } else { + result.fixedLocation_ = fixedLocationBuilder_.build(); + } + result.severityName_ = severityName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.vulnerability.PackageIssue) { + return mergeFrom((io.grafeas.v1beta1.vulnerability.PackageIssue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.PackageIssue other) { + if (other == io.grafeas.v1beta1.vulnerability.PackageIssue.getDefaultInstance()) return this; + if (other.hasAffectedLocation()) { + mergeAffectedLocation(other.getAffectedLocation()); + } + if (other.hasFixedLocation()) { + mergeFixedLocation(other.getFixedLocation()); + } + if (!other.getSeverityName().isEmpty()) { + severityName_ = other.severityName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.vulnerability.PackageIssue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.vulnerability.PackageIssue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation affectedLocation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> affectedLocationBuilder_; + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public boolean hasAffectedLocation() { + return affectedLocationBuilder_ != null || affectedLocation_ != null; + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getAffectedLocation() { + if (affectedLocationBuilder_ == null) { + return affectedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : affectedLocation_; + } else { + return affectedLocationBuilder_.getMessage(); + } + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public Builder setAffectedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (affectedLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + affectedLocation_ = value; + onChanged(); + } else { + affectedLocationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public Builder setAffectedLocation( + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder builderForValue) { + if (affectedLocationBuilder_ == null) { + affectedLocation_ = builderForValue.build(); + onChanged(); + } else { + affectedLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public Builder mergeAffectedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (affectedLocationBuilder_ == null) { + if (affectedLocation_ != null) { + affectedLocation_ = + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.newBuilder(affectedLocation_).mergeFrom(value).buildPartial(); + } else { + affectedLocation_ = value; + } + onChanged(); + } else { + affectedLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public Builder clearAffectedLocation() { + if (affectedLocationBuilder_ == null) { + affectedLocation_ = null; + onChanged(); + } else { + affectedLocation_ = null; + affectedLocationBuilder_ = null; + } + + return this; + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder getAffectedLocationBuilder() { + + onChanged(); + return getAffectedLocationFieldBuilder().getBuilder(); + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getAffectedLocationOrBuilder() { + if (affectedLocationBuilder_ != null) { + return affectedLocationBuilder_.getMessageOrBuilder(); + } else { + return affectedLocation_ == null ? + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : affectedLocation_; + } + } + /** + *
+     * The location of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> + getAffectedLocationFieldBuilder() { + if (affectedLocationBuilder_ == null) { + affectedLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder>( + getAffectedLocation(), + getParentForChildren(), + isClean()); + affectedLocation_ = null; + } + return affectedLocationBuilder_; + } + + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation fixedLocation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> fixedLocationBuilder_; + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public boolean hasFixedLocation() { + return fixedLocationBuilder_ != null || fixedLocation_ != null; + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation() { + if (fixedLocationBuilder_ == null) { + return fixedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } else { + return fixedLocationBuilder_.getMessage(); + } + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public Builder setFixedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (fixedLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fixedLocation_ = value; + onChanged(); + } else { + fixedLocationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public Builder setFixedLocation( + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder builderForValue) { + if (fixedLocationBuilder_ == null) { + fixedLocation_ = builderForValue.build(); + onChanged(); + } else { + fixedLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public Builder mergeFixedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (fixedLocationBuilder_ == null) { + if (fixedLocation_ != null) { + fixedLocation_ = + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.newBuilder(fixedLocation_).mergeFrom(value).buildPartial(); + } else { + fixedLocation_ = value; + } + onChanged(); + } else { + fixedLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public Builder clearFixedLocation() { + if (fixedLocationBuilder_ == null) { + fixedLocation_ = null; + onChanged(); + } else { + fixedLocation_ = null; + fixedLocationBuilder_ = null; + } + + return this; + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder getFixedLocationBuilder() { + + onChanged(); + return getFixedLocationFieldBuilder().getBuilder(); + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder() { + if (fixedLocationBuilder_ != null) { + return fixedLocationBuilder_.getMessageOrBuilder(); + } else { + return fixedLocation_ == null ? + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } + } + /** + *
+     * The location of the available fix for vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> + getFixedLocationFieldBuilder() { + if (fixedLocationBuilder_ == null) { + fixedLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder>( + getFixedLocation(), + getParentForChildren(), + isClean()); + fixedLocation_ = null; + } + return fixedLocationBuilder_; + } + + private java.lang.Object severityName_ = ""; + /** + *
+     * The severity (e.g., distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 3; + */ + public java.lang.String getSeverityName() { + java.lang.Object ref = severityName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severityName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The severity (e.g., distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 3; + */ + public com.google.protobuf.ByteString + getSeverityNameBytes() { + java.lang.Object ref = severityName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + severityName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The severity (e.g., distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 3; + */ + public Builder setSeverityName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + severityName_ = value; + onChanged(); + return this; + } + /** + *
+     * The severity (e.g., distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 3; + */ + public Builder clearSeverityName() { + + severityName_ = getDefaultInstance().getSeverityName(); + onChanged(); + return this; + } + /** + *
+     * The severity (e.g., distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 3; + */ + public Builder setSeverityNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + severityName_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.vulnerability.PackageIssue) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.vulnerability.PackageIssue) + private static final io.grafeas.v1beta1.vulnerability.PackageIssue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.vulnerability.PackageIssue(); + } + + public static io.grafeas.v1beta1.vulnerability.PackageIssue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PackageIssue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PackageIssue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.PackageIssue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssueOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssueOrBuilder.java new file mode 100644 index 000000000000..d1f8967c9997 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/PackageIssueOrBuilder.java @@ -0,0 +1,77 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +public interface PackageIssueOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.vulnerability.PackageIssue) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + boolean hasAffectedLocation(); + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getAffectedLocation(); + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation affected_location = 1; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getAffectedLocationOrBuilder(); + + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + boolean hasFixedLocation(); + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation(); + /** + *
+   * The location of the available fix for vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 2; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder(); + + /** + *
+   * The severity (e.g., distro assigned severity) for this vulnerability.
+   * 
+ * + * string severity_name = 3; + */ + java.lang.String getSeverityName(); + /** + *
+   * The severity (e.g., distro assigned severity) for this vulnerability.
+   * 
+ * + * string severity_name = 3; + */ + com.google.protobuf.ByteString + getSeverityNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ProjectName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ProjectName.java new file mode 100644 index 000000000000..b0889cda77be --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ProjectName.java @@ -0,0 +1,166 @@ +/* + * 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 io.grafeas.v1beta1.vulnerability; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// 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-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ScanConfigName.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ScanConfigName.java new file mode 100644 index 000000000000..196fccc98383 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/ScanConfigName.java @@ -0,0 +1,189 @@ +/* + * 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 io.grafeas.v1beta1.vulnerability; + +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import java.util.Map; +import java.util.ArrayList; +import java.util.List; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ScanConfigName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ScanConfigName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + } + + public static ScanConfigName of(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build(); + } + + public static String format(String project, String scanConfig) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .build() + .toString(); + } + + public static ScanConfigName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch(formattedString, "ScanConfigName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("scan_config")); + } + + 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 (ScanConfigName 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("scanConfig", scanConfig); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "scan_config", scanConfig); + } + + /** Builder for ScanConfigName. */ + public static class Builder { + + private String project; + private String scanConfig; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + private Builder() { + } + + private Builder(ScanConfigName scanConfigName) { + project = scanConfigName.project; + scanConfig = scanConfigName.scanConfig; + } + + public ScanConfigName build() { + return new ScanConfigName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ScanConfigName) { + ScanConfigName that = (ScanConfigName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + return h; + } +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Severity.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Severity.java new file mode 100644 index 000000000000..29b6f7c7acfc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Severity.java @@ -0,0 +1,191 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +/** + *
+ * Note provider-assigned severity/impact ranking.
+ * 
+ * + * Protobuf enum {@code grafeas.v1beta1.vulnerability.Severity} + */ +public enum Severity + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Unknown.
+   * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + *
+   * Minimal severity.
+   * 
+ * + * MINIMAL = 1; + */ + MINIMAL(1), + /** + *
+   * Low severity.
+   * 
+ * + * LOW = 2; + */ + LOW(2), + /** + *
+   * Medium severity.
+   * 
+ * + * MEDIUM = 3; + */ + MEDIUM(3), + /** + *
+   * High severity.
+   * 
+ * + * HIGH = 4; + */ + HIGH(4), + /** + *
+   * Critical severity.
+   * 
+ * + * CRITICAL = 5; + */ + CRITICAL(5), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Unknown.
+   * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + *
+   * Minimal severity.
+   * 
+ * + * MINIMAL = 1; + */ + public static final int MINIMAL_VALUE = 1; + /** + *
+   * Low severity.
+   * 
+ * + * LOW = 2; + */ + public static final int LOW_VALUE = 2; + /** + *
+   * Medium severity.
+   * 
+ * + * MEDIUM = 3; + */ + public static final int MEDIUM_VALUE = 3; + /** + *
+   * High severity.
+   * 
+ * + * HIGH = 4; + */ + public static final int HIGH_VALUE = 4; + /** + *
+   * Critical severity.
+   * 
+ * + * CRITICAL = 5; + */ + public static final int CRITICAL_VALUE = 5; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity valueOf(int value) { + return forNumber(value); + } + + public static Severity forNumber(int value) { + switch (value) { + case 0: return SEVERITY_UNSPECIFIED; + case 1: return MINIMAL; + case 2: return LOW; + case 3: return MEDIUM; + case 4: return HIGH; + case 5: return CRITICAL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Severity> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grafeas.v1beta1.vulnerability.Severity) +} + 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 new file mode 100644 index 000000000000..096d7fa6ae81 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/Vulnerability.java @@ -0,0 +1,3266 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +/** + *
+ * Vulnerability provides metadata about a security vulnerability.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Vulnerability} + */ +public final class Vulnerability extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.vulnerability.Vulnerability) + VulnerabilityOrBuilder { +private static final long serialVersionUID = 0L; + // Use Vulnerability.newBuilder() to construct. + private Vulnerability(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Vulnerability() { + cvssScore_ = 0F; + severity_ = 0; + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Vulnerability( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + + cvssScore_ = input.readFloat(); + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + details_.add( + input.readMessage(io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Vulnerability.class, io.grafeas.v1beta1.vulnerability.Vulnerability.Builder.class); + } + + public interface DetailOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.vulnerability.Vulnerability.Detail) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+     * which the vulnerability manifests.  Examples include distro or storage
+     * location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + java.lang.String getCpeUri(); + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+     * which the vulnerability manifests.  Examples include distro or storage
+     * location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + com.google.protobuf.ByteString + getCpeUriBytes(); + + /** + *
+     * The name of the package where the vulnerability was found.
+     * 
+ * + * string package = 2; + */ + java.lang.String getPackage(); + /** + *
+     * The name of the package where the vulnerability was found.
+     * 
+ * + * string package = 2; + */ + com.google.protobuf.ByteString + getPackageBytes(); + + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + boolean hasMinAffectedVersion(); + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + io.grafeas.v1beta1.pkg.Version getMinAffectedVersion(); + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + io.grafeas.v1beta1.pkg.VersionOrBuilder getMinAffectedVersionOrBuilder(); + + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + boolean hasMaxAffectedVersion(); + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + io.grafeas.v1beta1.pkg.Version getMaxAffectedVersion(); + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + io.grafeas.v1beta1.pkg.VersionOrBuilder getMaxAffectedVersionOrBuilder(); + + /** + *
+     * The severity (eg: distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 5; + */ + java.lang.String getSeverityName(); + /** + *
+     * The severity (eg: distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 5; + */ + com.google.protobuf.ByteString + getSeverityNameBytes(); + + /** + *
+     * A vendor-specific description of this note.
+     * 
+ * + * string description = 6; + */ + java.lang.String getDescription(); + /** + *
+     * A vendor-specific description of this note.
+     * 
+ * + * string description = 6; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + boolean hasFixedLocation(); + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation(); + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder(); + + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc).
+     * 
+ * + * string package_type = 8; + */ + java.lang.String getPackageType(); + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc).
+     * 
+ * + * string package_type = 8; + */ + com.google.protobuf.ByteString + getPackageTypeBytes(); + + /** + *
+     * Whether this detail is obsolete. Occurrences are expected not to point to
+     * obsolete details.
+     * 
+ * + * bool is_obsolete = 9; + */ + boolean getIsObsolete(); + } + /** + *
+   * Identifies all occurrences of this vulnerability in the package for a
+   * specific distro/location. For example: glibc in
+   * cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Vulnerability.Detail} + */ + public static final class Detail extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.vulnerability.Vulnerability.Detail) + DetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use Detail.newBuilder() to construct. + private Detail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Detail() { + cpeUri_ = ""; + package_ = ""; + severityName_ = ""; + description_ = ""; + packageType_ = ""; + isObsolete_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Detail( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + cpeUri_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + package_ = s; + break; + } + case 26: { + io.grafeas.v1beta1.pkg.Version.Builder subBuilder = null; + if (minAffectedVersion_ != null) { + subBuilder = minAffectedVersion_.toBuilder(); + } + minAffectedVersion_ = input.readMessage(io.grafeas.v1beta1.pkg.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(minAffectedVersion_); + minAffectedVersion_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + io.grafeas.v1beta1.pkg.Version.Builder subBuilder = null; + if (maxAffectedVersion_ != null) { + subBuilder = maxAffectedVersion_.toBuilder(); + } + maxAffectedVersion_ = input.readMessage(io.grafeas.v1beta1.pkg.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(maxAffectedVersion_); + maxAffectedVersion_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + severityName_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 58: { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder subBuilder = null; + if (fixedLocation_ != null) { + subBuilder = fixedLocation_.toBuilder(); + } + fixedLocation_ = input.readMessage(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(fixedLocation_); + fixedLocation_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + packageType_ = s; + break; + } + case 72: { + + isObsolete_ = input.readBool(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.class, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder.class); + } + + public static final int CPE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object cpeUri_; + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+     * which the vulnerability manifests.  Examples include distro or storage
+     * location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } + } + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+     * which the vulnerability manifests.  Examples include distro or storage
+     * location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PACKAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object package_; + /** + *
+     * The name of the package where the vulnerability was found.
+     * 
+ * + * string package = 2; + */ + public java.lang.String getPackage() { + java.lang.Object ref = package_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + package_ = s; + return s; + } + } + /** + *
+     * The name of the package where the vulnerability was found.
+     * 
+ * + * string package = 2; + */ + public com.google.protobuf.ByteString + getPackageBytes() { + java.lang.Object ref = package_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + package_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MIN_AFFECTED_VERSION_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.pkg.Version minAffectedVersion_; + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public boolean hasMinAffectedVersion() { + return minAffectedVersion_ != null; + } + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getMinAffectedVersion() { + return minAffectedVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : minAffectedVersion_; + } + /** + *
+     * The min version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getMinAffectedVersionOrBuilder() { + return getMinAffectedVersion(); + } + + public static final int MAX_AFFECTED_VERSION_FIELD_NUMBER = 4; + private io.grafeas.v1beta1.pkg.Version maxAffectedVersion_; + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public boolean hasMaxAffectedVersion() { + return maxAffectedVersion_ != null; + } + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public io.grafeas.v1beta1.pkg.Version getMaxAffectedVersion() { + return maxAffectedVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : maxAffectedVersion_; + } + /** + *
+     * The max version of the package in which the vulnerability exists.
+     * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getMaxAffectedVersionOrBuilder() { + return getMaxAffectedVersion(); + } + + public static final int SEVERITY_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object severityName_; + /** + *
+     * The severity (eg: distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 5; + */ + public java.lang.String getSeverityName() { + java.lang.Object ref = severityName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severityName_ = s; + return s; + } + } + /** + *
+     * The severity (eg: distro assigned severity) for this vulnerability.
+     * 
+ * + * string severity_name = 5; + */ + public com.google.protobuf.ByteString + getSeverityNameBytes() { + java.lang.Object ref = severityName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + severityName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object description_; + /** + *
+     * A vendor-specific description of this note.
+     * 
+ * + * string description = 6; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * A vendor-specific description of this note.
+     * 
+ * + * string description = 6; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIXED_LOCATION_FIELD_NUMBER = 7; + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation fixedLocation_; + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public boolean hasFixedLocation() { + return fixedLocation_ != null; + } + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation() { + return fixedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } + /** + *
+     * The fix for this specific package version.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder() { + return getFixedLocation(); + } + + public static final int PACKAGE_TYPE_FIELD_NUMBER = 8; + private volatile java.lang.Object packageType_; + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc).
+     * 
+ * + * string package_type = 8; + */ + public java.lang.String getPackageType() { + java.lang.Object ref = packageType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + packageType_ = s; + return s; + } + } + /** + *
+     * The type of package; whether native or non native(ruby gems, node.js
+     * packages etc).
+     * 
+ * + * string package_type = 8; + */ + public com.google.protobuf.ByteString + getPackageTypeBytes() { + java.lang.Object ref = packageType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_OBSOLETE_FIELD_NUMBER = 9; + private boolean isObsolete_; + /** + *
+     * Whether this detail is obsolete. Occurrences are expected not to point to
+     * obsolete details.
+     * 
+ * + * bool is_obsolete = 9; + */ + public boolean getIsObsolete() { + return isObsolete_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCpeUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_); + } + if (!getPackageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, package_); + } + if (minAffectedVersion_ != null) { + output.writeMessage(3, getMinAffectedVersion()); + } + if (maxAffectedVersion_ != null) { + output.writeMessage(4, getMaxAffectedVersion()); + } + if (!getSeverityNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, severityName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + if (fixedLocation_ != null) { + output.writeMessage(7, getFixedLocation()); + } + if (!getPackageTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, packageType_); + } + if (isObsolete_ != false) { + output.writeBool(9, isObsolete_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCpeUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_); + } + if (!getPackageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, package_); + } + if (minAffectedVersion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMinAffectedVersion()); + } + if (maxAffectedVersion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getMaxAffectedVersion()); + } + if (!getSeverityNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, severityName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + if (fixedLocation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getFixedLocation()); + } + if (!getPackageTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, packageType_); + } + if (isObsolete_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(9, isObsolete_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.vulnerability.Vulnerability.Detail)) { + return super.equals(obj); + } + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail other = (io.grafeas.v1beta1.vulnerability.Vulnerability.Detail) obj; + + boolean result = true; + result = result && getCpeUri() + .equals(other.getCpeUri()); + result = result && getPackage() + .equals(other.getPackage()); + result = result && (hasMinAffectedVersion() == other.hasMinAffectedVersion()); + if (hasMinAffectedVersion()) { + result = result && getMinAffectedVersion() + .equals(other.getMinAffectedVersion()); + } + result = result && (hasMaxAffectedVersion() == other.hasMaxAffectedVersion()); + if (hasMaxAffectedVersion()) { + result = result && getMaxAffectedVersion() + .equals(other.getMaxAffectedVersion()); + } + result = result && getSeverityName() + .equals(other.getSeverityName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && (hasFixedLocation() == other.hasFixedLocation()); + if (hasFixedLocation()) { + result = result && getFixedLocation() + .equals(other.getFixedLocation()); + } + result = result && getPackageType() + .equals(other.getPackageType()); + result = result && (getIsObsolete() + == other.getIsObsolete()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCpeUri().hashCode(); + hash = (37 * hash) + PACKAGE_FIELD_NUMBER; + hash = (53 * hash) + getPackage().hashCode(); + if (hasMinAffectedVersion()) { + hash = (37 * hash) + MIN_AFFECTED_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMinAffectedVersion().hashCode(); + } + if (hasMaxAffectedVersion()) { + hash = (37 * hash) + MAX_AFFECTED_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getMaxAffectedVersion().hashCode(); + } + hash = (37 * hash) + SEVERITY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getSeverityName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (hasFixedLocation()) { + hash = (37 * hash) + FIXED_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getFixedLocation().hashCode(); + } + hash = (37 * hash) + PACKAGE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getPackageType().hashCode(); + hash = (37 * hash) + IS_OBSOLETE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsObsolete()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.vulnerability.Vulnerability.Detail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Identifies all occurrences of this vulnerability in the package for a
+     * specific distro/location. For example: glibc in
+     * cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2
+     * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Vulnerability.Detail} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.vulnerability.Vulnerability.Detail) + io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.class, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder.class); + } + + // Construct using io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cpeUri_ = ""; + + package_ = ""; + + if (minAffectedVersionBuilder_ == null) { + minAffectedVersion_ = null; + } else { + minAffectedVersion_ = null; + minAffectedVersionBuilder_ = null; + } + if (maxAffectedVersionBuilder_ == null) { + maxAffectedVersion_ = null; + } else { + maxAffectedVersion_ = null; + maxAffectedVersionBuilder_ = null; + } + severityName_ = ""; + + description_ = ""; + + if (fixedLocationBuilder_ == null) { + fixedLocation_ = null; + } else { + fixedLocation_ = null; + fixedLocationBuilder_ = null; + } + packageType_ = ""; + + isObsolete_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDefaultInstanceForType() { + return io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail build() { + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail buildPartial() { + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail result = new io.grafeas.v1beta1.vulnerability.Vulnerability.Detail(this); + result.cpeUri_ = cpeUri_; + result.package_ = package_; + if (minAffectedVersionBuilder_ == null) { + result.minAffectedVersion_ = minAffectedVersion_; + } else { + result.minAffectedVersion_ = minAffectedVersionBuilder_.build(); + } + if (maxAffectedVersionBuilder_ == null) { + result.maxAffectedVersion_ = maxAffectedVersion_; + } else { + result.maxAffectedVersion_ = maxAffectedVersionBuilder_.build(); + } + result.severityName_ = severityName_; + result.description_ = description_; + if (fixedLocationBuilder_ == null) { + result.fixedLocation_ = fixedLocation_; + } else { + result.fixedLocation_ = fixedLocationBuilder_.build(); + } + result.packageType_ = packageType_; + result.isObsolete_ = isObsolete_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.vulnerability.Vulnerability.Detail) { + return mergeFrom((io.grafeas.v1beta1.vulnerability.Vulnerability.Detail)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Vulnerability.Detail other) { + if (other == io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.getDefaultInstance()) return this; + if (!other.getCpeUri().isEmpty()) { + cpeUri_ = other.cpeUri_; + onChanged(); + } + if (!other.getPackage().isEmpty()) { + package_ = other.package_; + onChanged(); + } + if (other.hasMinAffectedVersion()) { + mergeMinAffectedVersion(other.getMinAffectedVersion()); + } + if (other.hasMaxAffectedVersion()) { + mergeMaxAffectedVersion(other.getMaxAffectedVersion()); + } + if (!other.getSeverityName().isEmpty()) { + severityName_ = other.severityName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (other.hasFixedLocation()) { + mergeFixedLocation(other.getFixedLocation()); + } + if (!other.getPackageType().isEmpty()) { + packageType_ = other.packageType_; + onChanged(); + } + if (other.getIsObsolete() != false) { + setIsObsolete(other.getIsObsolete()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.vulnerability.Vulnerability.Detail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cpeUri_ = ""; + /** + *
+       * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+       * which the vulnerability manifests.  Examples include distro or storage
+       * location for vulnerable jar.
+       * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+       * which the vulnerability manifests.  Examples include distro or storage
+       * location for vulnerable jar.
+       * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+       * which the vulnerability manifests.  Examples include distro or storage
+       * location for vulnerable jar.
+       * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cpeUri_ = value; + onChanged(); + return this; + } + /** + *
+       * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+       * which the vulnerability manifests.  Examples include distro or storage
+       * location for vulnerable jar.
+       * 
+ * + * string cpe_uri = 1; + */ + public Builder clearCpeUri() { + + cpeUri_ = getDefaultInstance().getCpeUri(); + onChanged(); + return this; + } + /** + *
+       * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in
+       * which the vulnerability manifests.  Examples include distro or storage
+       * location for vulnerable jar.
+       * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cpeUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object package_ = ""; + /** + *
+       * The name of the package where the vulnerability was found.
+       * 
+ * + * string package = 2; + */ + public java.lang.String getPackage() { + java.lang.Object ref = package_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + package_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the package where the vulnerability was found.
+       * 
+ * + * string package = 2; + */ + public com.google.protobuf.ByteString + getPackageBytes() { + java.lang.Object ref = package_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + package_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the package where the vulnerability was found.
+       * 
+ * + * string package = 2; + */ + public Builder setPackage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + package_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the package where the vulnerability was found.
+       * 
+ * + * string package = 2; + */ + public Builder clearPackage() { + + package_ = getDefaultInstance().getPackage(); + onChanged(); + return this; + } + /** + *
+       * The name of the package where the vulnerability was found.
+       * 
+ * + * string package = 2; + */ + public Builder setPackageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + package_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.pkg.Version minAffectedVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> minAffectedVersionBuilder_; + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public boolean hasMinAffectedVersion() { + return minAffectedVersionBuilder_ != null || minAffectedVersion_ != null; + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getMinAffectedVersion() { + if (minAffectedVersionBuilder_ == null) { + return minAffectedVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : minAffectedVersion_; + } else { + return minAffectedVersionBuilder_.getMessage(); + } + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public Builder setMinAffectedVersion(io.grafeas.v1beta1.pkg.Version value) { + if (minAffectedVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + minAffectedVersion_ = value; + onChanged(); + } else { + minAffectedVersionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public Builder setMinAffectedVersion( + io.grafeas.v1beta1.pkg.Version.Builder builderForValue) { + if (minAffectedVersionBuilder_ == null) { + minAffectedVersion_ = builderForValue.build(); + onChanged(); + } else { + minAffectedVersionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public Builder mergeMinAffectedVersion(io.grafeas.v1beta1.pkg.Version value) { + if (minAffectedVersionBuilder_ == null) { + if (minAffectedVersion_ != null) { + minAffectedVersion_ = + io.grafeas.v1beta1.pkg.Version.newBuilder(minAffectedVersion_).mergeFrom(value).buildPartial(); + } else { + minAffectedVersion_ = value; + } + onChanged(); + } else { + minAffectedVersionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public Builder clearMinAffectedVersion() { + if (minAffectedVersionBuilder_ == null) { + minAffectedVersion_ = null; + onChanged(); + } else { + minAffectedVersion_ = null; + minAffectedVersionBuilder_ = null; + } + + return this; + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public io.grafeas.v1beta1.pkg.Version.Builder getMinAffectedVersionBuilder() { + + onChanged(); + return getMinAffectedVersionFieldBuilder().getBuilder(); + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getMinAffectedVersionOrBuilder() { + if (minAffectedVersionBuilder_ != null) { + return minAffectedVersionBuilder_.getMessageOrBuilder(); + } else { + return minAffectedVersion_ == null ? + io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : minAffectedVersion_; + } + } + /** + *
+       * The min version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version min_affected_version = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> + getMinAffectedVersionFieldBuilder() { + if (minAffectedVersionBuilder_ == null) { + minAffectedVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder>( + getMinAffectedVersion(), + getParentForChildren(), + isClean()); + minAffectedVersion_ = null; + } + return minAffectedVersionBuilder_; + } + + private io.grafeas.v1beta1.pkg.Version maxAffectedVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> maxAffectedVersionBuilder_; + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public boolean hasMaxAffectedVersion() { + return maxAffectedVersionBuilder_ != null || maxAffectedVersion_ != null; + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public io.grafeas.v1beta1.pkg.Version getMaxAffectedVersion() { + if (maxAffectedVersionBuilder_ == null) { + return maxAffectedVersion_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : maxAffectedVersion_; + } else { + return maxAffectedVersionBuilder_.getMessage(); + } + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public Builder setMaxAffectedVersion(io.grafeas.v1beta1.pkg.Version value) { + if (maxAffectedVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + maxAffectedVersion_ = value; + onChanged(); + } else { + maxAffectedVersionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public Builder setMaxAffectedVersion( + io.grafeas.v1beta1.pkg.Version.Builder builderForValue) { + if (maxAffectedVersionBuilder_ == null) { + maxAffectedVersion_ = builderForValue.build(); + onChanged(); + } else { + maxAffectedVersionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public Builder mergeMaxAffectedVersion(io.grafeas.v1beta1.pkg.Version value) { + if (maxAffectedVersionBuilder_ == null) { + if (maxAffectedVersion_ != null) { + maxAffectedVersion_ = + io.grafeas.v1beta1.pkg.Version.newBuilder(maxAffectedVersion_).mergeFrom(value).buildPartial(); + } else { + maxAffectedVersion_ = value; + } + onChanged(); + } else { + maxAffectedVersionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public Builder clearMaxAffectedVersion() { + if (maxAffectedVersionBuilder_ == null) { + maxAffectedVersion_ = null; + onChanged(); + } else { + maxAffectedVersion_ = null; + maxAffectedVersionBuilder_ = null; + } + + return this; + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public io.grafeas.v1beta1.pkg.Version.Builder getMaxAffectedVersionBuilder() { + + onChanged(); + return getMaxAffectedVersionFieldBuilder().getBuilder(); + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getMaxAffectedVersionOrBuilder() { + if (maxAffectedVersionBuilder_ != null) { + return maxAffectedVersionBuilder_.getMessageOrBuilder(); + } else { + return maxAffectedVersion_ == null ? + io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : maxAffectedVersion_; + } + } + /** + *
+       * The max version of the package in which the vulnerability exists.
+       * 
+ * + * .grafeas.v1beta1.package.Version max_affected_version = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> + getMaxAffectedVersionFieldBuilder() { + if (maxAffectedVersionBuilder_ == null) { + maxAffectedVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder>( + getMaxAffectedVersion(), + getParentForChildren(), + isClean()); + maxAffectedVersion_ = null; + } + return maxAffectedVersionBuilder_; + } + + private java.lang.Object severityName_ = ""; + /** + *
+       * The severity (eg: distro assigned severity) for this vulnerability.
+       * 
+ * + * string severity_name = 5; + */ + public java.lang.String getSeverityName() { + java.lang.Object ref = severityName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severityName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The severity (eg: distro assigned severity) for this vulnerability.
+       * 
+ * + * string severity_name = 5; + */ + public com.google.protobuf.ByteString + getSeverityNameBytes() { + java.lang.Object ref = severityName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + severityName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The severity (eg: distro assigned severity) for this vulnerability.
+       * 
+ * + * string severity_name = 5; + */ + public Builder setSeverityName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + severityName_ = value; + onChanged(); + return this; + } + /** + *
+       * The severity (eg: distro assigned severity) for this vulnerability.
+       * 
+ * + * string severity_name = 5; + */ + public Builder clearSeverityName() { + + severityName_ = getDefaultInstance().getSeverityName(); + onChanged(); + return this; + } + /** + *
+       * The severity (eg: distro assigned severity) for this vulnerability.
+       * 
+ * + * string severity_name = 5; + */ + public Builder setSeverityNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + severityName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * A vendor-specific description of this note.
+       * 
+ * + * string description = 6; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A vendor-specific description of this note.
+       * 
+ * + * string description = 6; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A vendor-specific description of this note.
+       * 
+ * + * string description = 6; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * A vendor-specific description of this note.
+       * 
+ * + * string description = 6; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * A vendor-specific description of this note.
+       * 
+ * + * string description = 6; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.vulnerability.VulnerabilityLocation fixedLocation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> fixedLocationBuilder_; + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public boolean hasFixedLocation() { + return fixedLocationBuilder_ != null || fixedLocation_ != null; + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getFixedLocation() { + if (fixedLocationBuilder_ == null) { + return fixedLocation_ == null ? io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } else { + return fixedLocationBuilder_.getMessage(); + } + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public Builder setFixedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (fixedLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + fixedLocation_ = value; + onChanged(); + } else { + fixedLocationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public Builder setFixedLocation( + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder builderForValue) { + if (fixedLocationBuilder_ == null) { + fixedLocation_ = builderForValue.build(); + onChanged(); + } else { + fixedLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public Builder mergeFixedLocation(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation value) { + if (fixedLocationBuilder_ == null) { + if (fixedLocation_ != null) { + fixedLocation_ = + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.newBuilder(fixedLocation_).mergeFrom(value).buildPartial(); + } else { + fixedLocation_ = value; + } + onChanged(); + } else { + fixedLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public Builder clearFixedLocation() { + if (fixedLocationBuilder_ == null) { + fixedLocation_ = null; + onChanged(); + } else { + fixedLocation_ = null; + fixedLocationBuilder_ = null; + } + + return this; + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder getFixedLocationBuilder() { + + onChanged(); + return getFixedLocationFieldBuilder().getBuilder(); + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder getFixedLocationOrBuilder() { + if (fixedLocationBuilder_ != null) { + return fixedLocationBuilder_.getMessageOrBuilder(); + } else { + return fixedLocation_ == null ? + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance() : fixedLocation_; + } + } + /** + *
+       * The fix for this specific package version.
+       * 
+ * + * .grafeas.v1beta1.vulnerability.VulnerabilityLocation fixed_location = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder> + getFixedLocationFieldBuilder() { + if (fixedLocationBuilder_ == null) { + fixedLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder, io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder>( + getFixedLocation(), + getParentForChildren(), + isClean()); + fixedLocation_ = null; + } + return fixedLocationBuilder_; + } + + private java.lang.Object packageType_ = ""; + /** + *
+       * The type of package; whether native or non native(ruby gems, node.js
+       * packages etc).
+       * 
+ * + * string package_type = 8; + */ + public java.lang.String getPackageType() { + java.lang.Object ref = packageType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + packageType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The type of package; whether native or non native(ruby gems, node.js
+       * packages etc).
+       * 
+ * + * string package_type = 8; + */ + public com.google.protobuf.ByteString + getPackageTypeBytes() { + java.lang.Object ref = packageType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The type of package; whether native or non native(ruby gems, node.js
+       * packages etc).
+       * 
+ * + * string package_type = 8; + */ + public Builder setPackageType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + packageType_ = value; + onChanged(); + return this; + } + /** + *
+       * The type of package; whether native or non native(ruby gems, node.js
+       * packages etc).
+       * 
+ * + * string package_type = 8; + */ + public Builder clearPackageType() { + + packageType_ = getDefaultInstance().getPackageType(); + onChanged(); + return this; + } + /** + *
+       * The type of package; whether native or non native(ruby gems, node.js
+       * packages etc).
+       * 
+ * + * string package_type = 8; + */ + public Builder setPackageTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + packageType_ = value; + onChanged(); + return this; + } + + private boolean isObsolete_ ; + /** + *
+       * Whether this detail is obsolete. Occurrences are expected not to point to
+       * obsolete details.
+       * 
+ * + * bool is_obsolete = 9; + */ + public boolean getIsObsolete() { + return isObsolete_; + } + /** + *
+       * Whether this detail is obsolete. Occurrences are expected not to point to
+       * obsolete details.
+       * 
+ * + * bool is_obsolete = 9; + */ + public Builder setIsObsolete(boolean value) { + + isObsolete_ = value; + onChanged(); + return this; + } + /** + *
+       * Whether this detail is obsolete. Occurrences are expected not to point to
+       * obsolete details.
+       * 
+ * + * bool is_obsolete = 9; + */ + public Builder clearIsObsolete() { + + isObsolete_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.vulnerability.Vulnerability.Detail) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.vulnerability.Vulnerability.Detail) + private static final io.grafeas.v1beta1.vulnerability.Vulnerability.Detail DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.vulnerability.Vulnerability.Detail(); + } + + public static io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Detail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Detail(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int CVSS_SCORE_FIELD_NUMBER = 1; + private float cvssScore_; + /** + *
+   * The CVSS score for this vulnerability.
+   * 
+ * + * float cvss_score = 1; + */ + public float getCvssScore() { + return cvssScore_; + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+   * Note provider assigned impact of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+   * Note provider assigned impact of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 3; + private java.util.List details_; + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public java.util.List getDetailsList() { + return details_; + } + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public java.util.List + getDetailsOrBuilderList() { + return details_; + } + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public int getDetailsCount() { + return details_.size(); + } + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDetails(int index) { + return details_.get(index); + } + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder getDetailsOrBuilder( + int index) { + return details_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (cvssScore_ != 0F) { + output.writeFloat(1, cvssScore_); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, severity_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(3, details_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (cvssScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(1, cvssScore_); + } + if (severity_ != io.grafeas.v1beta1.vulnerability.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, details_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.vulnerability.Vulnerability)) { + return super.equals(obj); + } + io.grafeas.v1beta1.vulnerability.Vulnerability other = (io.grafeas.v1beta1.vulnerability.Vulnerability) obj; + + boolean result = true; + result = result && ( + java.lang.Float.floatToIntBits(getCvssScore()) + == java.lang.Float.floatToIntBits( + other.getCvssScore())); + result = result && severity_ == other.severity_; + result = result && getDetailsList() + .equals(other.getDetailsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CVSS_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits( + getCvssScore()); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.Vulnerability parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.vulnerability.Vulnerability prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Vulnerability provides metadata about a security vulnerability.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.Vulnerability} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.vulnerability.Vulnerability) + io.grafeas.v1beta1.vulnerability.VulnerabilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.Vulnerability.class, io.grafeas.v1beta1.vulnerability.Vulnerability.Builder.class); + } + + // Construct using io.grafeas.v1beta1.vulnerability.Vulnerability.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cvssScore_ = 0F; + + severity_ = 0; + + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability getDefaultInstanceForType() { + return io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability build() { + io.grafeas.v1beta1.vulnerability.Vulnerability result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + 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) == 0x00000004)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.vulnerability.Vulnerability) { + return mergeFrom((io.grafeas.v1beta1.vulnerability.Vulnerability)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.Vulnerability other) { + if (other == io.grafeas.v1beta1.vulnerability.Vulnerability.getDefaultInstance()) return this; + if (other.getCvssScore() != 0F) { + setCvssScore(other.getCvssScore()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000004); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDetailsFieldBuilder() : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.vulnerability.Vulnerability parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.vulnerability.Vulnerability) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private float cvssScore_ ; + /** + *
+     * The CVSS score for this vulnerability.
+     * 
+ * + * float cvss_score = 1; + */ + public float getCvssScore() { + return cvssScore_; + } + /** + *
+     * The CVSS score for this vulnerability.
+     * 
+ * + * float cvss_score = 1; + */ + public Builder setCvssScore(float value) { + + cvssScore_ = value; + onChanged(); + return this; + } + /** + *
+     * The CVSS score for this vulnerability.
+     * 
+ * + * float cvss_score = 1; + */ + public Builder clearCvssScore() { + + cvssScore_ = 0F; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + *
+     * Note provider assigned impact of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+     * Note provider assigned impact of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverityValue(int value) { + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * Note provider assigned impact of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public io.grafeas.v1beta1.vulnerability.Severity getSeverity() { + @SuppressWarnings("deprecation") + io.grafeas.v1beta1.vulnerability.Severity result = io.grafeas.v1beta1.vulnerability.Severity.valueOf(severity_); + return result == null ? io.grafeas.v1beta1.vulnerability.Severity.UNRECOGNIZED : result; + } + /** + *
+     * Note provider assigned impact of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder setSeverity(io.grafeas.v1beta1.vulnerability.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Note provider assigned impact of the vulnerability.
+     * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = + java.util.Collections.emptyList(); + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder, io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder> detailsBuilder_; + + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder setDetails( + int index, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder setDetails( + int index, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder addDetails(io.grafeas.v1beta1.vulnerability.Vulnerability.Detail value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder addDetails( + int index, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder addDetails( + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder addDetails( + int index, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder addAllDetails( + java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder getDetailsBuilder( + int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder getDetailsOrBuilder( + int index) { + if (detailsBuilder_ == null) { + return details_.get(index); } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public java.util.List + getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder( + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.getDefaultInstance()); + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder addDetailsBuilder( + int index) { + return getDetailsFieldBuilder().addBuilder( + index, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.getDefaultInstance()); + } + /** + *
+     * All information about the package to specifically identify this
+     * vulnerability. One entry per (version range and cpe_uri) the package
+     * vulnerability has manifested in.
+     * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + public java.util.List + getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder, io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail, io.grafeas.v1beta1.vulnerability.Vulnerability.Detail.Builder, io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder>( + details_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + details_ = null; + } + return detailsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.vulnerability.Vulnerability) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.vulnerability.Vulnerability) + private static final io.grafeas.v1beta1.vulnerability.Vulnerability DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.vulnerability.Vulnerability(); + } + + public static io.grafeas.v1beta1.vulnerability.Vulnerability getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Vulnerability parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Vulnerability(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.Vulnerability getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + 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 new file mode 100644 index 000000000000..11f6fb2cf75b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocation.java @@ -0,0 +1,968 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +/** + *
+ * The location of the vulnerability.
+ * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.VulnerabilityLocation} + */ +public final class VulnerabilityLocation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grafeas.v1beta1.vulnerability.VulnerabilityLocation) + VulnerabilityLocationOrBuilder { +private static final long serialVersionUID = 0L; + // Use VulnerabilityLocation.newBuilder() to construct. + private VulnerabilityLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private VulnerabilityLocation() { + cpeUri_ = ""; + package_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private VulnerabilityLocation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + cpeUri_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + package_ = s; + break; + } + case 26: { + io.grafeas.v1beta1.pkg.Version.Builder subBuilder = null; + if (version_ != null) { + subBuilder = version_.toBuilder(); + } + version_ = input.readMessage(io.grafeas.v1beta1.pkg.Version.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(version_); + version_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.class, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder.class); + } + + public static final int CPE_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object cpeUri_; + /** + *
+   * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+   * format. Examples include distro or storage location for vulnerable jar.
+   * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } + } + /** + *
+   * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+   * format. Examples include distro or storage location for vulnerable jar.
+   * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PACKAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object package_; + /** + *
+   * The package being described.
+   * 
+ * + * string package = 2; + */ + public java.lang.String getPackage() { + java.lang.Object ref = package_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + package_ = s; + return s; + } + } + /** + *
+   * The package being described.
+   * 
+ * + * string package = 2; + */ + public com.google.protobuf.ByteString + getPackageBytes() { + java.lang.Object ref = package_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + package_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 3; + private io.grafeas.v1beta1.pkg.Version version_; + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public boolean hasVersion() { + return version_ != null; + } + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getVersion() { + return version_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder() { + return getVersion(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getCpeUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cpeUri_); + } + if (!getPackageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, package_); + } + if (version_ != null) { + output.writeMessage(3, getVersion()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCpeUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cpeUri_); + } + if (!getPackageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, package_); + } + if (version_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getVersion()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof io.grafeas.v1beta1.vulnerability.VulnerabilityLocation)) { + return super.equals(obj); + } + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation other = (io.grafeas.v1beta1.vulnerability.VulnerabilityLocation) obj; + + boolean result = true; + result = result && getCpeUri() + .equals(other.getCpeUri()); + result = result && getPackage() + .equals(other.getPackage()); + result = result && (hasVersion() == other.hasVersion()); + if (hasVersion()) { + result = result && getVersion() + .equals(other.getVersion()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CPE_URI_FIELD_NUMBER; + hash = (53 * hash) + getCpeUri().hashCode(); + hash = (37 * hash) + PACKAGE_FIELD_NUMBER; + hash = (53 * hash) + getPackage().hashCode(); + if (hasVersion()) { + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * The location of the vulnerability.
+   * 
+ * + * Protobuf type {@code grafeas.v1beta1.vulnerability.VulnerabilityLocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:grafeas.v1beta1.vulnerability.VulnerabilityLocation) + io.grafeas.v1beta1.vulnerability.VulnerabilityLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.class, io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.Builder.class); + } + + // Construct using io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + cpeUri_ = ""; + + package_ = ""; + + if (versionBuilder_ == null) { + version_ = null; + } else { + version_ = null; + versionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityOuterClass.internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getDefaultInstanceForType() { + return io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance(); + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation build() { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation buildPartial() { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation result = new io.grafeas.v1beta1.vulnerability.VulnerabilityLocation(this); + result.cpeUri_ = cpeUri_; + result.package_ = package_; + if (versionBuilder_ == null) { + result.version_ = version_; + } else { + result.version_ = versionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof io.grafeas.v1beta1.vulnerability.VulnerabilityLocation) { + return mergeFrom((io.grafeas.v1beta1.vulnerability.VulnerabilityLocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(io.grafeas.v1beta1.vulnerability.VulnerabilityLocation other) { + if (other == io.grafeas.v1beta1.vulnerability.VulnerabilityLocation.getDefaultInstance()) return this; + if (!other.getCpeUri().isEmpty()) { + cpeUri_ = other.cpeUri_; + onChanged(); + } + if (!other.getPackage().isEmpty()) { + package_ = other.package_; + onChanged(); + } + if (other.hasVersion()) { + mergeVersion(other.getVersion()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + io.grafeas.v1beta1.vulnerability.VulnerabilityLocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (io.grafeas.v1beta1.vulnerability.VulnerabilityLocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object cpeUri_ = ""; + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+     * format. Examples include distro or storage location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public java.lang.String getCpeUri() { + java.lang.Object ref = cpeUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cpeUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+     * format. Examples include distro or storage location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public com.google.protobuf.ByteString + getCpeUriBytes() { + java.lang.Object ref = cpeUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + cpeUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+     * format. Examples include distro or storage location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUri( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cpeUri_ = value; + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+     * format. Examples include distro or storage location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder clearCpeUri() { + + cpeUri_ = getDefaultInstance().getCpeUri(); + onChanged(); + return this; + } + /** + *
+     * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+     * format. Examples include distro or storage location for vulnerable jar.
+     * 
+ * + * string cpe_uri = 1; + */ + public Builder setCpeUriBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cpeUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object package_ = ""; + /** + *
+     * The package being described.
+     * 
+ * + * string package = 2; + */ + public java.lang.String getPackage() { + java.lang.Object ref = package_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + package_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The package being described.
+     * 
+ * + * string package = 2; + */ + public com.google.protobuf.ByteString + getPackageBytes() { + java.lang.Object ref = package_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + package_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The package being described.
+     * 
+ * + * string package = 2; + */ + public Builder setPackage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + package_ = value; + onChanged(); + return this; + } + /** + *
+     * The package being described.
+     * 
+ * + * string package = 2; + */ + public Builder clearPackage() { + + package_ = getDefaultInstance().getPackage(); + onChanged(); + return this; + } + /** + *
+     * The package being described.
+     * 
+ * + * string package = 2; + */ + public Builder setPackageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + package_ = value; + onChanged(); + return this; + } + + private io.grafeas.v1beta1.pkg.Version version_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> versionBuilder_; + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public boolean hasVersion() { + return versionBuilder_ != null || version_ != null; + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public io.grafeas.v1beta1.pkg.Version getVersion() { + if (versionBuilder_ == null) { + return version_ == null ? io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } else { + return versionBuilder_.getMessage(); + } + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public Builder setVersion(io.grafeas.v1beta1.pkg.Version value) { + if (versionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + version_ = value; + onChanged(); + } else { + versionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public Builder setVersion( + io.grafeas.v1beta1.pkg.Version.Builder builderForValue) { + if (versionBuilder_ == null) { + version_ = builderForValue.build(); + onChanged(); + } else { + versionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public Builder mergeVersion(io.grafeas.v1beta1.pkg.Version value) { + if (versionBuilder_ == null) { + if (version_ != null) { + version_ = + io.grafeas.v1beta1.pkg.Version.newBuilder(version_).mergeFrom(value).buildPartial(); + } else { + version_ = value; + } + onChanged(); + } else { + versionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public Builder clearVersion() { + if (versionBuilder_ == null) { + version_ = null; + onChanged(); + } else { + version_ = null; + versionBuilder_ = null; + } + + return this; + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public io.grafeas.v1beta1.pkg.Version.Builder getVersionBuilder() { + + onChanged(); + return getVersionFieldBuilder().getBuilder(); + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + public io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder() { + if (versionBuilder_ != null) { + return versionBuilder_.getMessageOrBuilder(); + } else { + return version_ == null ? + io.grafeas.v1beta1.pkg.Version.getDefaultInstance() : version_; + } + } + /** + *
+     * The version of the package being described.
+     * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder> + getVersionFieldBuilder() { + if (versionBuilder_ == null) { + versionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + io.grafeas.v1beta1.pkg.Version, io.grafeas.v1beta1.pkg.Version.Builder, io.grafeas.v1beta1.pkg.VersionOrBuilder>( + getVersion(), + getParentForChildren(), + isClean()); + version_ = null; + } + return versionBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grafeas.v1beta1.vulnerability.VulnerabilityLocation) + } + + // @@protoc_insertion_point(class_scope:grafeas.v1beta1.vulnerability.VulnerabilityLocation) + private static final io.grafeas.v1beta1.vulnerability.VulnerabilityLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new io.grafeas.v1beta1.vulnerability.VulnerabilityLocation(); + } + + public static io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VulnerabilityLocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VulnerabilityLocation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public io.grafeas.v1beta1.vulnerability.VulnerabilityLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocationOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocationOrBuilder.java new file mode 100644 index 000000000000..7901cc2017f1 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityLocationOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +public interface VulnerabilityLocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.vulnerability.VulnerabilityLocation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+   * format. Examples include distro or storage location for vulnerable jar.
+   * 
+ * + * string cpe_uri = 1; + */ + java.lang.String getCpeUri(); + /** + *
+   * The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/)
+   * format. Examples include distro or storage location for vulnerable jar.
+   * 
+ * + * string cpe_uri = 1; + */ + com.google.protobuf.ByteString + getCpeUriBytes(); + + /** + *
+   * The package being described.
+   * 
+ * + * string package = 2; + */ + java.lang.String getPackage(); + /** + *
+   * The package being described.
+   * 
+ * + * string package = 2; + */ + com.google.protobuf.ByteString + getPackageBytes(); + + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + boolean hasVersion(); + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + io.grafeas.v1beta1.pkg.Version getVersion(); + /** + *
+   * The version of the package being described.
+   * 
+ * + * .grafeas.v1beta1.package.Version version = 3; + */ + io.grafeas.v1beta1.pkg.VersionOrBuilder getVersionOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOrBuilder.java b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOrBuilder.java new file mode 100644 index 000000000000..3443b594eb98 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOrBuilder.java @@ -0,0 +1,89 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +public interface VulnerabilityOrBuilder extends + // @@protoc_insertion_point(interface_extends:grafeas.v1beta1.vulnerability.Vulnerability) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The CVSS score for this vulnerability.
+   * 
+ * + * float cvss_score = 1; + */ + float getCvssScore(); + + /** + *
+   * Note provider assigned impact of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + int getSeverityValue(); + /** + *
+   * Note provider assigned impact of the vulnerability.
+   * 
+ * + * .grafeas.v1beta1.vulnerability.Severity severity = 2; + */ + io.grafeas.v1beta1.vulnerability.Severity getSeverity(); + + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + java.util.List + getDetailsList(); + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + io.grafeas.v1beta1.vulnerability.Vulnerability.Detail getDetails(int index); + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + int getDetailsCount(); + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + java.util.List + getDetailsOrBuilderList(); + /** + *
+   * All information about the package to specifically identify this
+   * vulnerability. One entry per (version range and cpe_uri) the package
+   * vulnerability has manifested in.
+   * 
+ * + * repeated .grafeas.v1beta1.vulnerability.Vulnerability.Detail details = 3; + */ + io.grafeas.v1beta1.vulnerability.Vulnerability.DetailOrBuilder getDetailsOrBuilder( + int index); +} 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 new file mode 100644 index 000000000000..7ad93a4a501e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/java/io/grafeas/v1beta1/vulnerability/VulnerabilityOuterClass.java @@ -0,0 +1,141 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto + +package io.grafeas.v1beta1.vulnerability; + +public final class VulnerabilityOuterClass { + private VulnerabilityOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_vulnerability_Details_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_vulnerability_Details_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_vulnerability_PackageIssue_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\nKgoogle/devtools/containeranalysis/v1be" + + "ta1/vulnerability/vulnerability.proto\022\035g" + + "rafeas.v1beta1.vulnerability\032=google/dev" + + "tools/containeranalysis/v1beta1/common/c" + + "ommon.proto\032?google/devtools/containeran" + + "alysis/v1beta1/package/package.proto\"\366\003\n" + + "\rVulnerability\022\022\n\ncvss_score\030\001 \001(\002\0229\n\010se" + + "verity\030\002 \001(\0162\'.grafeas.v1beta1.vulnerabi" + + "lity.Severity\022D\n\007details\030\003 \003(\01323.grafeas" + + ".v1beta1.vulnerability.Vulnerability.Det" + + "ail\032\317\002\n\006Detail\022\017\n\007cpe_uri\030\001 \001(\t\022\017\n\007packa" + + "ge\030\002 \001(\t\022>\n\024min_affected_version\030\003 \001(\0132 " + + ".grafeas.v1beta1.package.Version\022>\n\024max_" + + "affected_version\030\004 \001(\0132 .grafeas.v1beta1" + + ".package.Version\022\025\n\rseverity_name\030\005 \001(\t\022" + + "\023\n\013description\030\006 \001(\t\022L\n\016fixed_location\030\007" + + " \001(\01324.grafeas.v1beta1.vulnerability.Vul" + + "nerabilityLocation\022\024\n\014package_type\030\010 \001(\t" + + "\022\023\n\013is_obsolete\030\t \001(\010\"\222\002\n\007Details\022\014\n\004typ" + + "e\030\001 \001(\t\0229\n\010severity\030\002 \001(\0162\'.grafeas.v1be" + + "ta1.vulnerability.Severity\022\022\n\ncvss_score" + + "\030\003 \001(\002\022B\n\rpackage_issue\030\004 \003(\0132+.grafeas." + + "v1beta1.vulnerability.PackageIssue\022\031\n\021sh" + + "ort_description\030\005 \001(\t\022\030\n\020long_descriptio" + + "n\030\006 \001(\t\0221\n\014related_urls\030\007 \003(\0132\033.grafeas." + + "v1beta1.RelatedUrl\"\304\001\n\014PackageIssue\022O\n\021a" + + "ffected_location\030\001 \001(\01324.grafeas.v1beta1" + + ".vulnerability.VulnerabilityLocation\022L\n\016" + + "fixed_location\030\002 \001(\01324.grafeas.v1beta1.v" + + "ulnerability.VulnerabilityLocation\022\025\n\rse" + + "verity_name\030\003 \001(\t\"l\n\025VulnerabilityLocati" + + "on\022\017\n\007cpe_uri\030\001 \001(\t\022\017\n\007package\030\002 \001(\t\0221\n\007" + + "version\030\003 \001(\0132 .grafeas.v1beta1.package." + + "Version*^\n\010Severity\022\030\n\024SEVERITY_UNSPECIF" + + "IED\020\000\022\013\n\007MINIMAL\020\001\022\007\n\003LOW\020\002\022\n\n\006MEDIUM\020\003\022" + + "\010\n\004HIGH\020\004\022\014\n\010CRITICAL\020\005B\220\001\n io.grafeas.v" + + "1beta1.vulnerabilityP\001Zdgoogle.golang.or" + + "g/genproto/googleapis/devtools/container" + + "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); + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor, + new java.lang.String[] { "CvssScore", "Severity", "Details", }); + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor = + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_descriptor.getNestedTypes().get(0); + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_vulnerability_Vulnerability_Detail_descriptor, + new java.lang.String[] { "CpeUri", "Package", "MinAffectedVersion", "MaxAffectedVersion", "SeverityName", "Description", "FixedLocation", "PackageType", "IsObsolete", }); + internal_static_grafeas_v1beta1_vulnerability_Details_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grafeas_v1beta1_vulnerability_Details_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_vulnerability_Details_descriptor, + new java.lang.String[] { "Type", "Severity", "CvssScore", "PackageIssue", "ShortDescription", "LongDescription", "RelatedUrls", }); + internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_grafeas_v1beta1_vulnerability_PackageIssue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_vulnerability_PackageIssue_descriptor, + new java.lang.String[] { "AffectedLocation", "FixedLocation", "SeverityName", }); + internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grafeas_v1beta1_vulnerability_VulnerabilityLocation_descriptor, + new java.lang.String[] { "CpeUri", "Package", "Version", }); + io.grafeas.v1beta1.common.Common.getDescriptor(); + io.grafeas.v1beta1.pkg.PackageOuterClass.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/attestation/attestation.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/attestation/attestation.proto new file mode 100644 index 000000000000..e60b6e91a23e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/attestation/attestation.proto @@ -0,0 +1,132 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.attestation; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/attestation;attestation"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.attestation"; +option objc_class_prefix = "GRA"; + +// An attestation wrapper with a PGP-compatible signature. This message only +// supports `ATTACHED` signatures, where the payload that is signed is included +// alongside the signature itself in the same file. +message PgpSignedAttestation { + // The raw content of the signature, as output by GNU Privacy Guard (GPG) or + // equivalent. Since this message only supports attached signatures, the + // payload that was signed must be attached. While the signature format + // supported is dependent on the verification implementation, currently only + // ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than + // `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor + // --output=signature.gpg payload.json` will create the signature content + // expected in this field in `signature.gpg` for the `payload.json` + // attestation payload. + string signature = 1; + + // Type (for example schema) of the attestation payload that was signed. + enum ContentType { + // `ContentType` is not set. + CONTENT_TYPE_UNSPECIFIED = 0; + // Atomic format attestation signature. See + // https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md + // The payload extracted from `signature` is a JSON blob conforming to the + // linked schema. + SIMPLE_SIGNING_JSON = 1; + } + + // Type (for example schema) of the attestation payload that was signed. + // The verifier must ensure that the provided type is one that the verifier + // supports, and that the attestation payload is a valid instantiation of that + // type (for example by validating a JSON schema). + ContentType content_type = 3; + + // This field is used by verifiers to select the public key used to validate + // the signature. Note that the policy of the verifier ultimately determines + // which public keys verify a signature based on the context of the + // verification. There is no guarantee validation will succeed if the + // verifier has no key matching this ID, even if it has a key under a + // different ID that would verify the signature. Note that this ID should also + // be present in the signature content above, but that is not expected to be + // used by the verifier. + oneof key_id { + // The cryptographic fingerprint of the key used to generate the signature, + // as output by, e.g. `gpg --list-keys`. This should be the version 4, full + // 160-bit fingerprint, expressed as a 40 character hexidecimal string. See + // https://tools.ietf.org/html/rfc4880#section-12.2 for details. + // Implementations may choose to acknowledge "LONG", "SHORT", or other + // abbreviated key IDs, but only the full fingerprint is guaranteed to work. + // In gpg, the full fingerprint can be retrieved from the `fpr` field + // returned when calling --list-keys with --with-colons. For example: + // ``` + // gpg --with-colons --with-fingerprint --force-v4-certs \ + // --list-keys attester@example.com + // tru::1:1513631572:0:3:1:5 + // pub:...... + // fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB: + // ``` + // Above, the fingerprint is `24FF6481B76AC91E66A00AC657A93A81EF3AE6FB`. + string pgp_key_id = 2; + } +} + +// Note kind that represents a logical attestation "role" or "authority". For +// example, an organization might have one `Authority` for "QA" and one for +// "build". This Note is intended to act strictly as a grouping mechanism for +// the attached Occurrences (Attestations). This grouping mechanism also +// provides a security boundary, since IAM ACLs gate the ability for a principle +// to attach an Occurrence to a given Note. It also provides a single point of +// lookup to find all attached Attestation Occurrences, even if they don't all +// live in the same project. +message Authority { + // This submessage provides human-readable hints about the purpose of the + // Authority. Because the name of a Note acts as its resource reference, it is + // important to disambiguate the canonical name of the Note (which might be a + // UUID for security purposes) from "readable" names more suitable for debug + // output. Note that these hints should NOT be used to look up authorities in + // security sensitive contexts, such as when looking up Attestations to + // verify. + message Hint { + // The human readable name of this Attestation Authority, for example "qa". + string human_readable_name = 1; + } + + // Hint hints at the purpose of the attestation authority. + Hint hint = 1; +} + +// Details of an attestation occurrence. +message Details { + // Attestation for the resource. + Attestation attestation = 1; +} + +// Occurrence that represents a single "attestation". The authenticity of an +// Attestation can be verified using the attached signature. If the verifier +// trusts the public key of the signer, then verifying the signature is +// sufficient to establish trust. In this circumstance, the Authority to which +// this Attestation is attached is primarily useful for look-up (how to find +// this Attestation if you already know the Authority and artifact to be +// verified) and intent (which authority was this attestation intended to sign +// for). +message Attestation { + // The signature, generally over the `resource_url`, that verifies this + // attestation. The semantics of the signature veracity are ultimately + // determined by the verification engine. + oneof signature { + // A PGP signed attestation. + PgpSignedAttestation pgp_signed_attestation = 1; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/build/build.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/build/build.proto new file mode 100644 index 000000000000..18d1019f26af --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/build/build.proto @@ -0,0 +1,96 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.build; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/build;build"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.build"; +option objc_class_prefix = "GRA"; + +import "google/devtools/containeranalysis/v1beta1/provenance/provenance.proto"; + +// Note holding the version of the provider's builder and the signature of the +// provenance message in linked BuildDetails. +message Build { + // Version of the builder which produced this Note. + string builder_version = 1; + + // Signature of the build in Occurrences pointing to the Note containing this + // `BuilderDetails`. + BuildSignature signature = 2; +} + +// Message encapsulating the signature of the verified build. +message BuildSignature { + // Public key of the builder which can be used to verify that the related + // findings are valid and unchanged. If `key_type` is empty, this defaults + // to PEM encoded public keys. + // + // This field may be empty if `key_id` references an external key. + // + // For Cloud Container Builder based signatures, this is a PEM encoded public + // key. To verify the Cloud Container Builder signature, place the contents of + // this field into a file (public.pem). The signature field is base64-decoded + // into its binary representation in signature.bin, and the provenance bytes + // from `BuildDetails` are base64-decoded into a binary representation in + // signed.bin. OpenSSL can then verify the signature: + // `openssl sha256 -verify public.pem -signature signature.bin signed.bin` + string public_key = 1; + + // Signature of the related `BuildProvenance`. In JSON, this is base-64 + // encoded. + bytes signature = 2; + + // An ID for the key used to sign. This could be either an Id for the key + // stored in `public_key` (such as the Id or fingerprint for a PGP key, or the + // CN for a cert), or a reference to an external key (such as a reference to a + // key in Cloud Key Management Service). + string key_id = 3; + + // Public key formats + enum KeyType { + // `KeyType` is not set. + KEY_TYPE_UNSPECIFIED = 0; + // `PGP ASCII Armored` public key. + PGP_ASCII_ARMORED = 1; + // `PKIX PEM` public key. + PKIX_PEM = 2; + } + + // The type of the key, either stored in `public_key` or referenced in + // `key_id` + KeyType key_type = 4; +} + +// Details of a build occurrence. +message Details { + // The actual provenance for the build. + grafeas.v1beta1.provenance.BuildProvenance provenance = 1; + + // Serialized JSON representation of the provenance, used in generating the + // `BuildSignature` in the corresponding Result. After verifying the + // signature, `provenance_bytes` can be unmarshalled and compared to the + // provenance to confirm that it is unchanged. A base64-encoded string + // representation of the provenance bytes is used for the signature in order + // to interoperate with openssl which expects this format for signature + // verification. + // + // The serialized form is captured both to avoid ambiguity in how the + // provenance is marshalled to json as well to prevent incompatibilities with + // future changes. + string provenance_bytes = 2; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/common/common.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/common/common.proto new file mode 100644 index 000000000000..a8a2ddad2c6a --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/common/common.proto @@ -0,0 +1,50 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/common;common"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.common"; +option objc_class_prefix = "GRA"; + +// Kind represents the kinds of notes supported. +enum NoteKind { + // Unknown. + NOTE_KIND_UNSPECIFIED = 0; + // The note and occurrence represent a package vulnerability. + VULNERABILITY = 1; + // The note and occurrence assert build provenance. + BUILD = 2; + // This represents an image basis relationship. + IMAGE = 3; + // This represents a package installed via a package manager. + PACKAGE = 4; + // The note and occurrence track deployment events. + DEPLOYMENT = 5; + // The note and occurrence track the initial discovery status of a resource. + DISCOVERY = 6; + // This represents a logical "role" that can attest to artifacts. + ATTESTATION = 7; +} + +// Metadata for any related URL information. +message RelatedUrl { + // Specific URL associated with the resource. + string url = 1; + // Label to describe usage of the URL. + string label = 2; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/containeranalysis.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/containeranalysis.proto new file mode 100644 index 000000000000..efee747138cc --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/containeranalysis.proto @@ -0,0 +1,186 @@ +// 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. + +syntax = "proto3"; + +package google.devtools.containeranalysis.v1beta1; + +import "google/api/annotations.proto"; +import "google/iam/v1/iam_policy.proto"; +import "google/iam/v1/policy.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1;containeranalysis"; +option java_multiple_files = true; +option java_package = "com.google.containeranalysis.v1beta1"; +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 ContainerAnalysisV1Beta1 { + // 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: "/v1beta1/{resource=projects/*/notes/*}:setIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{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: "/v1beta1/{resource=projects/*/notes/*}:getIamPolicy" + body: "*" + additional_bindings { + post: "/v1beta1/{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: "/v1beta1/{resource=projects/*/notes/*}:testIamPermissions" + body: "*" + additional_bindings { + post: "/v1beta1/{resource=projects/*/occurrences/*}:testIamPermissions" + body: "*" + } + }; + } + + // Gets the specified scan configuration. + rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/scanConfigs/*}" + }; + } + + // Lists scan configurations for the specified project. + rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/scanConfigs" + }; + } + + // Updates the specified scan configuration. + rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + put: "/v1beta1/{name=projects/*/scanConfigs/*}" + body: "scan_config" + }; + } +} + +// A scan configuration specifies whether Cloud components in a project have a +// particular type of analysis being run. For example, it can configure whether +// vulnerability scanning is being done on Docker images or not. +message ScanConfig { + // Output only. The name of the scan configuration in the form of + // `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + string name = 1; + + // Output only. A human-readable description of what the scan configuration + // does. + string description = 2; + + // Whether the scan is enabled. + bool enabled = 3; + + // Output only. The time this scan config was created. + google.protobuf.Timestamp create_time = 4; + + // Output only. The time this scan config was last updated. + google.protobuf.Timestamp update_time = 5; +} + +// Request to get a scan configuration. +message GetScanConfigRequest { + // The name of the scan configuration in the form of + // `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + string name = 1; +} + +// Request to list scan configurations. +message ListScanConfigsRequest { + // The name of the project to list scan configurations for in the form of + // `projects/[PROJECT_ID]`. + string parent = 1; + + // The filter expression. + string filter = 2; + + // The number of scan configs to return in the list. + int32 page_size = 3; + + // Token to provide to skip to a particular spot in the list. + string page_token = 4; +} + +// Response for listing scan configurations. +message ListScanConfigsResponse { + // The scan configurations requested. + repeated ScanConfig scan_configs = 1; + + // The next pagination token in the list response. It should be used as + // `page_token` for the following request. An empty value means no more + // results. + string next_page_token = 2; +} + +// A request to update a scan configuration. +message UpdateScanConfigRequest { + // The name of the scan configuration in the form of + // `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + string name = 1; + + // The updated scan configuration. + ScanConfig scan_config = 2; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/deployment/deployment.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/deployment/deployment.proto new file mode 100644 index 000000000000..82e014c6aede --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/deployment/deployment.proto @@ -0,0 +1,74 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.deployment; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/deployment;deployment"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.deployment"; +option objc_class_prefix = "GRA"; + +import "google/protobuf/timestamp.proto"; + +// An artifact that can be deployed in some runtime. +message Deployable { + // Resource URI for the artifact being deployed. + repeated string resource_uri = 1; +} + +// Details of a deployment occurrence. +message Details { + // Deployment history for the resource. + Deployment deployment = 1; +} + +// The period during which some deployable was active in a runtime. +message Deployment { + // Identity of the user that triggered this deployment. + string user_email = 1; + + // Beginning of the lifetime of this deployment. + google.protobuf.Timestamp deploy_time = 2; + + // End of the lifetime of this deployment. + google.protobuf.Timestamp undeploy_time = 3; + + // Configuration used to create this deployment. + string config = 4; + + // Address of the runtime element hosting this deployment. + string address = 5; + + // Output only. Resource URI for the artifact being deployed taken from + // the deployable field with the same name. + repeated string resource_uri = 6; + + // Types of platforms. + enum Platform { + // Unknown. + PLATFORM_UNSPECIFIED = 0; + // Google Container Engine. + GKE = 1; + // Google App Engine: Flexible Environment. + FLEX = 2; + // Custom user-defined platform. + CUSTOM = 3; + } + // Platform hosting this deployment. + Platform platform = 7; + + // next_id = 8; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/discovery/discovery.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/discovery/discovery.proto new file mode 100644 index 000000000000..8df27dbb749b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/discovery/discovery.proto @@ -0,0 +1,85 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.discovery; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/discovery;discovery"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.discovery"; +option objc_class_prefix = "GRA"; + +import "google/devtools/containeranalysis/v1beta1/common/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +// A note that indicates a type of analysis a provider would perform. This note +// exists in a provider's project. A `Discovery` occurrence is created in a +// consumer's project at the start of analysis. +message Discovery { + // The kind of analysis that is handled by this discovery. + grafeas.v1beta1.NoteKind analysis_kind = 1; +} + +// Details of a discovery occurrence. +message Details { + // Analysis status for the discovered resource. + Discovered discovered = 1; +} + +// Provides information about the analysis status of a discovered resource. +message Discovered { + // Whether the resource is continuously analyzed. + enum ContinuousAnalysis { + // Unknown. + CONTINUOUS_ANALYSIS_UNSPECIFIED = 0; + // The resource is continuously analyzed. + ACTIVE = 1; + // The resource is ignored for continuous analysis. + INACTIVE = 2; + } + + // Whether the resource is continuously analyzed. + ContinuousAnalysis continuous_analysis = 1; + + // The last time continuous analysis was done for this resource. + google.protobuf.Timestamp last_analysis_time = 2; + + // Analysis status for a resource. Currently for initial analysis only (not + // updated in continuous analysis). + enum AnalysisStatus { + // Unknown. + ANALYSIS_STATUS_UNSPECIFIED = 0; + // Resource is known but no action has been taken yet. + PENDING = 1; + // Resource is being analyzed. + SCANNING = 2; + // Analysis has finished successfully. + FINISHED_SUCCESS = 3; + // Analysis has finished unsuccessfully, the analysis itself is in a bad + // state. + FINISHED_FAILED = 4; + // The resource is known not to be supported + FINISHED_UNSUPPORTED = 5; + } + + // The status of discovery for the resource. + AnalysisStatus analysis_status = 3; + + // When an error is encountered this will contain a LocalizedMessage under + // details to show to the user. The LocalizedMessage is output only and + // populated by the API. + google.rpc.Status analysis_status_error = 4; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto new file mode 100644 index 000000000000..a051f3b50bc2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/grafeas/grafeas.proto @@ -0,0 +1,502 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/grafeas;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1"; +option objc_class_prefix = "GRA"; + +import "google/api/annotations.proto"; +import "google/devtools/containeranalysis/v1beta1/attestation/attestation.proto"; +import "google/devtools/containeranalysis/v1beta1/build/build.proto"; +import "google/devtools/containeranalysis/v1beta1/common/common.proto"; +import "google/devtools/containeranalysis/v1beta1/deployment/deployment.proto"; +import "google/devtools/containeranalysis/v1beta1/discovery/discovery.proto"; +import "google/devtools/containeranalysis/v1beta1/image/image.proto"; +import "google/devtools/containeranalysis/v1beta1/package/package.proto"; +import "google/devtools/containeranalysis/v1beta1/provenance/provenance.proto"; +import "google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +// [Grafeas](grafeas.io) API. +// +// Retrieves analysis results of Cloud components such as Docker container +// images. +// +// 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 GrafeasV1Beta1 { + // Gets the specified occurrence. + rpc GetOccurrence(GetOccurrenceRequest) returns (Occurrence) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/occurrences/*}" + }; + }; + + // Lists occurrences for the specified project. + rpc ListOccurrences(ListOccurrencesRequest) + returns (ListOccurrencesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/occurrences" + }; + }; + + // Deletes the specified occurrence. For example, use this method to delete an + // occurrence when the occurrence is no longer applicable for the given + // resource. + rpc DeleteOccurrence(DeleteOccurrenceRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/occurrences/*}" + }; + }; + + // Creates a new occurrence. + rpc CreateOccurrence(CreateOccurrenceRequest) returns (Occurrence) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/occurrences" + body: "occurrence" + }; + }; + + // Creates new occurrences in batch. + rpc BatchCreateOccurrences(BatchCreateOccurrencesRequest) + returns (BatchCreateOccurrencesResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/occurrences:batchCreate" + body: "*" + }; + }; + + // Updates the specified occurrence. + rpc UpdateOccurrence(UpdateOccurrenceRequest) returns (Occurrence) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/occurrences/*}" + body: "occurrence" + }; + }; + + // Gets the note attached to the specified occurrence. Consumer projects can + // use this method to get a note that belongs to a provider project. + rpc GetOccurrenceNote(GetOccurrenceNoteRequest) returns (Note) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/occurrences/*}/notes" + }; + }; + + // Gets the specified note. + rpc GetNote(GetNoteRequest) returns (Note) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/notes/*}" + }; + }; + + // Lists notes for the specified project. + rpc ListNotes(ListNotesRequest) returns (ListNotesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/notes" + }; + }; + + // Deletes the specified note. + rpc DeleteNote(DeleteNoteRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/notes/*}" + }; + }; + + // Creates a new note. + rpc CreateNote(CreateNoteRequest) returns (Note) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/notes" + body: "note" + }; + }; + + // Creates new notes in batch. + rpc BatchCreateNotes(BatchCreateNotesRequest) + returns (BatchCreateNotesResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/notes:batchCreate" + body: "*" + }; + }; + + // Updates the specified note. + rpc UpdateNote(UpdateNoteRequest) returns (Note) { + option (google.api.http) = { + patch: "/v1beta1/{name=projects/*/notes/*}" + body: "note" + }; + }; + + // Lists occurrences referencing the specified note. Provider projects can use + // this method to get all occurrences across consumer projects referencing the + // specified note. + rpc ListNoteOccurrences(ListNoteOccurrencesRequest) + returns (ListNoteOccurrencesResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/notes/*}/occurrences" + }; + }; + + // Gets a summary of the number and severity of occurrences. + rpc GetVulnerabilityOccurrencesSummary( + GetVulnerabilityOccurrencesSummaryRequest) + returns (VulnerabilityOccurrencesSummary) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/occurrences:vulnerabilitySummary" + }; + }; +}; + +// An instance of an analysis type that has been found on a resource. +message Occurrence { + // Output only. The name of the occurrence in the form of + // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + string name = 1; + + // Required. Immutable. The resource for which the occurrence applies. + Resource resource = 2; + + // Required. Immutable. The analysis note associated with this occurrence, in + // the form of `projects[PROVIDER_ID]/notes/[NOTE_ID]`. This field can be used + // as a filter in list requests. + string note_name = 3; + + // Output only. This explicitly denotes which of the occurrence details are + // specified. This field can be used as a filter in list requests. + grafeas.v1beta1.NoteKind kind = 4; + + // A description of actions that can be taken to remedy the note. + string remediation = 5; + + // Output only. The time this occurrence was created. + google.protobuf.Timestamp create_time = 6; + + // Output only. The time this occurrence was last updated. + google.protobuf.Timestamp update_time = 7; + + // Required. Immutable. Describes the details of the note kind found on this + // resource. + oneof details { + // Describes a security vulnerability. + grafeas.v1beta1.vulnerability.Details vulnerability = 8; + // Describes a verifiable build. + grafeas.v1beta1.build.Details build = 9; + // Describes how this resource derives from the basis in the associated + // note. + grafeas.v1beta1.image.Details derived_image = 10; + // Describes the installation of a package on the linked resource. + grafeas.v1beta1.package.Details installation = 11; + // Describes the deployment of an artifact on a runtime. + grafeas.v1beta1.deployment.Details deployment = 12; + // Describes when a resource was discovered. + grafeas.v1beta1.discovery.Details discovered = 13; + // Describes an attestation of an artifact. + grafeas.v1beta1.attestation.Details attestation = 14; + } + + // next_id = 15; +} + +// An entity that can have metadata. For example, a Docker image. +message Resource { + // The name of the resource. For example, the name of a Docker image - + // "Debian". + string name = 1; + // The unique URI of the resource. For example, + // `https://gcr.io/project/image@sha256:foo` for a Docker image. + string uri = 2; + // The hash of the resource content. For example, the Docker digest. + grafeas.v1beta1.provenance.Hash content_hash = 3; + + // next_id = 4; +} + +// A type of analysis that can be done for a resource. +message Note { + // Output only. The name of the note in the form of + // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + string name = 1; + + // A one sentence description of this note. + string short_description = 2; + + // A detailed description of this note. + string long_description = 3; + + // Output only. The type of analysis. This field can be used as a filter in + // list requests. + grafeas.v1beta1.NoteKind kind = 4; + + // URLs associated with this note. + repeated grafeas.v1beta1.RelatedUrl related_url = 5; + + // Time of expiration for this note. Empty if note does not expire. + google.protobuf.Timestamp expiration_time = 6; + + // Output only. The time this note was created. This field can be used as a + // filter in list requests. + google.protobuf.Timestamp create_time = 7; + + // Output only. The time this note was last updated. This field can be used as + // a filter in list requests. + google.protobuf.Timestamp update_time = 8; + + // Other notes related to this note. + repeated string related_note_names = 9; + + // Required. Immutable. The type of analysis this note represents. + oneof type { + // A note describing a package vulnerability. + grafeas.v1beta1.vulnerability.Vulnerability vulnerability = 10; + // A note describing build provenance for a verifiable build. + grafeas.v1beta1.build.Build build = 11; + // A note describing a base image. + grafeas.v1beta1.image.Basis base_image = 12; + // A note describing a package hosted by various package managers. + grafeas.v1beta1.package.Package package = 13; + // A note describing something that can be deployed. + grafeas.v1beta1.deployment.Deployable deployable = 14; + // A note describing the initial analysis of a resource. + grafeas.v1beta1.discovery.Discovery discovery = 15; + // A note describing an attestation role. + grafeas.v1beta1.attestation.Authority attestation_authority = 16; + } + + // next_id = 17; +} + +// Request to get an occurrence. +message GetOccurrenceRequest { + // The name of the occurrence in the form of + // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + string name = 1; +} + +// Request to list occurrences. +message ListOccurrencesRequest { + // The name of the project to list occurrences for in the form of + // `projects/[PROJECT_ID]`. + string parent = 1; + + // The filter expression. + string filter = 2; + + // Number of occurrences to return in the list. + int32 page_size = 3; + + // Token to provide to skip to a particular spot in the list. + string page_token = 4; + + // next_id = 7; +} + +// Response for listing occurrences. +message ListOccurrencesResponse { + // The occurrences requested. + repeated Occurrence occurrences = 1; + // The next pagination token in the list response. It should be used as + // `page_token` for the following request. An empty value means no more + // results. + string next_page_token = 2; +} + +// Request to delete a occurrence. +message DeleteOccurrenceRequest { + // The name of the occurrence in the form of + // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + string name = 1; +} + +// Request to create a new occurrence. +message CreateOccurrenceRequest { + // The name of the project in the form of `projects/[PROJECT_ID]`, under which + // the occurrence is to be created. + string parent = 1; + // The occurrence to create. + Occurrence occurrence = 2; +} + +// Request to update an occurrence. +message UpdateOccurrenceRequest { + // The name of the occurrence in the form of + // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + string name = 1; + // The updated occurrence. + Occurrence occurrence = 2; + // The fields to update. + google.protobuf.FieldMask update_mask = 3; +} + +// Request to get a note. +message GetNoteRequest { + // The name of the note in the form of + // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + string name = 1; +} + +// Request to get the note to which the specified occurrence is attached. +message GetOccurrenceNoteRequest { + // The name of the occurrence in the form of + // `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + string name = 1; +} + +// Request to list notes. +message ListNotesRequest { + // The name of the project to list notes for in the form of + // `projects/[PROJECT_ID]`. + string parent = 1; + // The filter expression. + string filter = 2; + // Number of notes to return in the list. + int32 page_size = 3; + // Token to provide to skip to a particular spot in the list. + string page_token = 4; +} + +// Response for listing notes. +message ListNotesResponse { + // The notes requested. + repeated Note notes = 1; + // The next pagination token in the list response. It should be used as + // `page_token` for the following request. An empty value means no more + // results. + string next_page_token = 2; +} + +// Request to delete a note. +message DeleteNoteRequest { + // The name of the note in the form of + // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + string name = 1; +} + +// Request to create a new note. +message CreateNoteRequest { + // The name of the project in the form of `projects/[PROJECT_ID]`, under which + // the note is to be created. + string parent = 1; + // The ID to use for this note. + string note_id = 2; + // The note to create. + Note note = 3; +} + +// Request to update a note. +message UpdateNoteRequest { + // The name of the note in the form of + // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + string name = 1; + // The updated note. + Note note = 2; + // The fields to update. + google.protobuf.FieldMask update_mask = 3; +} + +// Request to list occurrences for a note. +message ListNoteOccurrencesRequest { + // The name of the note to list occurrences for in the form of + // `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + string name = 1; + // The filter expression. + string filter = 2; + // Number of occurrences to return in the list. + int32 page_size = 3; + // Token to provide to skip to a particular spot in the list. + string page_token = 4; +} + +// Response for listing occurrences for a note. +message ListNoteOccurrencesResponse { + // The occurrences attached to the specified note. + repeated Occurrence occurrences = 1; + // Token to provide to skip to a particular spot in the list. + string next_page_token = 2; +} + +// Request to create notes in batch. +message BatchCreateNotesRequest { + // The name of the project in the form of `projects/[PROJECT_ID]`, under which + // the notes are to be created. + string parent = 1; + + // The notes to create. + map notes = 2; +} + +// Response for creating notes in batch. +message BatchCreateNotesResponse { + // The notes that were created. + repeated Note notes = 1; +} + +// Request to create occurrences in batch. +message BatchCreateOccurrencesRequest { + // The name of the project in the form of `projects/[PROJECT_ID]`, under which + // the occurrences are to be created. + string parent = 1; + // The occurrences to create. + repeated Occurrence occurrences = 2; +} + +// Response for creating occurrences in batch. +message BatchCreateOccurrencesResponse { + // The occurrences that were created. + repeated Occurrence occurrences = 1; +} + +// Request to get a vulnerability summary for some set of occurrences. +message GetVulnerabilityOccurrencesSummaryRequest { + // The name of the project to get a vulnerability summary for in the form of + // `projects/[PROJECT_ID]`. + string parent = 1; + // The filter expression. + string filter = 2; +} + +// A summary of how many vulnerability occurrences there are per resource and +// severity type. +message VulnerabilityOccurrencesSummary { + // A listing by resource of the number of fixable and total vulnerabilities. + repeated FixableTotalByDigest counts = 1; + + // Per resource and severity counts of fixable and total vulnerabilites. + message FixableTotalByDigest { + // The affected resource. + Resource resource = 1; + // The severity for this count. SEVERITY_UNSPECIFIED indicates total across + // all severities. + grafeas.v1beta1.vulnerability.Severity severity = 2; + // The number of fixable vulnerabilities associated with this resource. + int64 fixable_count = 3; + // The total number of vulnerabilities associated with this resource. + int64 total_count = 4; + } +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/image/image.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/image/image.proto new file mode 100644 index 000000000000..01f5305a557d --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/image/image.proto @@ -0,0 +1,144 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.image; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/image;image"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.image"; +option objc_class_prefix = "GRA"; + +// Layer holds metadata specific to a layer of a Docker image. +message Layer { + // Instructions from Dockerfile. + enum Directive { + // Default value for unsupported/missing directive. + DIRECTIVE_UNSPECIFIED = 0; + + // https://docs.docker.com/reference/builder/#maintainer + MAINTAINER = 1; + + // https://docs.docker.com/reference/builder/#run + RUN = 2; + + // https://docs.docker.com/reference/builder/#cmd + CMD = 3; + + // https://docs.docker.com/reference/builder/#label + LABEL = 4; + + // https://docs.docker.com/reference/builder/#expose + EXPOSE = 5; + + // https://docs.docker.com/reference/builder/#env + ENV = 6; + + // https://docs.docker.com/reference/builder/#add + ADD = 7; + + // https://docs.docker.com/reference/builder/#copy + COPY = 8; + + // https://docs.docker.com/reference/builder/#entrypoint + ENTRYPOINT = 9; + + // https://docs.docker.com/reference/builder/#volume + VOLUME = 10; + + // https://docs.docker.com/reference/builder/#user + USER = 11; + + // https://docs.docker.com/reference/builder/#workdir + WORKDIR = 12; + + // https://docs.docker.com/reference/builder/#arg + ARG = 13; + + // https://docs.docker.com/reference/builder/#onbuild + ONBUILD = 14; + + // https://docs.docker.com/reference/builder/#stopsignal + STOPSIGNAL = 15; + + // https://docs.docker.com/reference/builder/#healthcheck + HEALTHCHECK = 16; + + // https://docs.docker.com/reference/builder/#shell + SHELL = 17; + } + + // The recovered Dockerfile directive used to construct this layer. + Directive directive = 1; + + // The recovered arguments to the Dockerfile directive. + string arguments = 2; +} + +// A set of properties that uniquely identify a given Docker image. +message Fingerprint { + // The layer-id of the final layer in the Docker image's v1 representation. + string v1_name = 1; + + // The ordered list of v2 blobs that represent a given image. + repeated string v2_blob = 2; + + // Output only. The name of the image's v2 blobs computed via: + // [bottom] := v2_blob[bottom] + // [N] := sha256(v2_blob[N] + " " + v2_name[N+1]) + // Only the name of the final blob is kept. + string v2_name = 3; +} + +// Basis describes the base image portion (Note) of the DockerImage +// relationship. Linked occurrences are derived from this or an +// equivalent image via: +// FROM +// Or an equivalent reference, e.g. a tag of the resource_url. +message Basis { + // The resource_url for the resource representing the basis of + // associated occurrence images. + string resource_url = 1; + + // The fingerprint of the base image. + Fingerprint fingerprint = 2; +} + +// Details of an image occurrence. +message Details { + // The child image derived from the base image. + Derived derived_image = 1; +} + +// Derived describes the derived image portion (Occurrence) of the DockerImage +// relationship. This image would be produced from a Dockerfile with FROM +// . +message Derived { + // The fingerprint of the derived image. + Fingerprint fingerprint = 1; + + // Output only. The number of layers by which this image differs from the + // associated image basis. + int32 distance = 2; + + // This contains layer-specific metadata, if populated it has length + // "distance" and is ordered with [distance] being the layer immediately + // following the base image and [1] being the final layer. + repeated Layer layer_info = 3; + + // Output only. This contains the base image URL for the derived image + // occurrence. + string base_resource_url = 4; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/package/package.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/package/package.proto new file mode 100644 index 000000000000..07031d500f37 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/package/package.proto @@ -0,0 +1,127 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.package; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/package;package"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.pkg"; +option objc_class_prefix = "GRA"; + +// Instruction set architectures supported by various package managers. +enum Architecture { + // Unknown architecture. + ARCHITECTURE_UNSPECIFIED = 0; + // X86 architecture. + X86 = 1; + // X64 architecture. + X64 = 2; +} + +// This represents a particular channel of distribution for a given package. +// E.g., Debian's jessie-backports dpkg mirror. +message Distribution { + // The cpe_uri in [cpe format](https://cpe.mitre.org/specification/) + // denoting the package manager version distributing a package. + string cpe_uri = 1; + + // The CPU architecture for which packages in this distribution channel were + // built. + Architecture architecture = 2; + + // The latest available version of this package in this distribution + // channel. + Version latest_version = 3; + + // A freeform string denoting the maintainer of this package. + string maintainer = 4; + + // The distribution channel-specific homepage for this package. + string url = 5; + + // The distribution channel-specific description of this package. + string description = 6; +} + +// An occurrence of a particular package installation found within a system's +// filesystem. E.g., glibc was found in /var/lib/dpkg/status. +message Location { + // The cpe_uri in [cpe format](https://cpe.mitre.org/specification/) + // denoting the package manager version distributing a package. + string cpe_uri = 1; + + // The version installed at this location. + Version version = 2; + + // The path from which we gathered that this package/version is installed. + string path = 3; +} + +// This represents a particular package that is distributed over various +// channels. E.g., glibc (aka libc6) is distributed by many, at various +// versions. +message Package { + // The name of the package. + string name = 1; + + // The various channels by which a package is distributed. + repeated Distribution distribution = 10; +} + +// Details of a package occurrence. +message Details { + // Where the package was installed. + Installation installation = 1; +} + +// This represents how a particular software package may be installed on a +// system. +message Installation { + // Output only. The name of the installed package. + string name = 1; + + // All of the places within the filesystem versions of this package + // have been found. + repeated Location location = 2; +} + +// Version contains structured information about the version of a package. +message Version { + // Used to correct mistakes in the version numbering scheme. + int32 epoch = 1; + // The main part of the version name. + string name = 2; + // The iteration of the package build from the above version. + string revision = 3; + + // Whether this is an ordinary package version or a sentinel MIN/MAX version. + enum VersionKind { + // Unknown. + VERSION_KIND_UNSPECIFIED = 0; + // A standard package version, defined by the other fields. + NORMAL = 1; + // A special version representing negative infinity, other fields are + // ignored. + MINIMUM = 2; + // A special version representing positive infinity, other fields are + // ignored. + MAXIMUM = 3; + }; + + // Distinguish between sentinel MIN/MAX versions and normal versions. If + // kind is not NORMAL, then the other fields are ignored. + VersionKind kind = 4; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/provenance/provenance.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/provenance/provenance.proto new file mode 100644 index 000000000000..40549da666ec --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/provenance/provenance.proto @@ -0,0 +1,164 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.provenance; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/provenance;provenance"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.provenance"; +option objc_class_prefix = "GRA"; + +import "google/protobuf/timestamp.proto"; +import "google/devtools/containeranalysis/v1beta1/source/source.proto"; + +// Provenance of a build. Contains all information needed to verify the full +// details about the build from source to completion. +message BuildProvenance { + // Unique identifier of the build. + string id = 1; + + // ID of the project. + string project_id = 2; + + // Commands requested by the build. + repeated Command commands = 3; + + // Output of the build. + repeated Artifact built_artifacts = 4; + + // Time at which the build was created. + google.protobuf.Timestamp create_time = 5; + + // Time at which execution of the build was started. + google.protobuf.Timestamp start_time = 6; + + // Time at which execution of the build was finished. + google.protobuf.Timestamp end_time = 7; + + // E-mail address of the user who initiated this build. Note that this was the + // user's e-mail address at the time the build was initiated; this address may + // not represent the same end-user for all time. + string creator = 8; + + // URI where any logs for this provenance were written. + string logs_uri = 9; + + // Details of the Source input to the build. + Source source_provenance = 10; + + // Trigger identifier if the build was triggered automatically; empty if not. + string trigger_id = 11; + + // Special options applied to this build. This is a catch-all field where + // build providers can enter any desired additional details. + map build_options = 12; + + // Version string of the builder at the time this build was executed. + string builder_version = 13; + + // next_id = 14 +} + +// Source describes the location of the source used for the build. +message Source { + // If provided, the input binary artifacts for the build came from this + // location. + string artifact_storage_source_uri = 1; + + // Hash(es) of the build source, which can be used to verify that the original + // source integrity was maintained in the build. + // + // The keys to this map are file paths used as build source and the values + // contain the hash values for those files. + // + // If the build source came in a single package such as a gzipped tarfile + // (.tar.gz), the FileHash will be for the single path to that file. + map file_hashes = 2; + + // If provided, the source code used for the build came from this location. + grafeas.v1beta1.source.SourceContext context = 3; + + // If provided, some of the source code used for the build may be found in + // these locations, in the case where the source repository had multiple + // remotes or submodules. This list will not include the context specified in + // the context field. + repeated grafeas.v1beta1.source.SourceContext additional_contexts = 4; +} + +// Container message for hashes of byte content of files, used in Source +// messages to verify integrity of source input to the build. +message FileHashes { + // Collection of file hashes. + repeated Hash file_hash = 1; +} + +// Container message for hash values. +message Hash { + // Specifies the hash algorithm, if any. + enum HashType { + // Unknown. + HASH_TYPE_UNSPECIFIED = 0; + // A SHA-256 hash. + SHA256 = 1; + } + + // The type of hash that was performed. + HashType type = 1; + // The hash value. + bytes value = 2; +} + +// Command describes a step performed as part of the build pipeline. +message Command { + // Name of the command, as presented on the command line, or if the command is + // packaged as a Docker container, as presented to `docker pull`. + string name = 1; + + // Environment variables set before running this command. + repeated string env = 2; + + // Command-line arguments used when executing this command. + repeated string args = 3; + + // Working directory (relative to project source root) used when running this + // command. + string dir = 4; + + // Optional unique identifier for this command, used in wait_for to reference + // this command as a dependency. + string id = 5; + + // The ID(s) of the command(s) that this command depends on. + repeated string wait_for = 6; +} + +// Artifact describes a build product. +message Artifact { + // Hash or checksum value of a binary, or Docker Registry 2.0 digest of a + // container. + string checksum = 1; + + // Artifact ID, if any; for container images, this will be a URL by digest + // like `gcr.io/projectID/imagename@sha256:123456`. + string id = 2; + + // Related artifact names. This may be the path to a binary or jar file, or in + // the case of a container build, the name used to push the container image to + // Google Container Registry, as presented to `docker push`. Note that a + // single Artifact ID can have multiple names, for example if two tags are + // applied to one image. + repeated string names = 3; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/source/source.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/source/source.proto new file mode 100644 index 000000000000..01be060c5fc0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/source/source.proto @@ -0,0 +1,134 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.source; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/source;source"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.source"; +option objc_class_prefix = "GRA"; + +// A SourceContext is a reference to a tree of files. A SourceContext together +// with a path point to a unique revision of a single file or directory. +message SourceContext { + // A SourceContext can refer any one of the following types of repositories. + oneof context { + // A SourceContext referring to a revision in a Google Cloud Source Repo. + CloudRepoSourceContext cloud_repo = 1; + + // A SourceContext referring to a Gerrit project. + GerritSourceContext gerrit = 2; + + // A SourceContext referring to any third party Git repo (e.g., GitHub). + GitSourceContext git = 3; + } + + // Labels with user defined metadata. + map labels = 4; +} + +// An alias to a repo revision. +message AliasContext { + // The type of an alias. + enum Kind { + // Unknown. + KIND_UNSPECIFIED = 0; + // Git tag. + FIXED = 1; + // Git branch. + MOVABLE = 2; + // Used to specify non-standard aliases. For example, if a Git repo has a + // ref named "refs/foo/bar". + OTHER = 4; + } + + // The alias kind. + Kind kind = 1; + + // The alias name. + string name = 2; +} + +// A CloudRepoSourceContext denotes a particular revision in a Google Cloud +// Source Repo. +message CloudRepoSourceContext { + // The ID of the repo. + RepoId repo_id = 1; + + // A revision in a Cloud Repo can be identified by either its revision ID or + // its alias. + oneof revision { + // A revision ID. + string revision_id = 2; + + // An alias, which may be a branch or tag. + AliasContext alias_context = 3; + } +} + +// A SourceContext referring to a Gerrit project. +message GerritSourceContext { + // The URI of a running Gerrit instance. + string host_uri = 1; + + // The full project name within the host. Projects may be nested, so + // "project/subproject" is a valid project name. The "repo name" is the + // hostURI/project. + string gerrit_project = 2; + + // A revision in a Gerrit project can be identified by either its revision ID + // or its alias. + oneof revision { + // A revision (commit) ID. + string revision_id = 3; + + // An alias, which may be a branch or tag. + AliasContext alias_context = 4; + } +} + +// A GitSourceContext denotes a particular revision in a third party Git +// repository (e.g., GitHub). +message GitSourceContext { + // Git repository URL. + string url = 1; + + // Git commit hash. + string revision_id = 2; +} + +// A unique identifier for a Cloud Repo. +message RepoId { + // A cloud repo can be identified by either its project ID and repository name + // combination, or its globally unique identifier. + oneof id { + // A combination of a project ID and a repo name. + ProjectRepoId project_repo_id = 1; + + // A server-assigned, globally unique identifier. + string uid = 2; + } +} + +// Selects a repo using a Google Cloud Platform project ID (e.g., +// winged-cargo-31) and a repo name within that project. +message ProjectRepoId { + // The ID of the project. + string project_id = 1; + + // The name of the repo. Leave empty for the default repo. + string repo_name = 2; +} diff --git a/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto new file mode 100644 index 000000000000..6134e042ead5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-containeranalysis-v1beta1/src/main/proto/google/devtools/containeranalysis/v1beta1/vulnerability/vulnerability.proto @@ -0,0 +1,145 @@ +// Copyright 2018 The Grafeas Authors. All rights reserved. +// +// 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 grafeas.v1beta1.vulnerability; + +option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/vulnerability;vulnerability"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1beta1.vulnerability"; +option objc_class_prefix = "GRA"; + +import "google/devtools/containeranalysis/v1beta1/common/common.proto"; +import "google/devtools/containeranalysis/v1beta1/package/package.proto"; + +// Note provider-assigned severity/impact ranking. +enum Severity { + // Unknown. + SEVERITY_UNSPECIFIED = 0; + // Minimal severity. + MINIMAL = 1; + // Low severity. + LOW = 2; + // Medium severity. + MEDIUM = 3; + // High severity. + HIGH = 4; + // Critical severity. + CRITICAL = 5; +} + +// Vulnerability provides metadata about a security vulnerability. +message Vulnerability { + // The CVSS score for this vulnerability. + float cvss_score = 1; + + // Note provider assigned impact of the vulnerability. + Severity severity = 2; + + // All information about the package to specifically identify this + // vulnerability. One entry per (version range and cpe_uri) the package + // vulnerability has manifested in. + repeated Detail details = 3; + + // Identifies all occurrences of this vulnerability in the package for a + // specific distro/location. For example: glibc in + // cpe:/o:debian:debian_linux:8 for versions 2.1 - 2.2 + message Detail { + // The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) in + // which the vulnerability manifests. Examples include distro or storage + // location for vulnerable jar. + string cpe_uri = 1; + + // The name of the package where the vulnerability was found. + string package = 2; + + // The min version of the package in which the vulnerability exists. + grafeas.v1beta1.package.Version min_affected_version = 3; + + // The max version of the package in which the vulnerability exists. + grafeas.v1beta1.package.Version max_affected_version = 4; + + // The severity (eg: distro assigned severity) for this vulnerability. + string severity_name = 5; + + // A vendor-specific description of this note. + string description = 6; + + // The fix for this specific package version. + VulnerabilityLocation fixed_location = 7; + + // The type of package; whether native or non native(ruby gems, node.js + // packages etc). + string package_type = 8; + + // Whether this detail is obsolete. Occurrences are expected not to point to + // obsolete details. + bool is_obsolete = 9; + } +} + +// Details of a vulnerability occurrence. +message Details { + // The type of package; whether native or non native(ruby gems, node.js + // packages etc) + string type = 1; + + // Output only. The note provider assigned Severity of the vulnerability. + Severity severity = 2; + + // Output only. The CVSS score of this vulnerability. CVSS score is on a + // scale of 0-10 where 0 indicates low severity and 10 indicates high + // severity. + float cvss_score = 3; + + // The set of affected locations and their fixes (if available) within the + // associated resource. + repeated PackageIssue package_issue = 4; + + // Output only. A one sentence description of this vulnerability. + string short_description = 5; + + // Output only. A detailed description of this vulnerability. + string long_description = 6; + + // Output only. URLs related to this vulnerability. + repeated grafeas.v1beta1.RelatedUrl related_urls = 7; +} + +// This message wraps a location affected by a vulnerability and its +// associated fix (if one is available). +message PackageIssue { + // The location of the vulnerability. + VulnerabilityLocation affected_location = 1; + + // The location of the available fix for vulnerability. + VulnerabilityLocation fixed_location = 2; + + // The severity (e.g., distro assigned severity) for this vulnerability. + string severity_name = 3; +} + +// The location of the vulnerability. +message VulnerabilityLocation { + // The cpe_uri in [cpe format] (https://cpe.mitre.org/specification/) + // format. Examples include distro or storage location for vulnerable jar. + string cpe_uri = 1; + + // The package being described. + string package = 2; + + // The version of the package being described. + grafeas.v1beta1.package.Version version = 3; +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryField.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryField.java new file mode 100644 index 000000000000..034f112f52f4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryField.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Message defining a field of a BigQuery table.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.BigQueryField} + */ +public final class BigQueryField extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.BigQueryField) + BigQueryFieldOrBuilder { +private static final long serialVersionUID = 0L; + // Use BigQueryField.newBuilder() to construct. + private BigQueryField(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BigQueryField() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BigQueryField( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.privacy.dlp.v2.BigQueryTable.Builder subBuilder = null; + if (table_ != null) { + subBuilder = table_.toBuilder(); + } + table_ = input.readMessage(com.google.privacy.dlp.v2.BigQueryTable.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(table_); + table_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.privacy.dlp.v2.FieldId.Builder subBuilder = null; + if (field_ != null) { + subBuilder = field_.toBuilder(); + } + field_ = input.readMessage(com.google.privacy.dlp.v2.FieldId.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(field_); + field_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_BigQueryField_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_BigQueryField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.BigQueryField.class, com.google.privacy.dlp.v2.BigQueryField.Builder.class); + } + + public static final int TABLE_FIELD_NUMBER = 1; + private com.google.privacy.dlp.v2.BigQueryTable table_; + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public boolean hasTable() { + return table_ != null; + } + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public com.google.privacy.dlp.v2.BigQueryTable getTable() { + return table_ == null ? com.google.privacy.dlp.v2.BigQueryTable.getDefaultInstance() : table_; + } + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public com.google.privacy.dlp.v2.BigQueryTableOrBuilder getTableOrBuilder() { + return getTable(); + } + + public static final int FIELD_FIELD_NUMBER = 2; + private com.google.privacy.dlp.v2.FieldId field_; + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public boolean hasField() { + return field_ != null; + } + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public com.google.privacy.dlp.v2.FieldId getField() { + return field_ == null ? com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : field_; + } + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public com.google.privacy.dlp.v2.FieldIdOrBuilder getFieldOrBuilder() { + return getField(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (table_ != null) { + output.writeMessage(1, getTable()); + } + if (field_ != null) { + output.writeMessage(2, getField()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (table_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTable()); + } + if (field_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getField()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.BigQueryField)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.BigQueryField other = (com.google.privacy.dlp.v2.BigQueryField) obj; + + boolean result = true; + result = result && (hasTable() == other.hasTable()); + if (hasTable()) { + result = result && getTable() + .equals(other.getTable()); + } + result = result && (hasField() == other.hasField()); + if (hasField()) { + result = result && getField() + .equals(other.getField()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTable()) { + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + } + if (hasField()) { + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.BigQueryField parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.BigQueryField parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.BigQueryField parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.BigQueryField prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message defining a field of a BigQuery table.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.BigQueryField} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.BigQueryField) + com.google.privacy.dlp.v2.BigQueryFieldOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_BigQueryField_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_BigQueryField_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.BigQueryField.class, com.google.privacy.dlp.v2.BigQueryField.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.BigQueryField.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (tableBuilder_ == null) { + table_ = null; + } else { + table_ = null; + tableBuilder_ = null; + } + if (fieldBuilder_ == null) { + field_ = null; + } else { + field_ = null; + fieldBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_BigQueryField_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.BigQueryField getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.BigQueryField build() { + com.google.privacy.dlp.v2.BigQueryField result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.BigQueryField buildPartial() { + com.google.privacy.dlp.v2.BigQueryField result = new com.google.privacy.dlp.v2.BigQueryField(this); + if (tableBuilder_ == null) { + result.table_ = table_; + } else { + result.table_ = tableBuilder_.build(); + } + if (fieldBuilder_ == null) { + result.field_ = field_; + } else { + result.field_ = fieldBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.BigQueryField) { + return mergeFrom((com.google.privacy.dlp.v2.BigQueryField)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.BigQueryField other) { + if (other == com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance()) return this; + if (other.hasTable()) { + mergeTable(other.getTable()); + } + if (other.hasField()) { + mergeField(other.getField()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.BigQueryField parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.BigQueryField) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.privacy.dlp.v2.BigQueryTable table_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryTable, com.google.privacy.dlp.v2.BigQueryTable.Builder, com.google.privacy.dlp.v2.BigQueryTableOrBuilder> tableBuilder_; + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public boolean hasTable() { + return tableBuilder_ != null || table_ != null; + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public com.google.privacy.dlp.v2.BigQueryTable getTable() { + if (tableBuilder_ == null) { + return table_ == null ? com.google.privacy.dlp.v2.BigQueryTable.getDefaultInstance() : table_; + } else { + return tableBuilder_.getMessage(); + } + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public Builder setTable(com.google.privacy.dlp.v2.BigQueryTable value) { + if (tableBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + table_ = value; + onChanged(); + } else { + tableBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public Builder setTable( + com.google.privacy.dlp.v2.BigQueryTable.Builder builderForValue) { + if (tableBuilder_ == null) { + table_ = builderForValue.build(); + onChanged(); + } else { + tableBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public Builder mergeTable(com.google.privacy.dlp.v2.BigQueryTable value) { + if (tableBuilder_ == null) { + if (table_ != null) { + table_ = + com.google.privacy.dlp.v2.BigQueryTable.newBuilder(table_).mergeFrom(value).buildPartial(); + } else { + table_ = value; + } + onChanged(); + } else { + tableBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public Builder clearTable() { + if (tableBuilder_ == null) { + table_ = null; + onChanged(); + } else { + table_ = null; + tableBuilder_ = null; + } + + return this; + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public com.google.privacy.dlp.v2.BigQueryTable.Builder getTableBuilder() { + + onChanged(); + return getTableFieldBuilder().getBuilder(); + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + public com.google.privacy.dlp.v2.BigQueryTableOrBuilder getTableOrBuilder() { + if (tableBuilder_ != null) { + return tableBuilder_.getMessageOrBuilder(); + } else { + return table_ == null ? + com.google.privacy.dlp.v2.BigQueryTable.getDefaultInstance() : table_; + } + } + /** + *
+     * Source table of the field.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryTable, com.google.privacy.dlp.v2.BigQueryTable.Builder, com.google.privacy.dlp.v2.BigQueryTableOrBuilder> + getTableFieldBuilder() { + if (tableBuilder_ == null) { + tableBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryTable, com.google.privacy.dlp.v2.BigQueryTable.Builder, com.google.privacy.dlp.v2.BigQueryTableOrBuilder>( + getTable(), + getParentForChildren(), + isClean()); + table_ = null; + } + return tableBuilder_; + } + + private com.google.privacy.dlp.v2.FieldId field_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.FieldId, com.google.privacy.dlp.v2.FieldId.Builder, com.google.privacy.dlp.v2.FieldIdOrBuilder> fieldBuilder_; + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public boolean hasField() { + return fieldBuilder_ != null || field_ != null; + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public com.google.privacy.dlp.v2.FieldId getField() { + if (fieldBuilder_ == null) { + return field_ == null ? com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : field_; + } else { + return fieldBuilder_.getMessage(); + } + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public Builder setField(com.google.privacy.dlp.v2.FieldId value) { + if (fieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + field_ = value; + onChanged(); + } else { + fieldBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public Builder setField( + com.google.privacy.dlp.v2.FieldId.Builder builderForValue) { + if (fieldBuilder_ == null) { + field_ = builderForValue.build(); + onChanged(); + } else { + fieldBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public Builder mergeField(com.google.privacy.dlp.v2.FieldId value) { + if (fieldBuilder_ == null) { + if (field_ != null) { + field_ = + com.google.privacy.dlp.v2.FieldId.newBuilder(field_).mergeFrom(value).buildPartial(); + } else { + field_ = value; + } + onChanged(); + } else { + fieldBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public Builder clearField() { + if (fieldBuilder_ == null) { + field_ = null; + onChanged(); + } else { + field_ = null; + fieldBuilder_ = null; + } + + return this; + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public com.google.privacy.dlp.v2.FieldId.Builder getFieldBuilder() { + + onChanged(); + return getFieldFieldBuilder().getBuilder(); + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + public com.google.privacy.dlp.v2.FieldIdOrBuilder getFieldOrBuilder() { + if (fieldBuilder_ != null) { + return fieldBuilder_.getMessageOrBuilder(); + } else { + return field_ == null ? + com.google.privacy.dlp.v2.FieldId.getDefaultInstance() : field_; + } + } + /** + *
+     * Designated field in the BigQuery table.
+     * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.FieldId, com.google.privacy.dlp.v2.FieldId.Builder, com.google.privacy.dlp.v2.FieldIdOrBuilder> + getFieldFieldBuilder() { + if (fieldBuilder_ == null) { + fieldBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.FieldId, com.google.privacy.dlp.v2.FieldId.Builder, com.google.privacy.dlp.v2.FieldIdOrBuilder>( + getField(), + getParentForChildren(), + isClean()); + field_ = null; + } + return fieldBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.BigQueryField) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.BigQueryField) + private static final com.google.privacy.dlp.v2.BigQueryField DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.BigQueryField(); + } + + public static com.google.privacy.dlp.v2.BigQueryField getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryField parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BigQueryField(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.BigQueryField getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryFieldOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryFieldOrBuilder.java new file mode 100644 index 000000000000..587ebc8b6539 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryFieldOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +public interface BigQueryFieldOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.BigQueryField) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + boolean hasTable(); + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + com.google.privacy.dlp.v2.BigQueryTable getTable(); + /** + *
+   * Source table of the field.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryTable table = 1; + */ + com.google.privacy.dlp.v2.BigQueryTableOrBuilder getTableOrBuilder(); + + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + boolean hasField(); + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + com.google.privacy.dlp.v2.FieldId getField(); + /** + *
+   * Designated field in the BigQuery table.
+   * 
+ * + * .google.privacy.dlp.v2.FieldId field = 2; + */ + com.google.privacy.dlp.v2.FieldIdOrBuilder getFieldOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptions.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptions.java index ae0ec4df9ff2..6994ae04c49f 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptions.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptions.java @@ -22,6 +22,7 @@ private BigQueryOptions(com.google.protobuf.GeneratedMessageV3.Builder builde private BigQueryOptions() { identifyingFields_ = java.util.Collections.emptyList(); rowsLimit_ = 0L; + rowsLimitPercent_ = 0; sampleMethod_ = 0; } @@ -82,6 +83,11 @@ private BigQueryOptions( sampleMethod_ = rawValue; break; } + case 48: { + + rowsLimitPercent_ = input.readInt32(); + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -346,7 +352,8 @@ public com.google.privacy.dlp.v2.FieldIdOrBuilder getIdentifyingFieldsOrBuilder( *
    * Max number of rows to scan. If the table has more rows than this value, the
    * rest of the rows are omitted. If not set, or if set to 0, all rows will be
-   * scanned. Cannot be used in conjunction with TimespanConfig.
+   * scanned. Only one of rows_limit and rows_limit_percent can be specified.
+   * Cannot be used in conjunction with TimespanConfig.
    * 
* * int64 rows_limit = 3; @@ -355,6 +362,23 @@ public long getRowsLimit() { return rowsLimit_; } + public static final int ROWS_LIMIT_PERCENT_FIELD_NUMBER = 6; + private int rowsLimitPercent_; + /** + *
+   * Max percentage of rows to scan. The rest are omitted. The number of rows
+   * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
+   * 100 means no limit. Defaults to 0. Only one of rows_limit and
+   * rows_limit_percent can be specified. Cannot be used in conjunction with
+   * TimespanConfig.
+   * 
+ * + * int32 rows_limit_percent = 6; + */ + public int getRowsLimitPercent() { + return rowsLimitPercent_; + } + public static final int SAMPLE_METHOD_FIELD_NUMBER = 4; private int sampleMethod_; /** @@ -398,6 +422,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (sampleMethod_ != com.google.privacy.dlp.v2.BigQueryOptions.SampleMethod.SAMPLE_METHOD_UNSPECIFIED.getNumber()) { output.writeEnum(4, sampleMethod_); } + if (rowsLimitPercent_ != 0) { + output.writeInt32(6, rowsLimitPercent_); + } unknownFields.writeTo(output); } @@ -423,6 +450,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, sampleMethod_); } + if (rowsLimitPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, rowsLimitPercent_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -448,6 +479,8 @@ public boolean equals(final java.lang.Object obj) { .equals(other.getIdentifyingFieldsList()); result = result && (getRowsLimit() == other.getRowsLimit()); + result = result && (getRowsLimitPercent() + == other.getRowsLimitPercent()); result = result && sampleMethod_ == other.sampleMethod_; result = result && unknownFields.equals(other.unknownFields); return result; @@ -471,6 +504,8 @@ public int hashCode() { hash = (37 * hash) + ROWS_LIMIT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getRowsLimit()); + hash = (37 * hash) + ROWS_LIMIT_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getRowsLimitPercent(); hash = (37 * hash) + SAMPLE_METHOD_FIELD_NUMBER; hash = (53 * hash) + sampleMethod_; hash = (29 * hash) + unknownFields.hashCode(); @@ -625,6 +660,8 @@ public Builder clear() { } rowsLimit_ = 0L; + rowsLimitPercent_ = 0; + sampleMethod_ = 0; return this; @@ -670,6 +707,7 @@ public com.google.privacy.dlp.v2.BigQueryOptions buildPartial() { result.identifyingFields_ = identifyingFieldsBuilder_.build(); } result.rowsLimit_ = rowsLimit_; + result.rowsLimitPercent_ = rowsLimitPercent_; result.sampleMethod_ = sampleMethod_; result.bitField0_ = to_bitField0_; onBuilt(); @@ -752,6 +790,9 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.BigQueryOptions other) { if (other.getRowsLimit() != 0L) { setRowsLimit(other.getRowsLimit()); } + if (other.getRowsLimitPercent() != 0) { + setRowsLimitPercent(other.getRowsLimitPercent()); + } if (other.sampleMethod_ != 0) { setSampleMethodValue(other.getSampleMethodValue()); } @@ -1273,7 +1314,8 @@ public com.google.privacy.dlp.v2.FieldId.Builder addIdentifyingFieldsBuilder( *
      * Max number of rows to scan. If the table has more rows than this value, the
      * rest of the rows are omitted. If not set, or if set to 0, all rows will be
-     * scanned. Cannot be used in conjunction with TimespanConfig.
+     * scanned. Only one of rows_limit and rows_limit_percent can be specified.
+     * Cannot be used in conjunction with TimespanConfig.
      * 
* * int64 rows_limit = 3; @@ -1285,7 +1327,8 @@ public long getRowsLimit() { *
      * Max number of rows to scan. If the table has more rows than this value, the
      * rest of the rows are omitted. If not set, or if set to 0, all rows will be
-     * scanned. Cannot be used in conjunction with TimespanConfig.
+     * scanned. Only one of rows_limit and rows_limit_percent can be specified.
+     * Cannot be used in conjunction with TimespanConfig.
      * 
* * int64 rows_limit = 3; @@ -1300,7 +1343,8 @@ public Builder setRowsLimit(long value) { *
      * Max number of rows to scan. If the table has more rows than this value, the
      * rest of the rows are omitted. If not set, or if set to 0, all rows will be
-     * scanned. Cannot be used in conjunction with TimespanConfig.
+     * scanned. Only one of rows_limit and rows_limit_percent can be specified.
+     * Cannot be used in conjunction with TimespanConfig.
      * 
* * int64 rows_limit = 3; @@ -1312,6 +1356,56 @@ public Builder clearRowsLimit() { return this; } + private int rowsLimitPercent_ ; + /** + *
+     * Max percentage of rows to scan. The rest are omitted. The number of rows
+     * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
+     * 100 means no limit. Defaults to 0. Only one of rows_limit and
+     * rows_limit_percent can be specified. Cannot be used in conjunction with
+     * TimespanConfig.
+     * 
+ * + * int32 rows_limit_percent = 6; + */ + public int getRowsLimitPercent() { + return rowsLimitPercent_; + } + /** + *
+     * Max percentage of rows to scan. The rest are omitted. The number of rows
+     * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
+     * 100 means no limit. Defaults to 0. Only one of rows_limit and
+     * rows_limit_percent can be specified. Cannot be used in conjunction with
+     * TimespanConfig.
+     * 
+ * + * int32 rows_limit_percent = 6; + */ + public Builder setRowsLimitPercent(int value) { + + rowsLimitPercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Max percentage of rows to scan. The rest are omitted. The number of rows
+     * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
+     * 100 means no limit. Defaults to 0. Only one of rows_limit and
+     * rows_limit_percent can be specified. Cannot be used in conjunction with
+     * TimespanConfig.
+     * 
+ * + * int32 rows_limit_percent = 6; + */ + public Builder clearRowsLimitPercent() { + + rowsLimitPercent_ = 0; + onChanged(); + return this; + } + private int sampleMethod_ = 0; /** * .google.privacy.dlp.v2.BigQueryOptions.SampleMethod sample_method = 4; diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptionsOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptionsOrBuilder.java index 23d4dbdc538f..2cb069b6ff3c 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptionsOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/BigQueryOptionsOrBuilder.java @@ -85,13 +85,27 @@ com.google.privacy.dlp.v2.FieldIdOrBuilder getIdentifyingFieldsOrBuilder( *
    * Max number of rows to scan. If the table has more rows than this value, the
    * rest of the rows are omitted. If not set, or if set to 0, all rows will be
-   * scanned. Cannot be used in conjunction with TimespanConfig.
+   * scanned. Only one of rows_limit and rows_limit_percent can be specified.
+   * Cannot be used in conjunction with TimespanConfig.
    * 
* * int64 rows_limit = 3; */ long getRowsLimit(); + /** + *
+   * Max percentage of rows to scan. The rest are omitted. The number of rows
+   * scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and
+   * 100 means no limit. Defaults to 0. Only one of rows_limit and
+   * rows_limit_percent can be specified. Cannot be used in conjunction with
+   * TimespanConfig.
+   * 
+ * + * int32 rows_limit_percent = 6; + */ + int getRowsLimitPercent(); + /** * .google.privacy.dlp.v2.BigQueryOptions.SampleMethod sample_method = 4; */ diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSet.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSet.java new file mode 100644 index 000000000000..32697cf6bee2 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSet.java @@ -0,0 +1,584 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Message representing a set of files in Cloud Storage.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.CloudStorageFileSet} + */ +public final class CloudStorageFileSet extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.CloudStorageFileSet) + CloudStorageFileSetOrBuilder { +private static final long serialVersionUID = 0L; + // Use CloudStorageFileSet.newBuilder() to construct. + private CloudStorageFileSet(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CloudStorageFileSet() { + url_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CloudStorageFileSet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_CloudStorageFileSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.CloudStorageFileSet.class, com.google.privacy.dlp.v2.CloudStorageFileSet.Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + *
+   * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+   * path is allowed.
+   * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + *
+   * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+   * path is allowed.
+   * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.CloudStorageFileSet)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.CloudStorageFileSet other = (com.google.privacy.dlp.v2.CloudStorageFileSet) obj; + + boolean result = true; + result = result && getUrl() + .equals(other.getUrl()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CloudStorageFileSet parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.CloudStorageFileSet prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Message representing a set of files in Cloud Storage.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.CloudStorageFileSet} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.CloudStorageFileSet) + com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_CloudStorageFileSet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.CloudStorageFileSet.class, com.google.privacy.dlp.v2.CloudStorageFileSet.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.CloudStorageFileSet.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + url_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CloudStorageFileSet getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CloudStorageFileSet build() { + com.google.privacy.dlp.v2.CloudStorageFileSet result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CloudStorageFileSet buildPartial() { + com.google.privacy.dlp.v2.CloudStorageFileSet result = new com.google.privacy.dlp.v2.CloudStorageFileSet(this); + result.url_ = url_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.CloudStorageFileSet) { + return mergeFrom((com.google.privacy.dlp.v2.CloudStorageFileSet)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.CloudStorageFileSet other) { + if (other == com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.CloudStorageFileSet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.CloudStorageFileSet) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+     * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+     * path is allowed.
+     * 
+ * + * string url = 1; + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+     * path is allowed.
+     * 
+ * + * string url = 1; + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+     * path is allowed.
+     * 
+ * + * string url = 1; + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+     * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+     * path is allowed.
+     * 
+ * + * string url = 1; + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+     * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+     * path is allowed.
+     * 
+ * + * string url = 1; + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.CloudStorageFileSet) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CloudStorageFileSet) + private static final com.google.privacy.dlp.v2.CloudStorageFileSet DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.CloudStorageFileSet(); + } + + public static com.google.privacy.dlp.v2.CloudStorageFileSet getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CloudStorageFileSet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CloudStorageFileSet(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CloudStorageFileSet getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSetOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSetOrBuilder.java new file mode 100644 index 000000000000..44a9c717cab6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageFileSetOrBuilder.java @@ -0,0 +1,29 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +public interface CloudStorageFileSetOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.CloudStorageFileSet) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+   * path is allowed.
+   * 
+ * + * string url = 1; + */ + java.lang.String getUrl(); + /** + *
+   * The url, in the format `gs://<bucket>/<path>`. Trailing wildcard in the
+   * path is allowed.
+   * 
+ * + * string url = 1; + */ + com.google.protobuf.ByteString + getUrlBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptions.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptions.java index e1f2e5405266..15d6e78291f0 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptions.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptions.java @@ -22,6 +22,7 @@ private CloudStorageOptions(com.google.protobuf.GeneratedMessageV3.Builder bu } private CloudStorageOptions() { bytesLimitPerFile_ = 0L; + bytesLimitPerFilePercent_ = 0; fileTypes_ = java.util.Collections.emptyList(); sampleMethod_ = 0; filesLimitPercent_ = 0; @@ -71,9 +72,9 @@ private CloudStorageOptions( } case 40: { int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { fileTypes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000008; } fileTypes_.add(rawValue); break; @@ -83,9 +84,9 @@ private CloudStorageOptions( int oldLimit = input.pushLimit(length); while(input.getBytesUntilLimit() > 0) { int rawValue = input.readEnum(); - if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { fileTypes_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000004; + mutable_bitField0_ |= 0x00000008; } fileTypes_.add(rawValue); } @@ -103,6 +104,11 @@ private CloudStorageOptions( filesLimitPercent_ = input.readInt32(); break; } + case 64: { + + bytesLimitPerFilePercent_ = input.readInt32(); + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -118,7 +124,7 @@ private CloudStorageOptions( throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { fileTypes_ = java.util.Collections.unmodifiableList(fileTypes_); } this.unknownFields = unknownFields.build(); @@ -899,7 +905,8 @@ public com.google.privacy.dlp.v2.CloudStorageOptions.FileSetOrBuilder getFileSet /** *
    * Max number of bytes to scan from a file. If a scanned file's size is bigger
-   * than this value then the rest of the bytes are omitted.
+   * than this value then the rest of the bytes are omitted. Only one
+   * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
    * 
* * int64 bytes_limit_per_file = 4; @@ -908,6 +915,22 @@ public long getBytesLimitPerFile() { return bytesLimitPerFile_; } + public static final int BYTES_LIMIT_PER_FILE_PERCENT_FIELD_NUMBER = 8; + private int bytesLimitPerFilePercent_; + /** + *
+   * Max percentage of bytes to scan from a file. The rest are omitted. The
+   * number of bytes scanned is rounded down. Must be between 0 and 100,
+   * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
+   * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
+   * 
+ * + * int32 bytes_limit_per_file_percent = 8; + */ + public int getBytesLimitPerFilePercent() { + return bytesLimitPerFilePercent_; + } + public static final int FILE_TYPES_FIELD_NUMBER = 5; private java.util.List fileTypes_; private static final com.google.protobuf.Internal.ListAdapter.Converter< @@ -1050,6 +1073,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (filesLimitPercent_ != 0) { output.writeInt32(7, filesLimitPercent_); } + if (bytesLimitPerFilePercent_ != 0) { + output.writeInt32(8, bytesLimitPerFilePercent_); + } unknownFields.writeTo(output); } @@ -1087,6 +1113,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeInt32Size(7, filesLimitPercent_); } + if (bytesLimitPerFilePercent_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, bytesLimitPerFilePercent_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -1110,6 +1140,8 @@ public boolean equals(final java.lang.Object obj) { } result = result && (getBytesLimitPerFile() == other.getBytesLimitPerFile()); + result = result && (getBytesLimitPerFilePercent() + == other.getBytesLimitPerFilePercent()); result = result && fileTypes_.equals(other.fileTypes_); result = result && sampleMethod_ == other.sampleMethod_; result = result && (getFilesLimitPercent() @@ -1132,6 +1164,8 @@ public int hashCode() { hash = (37 * hash) + BYTES_LIMIT_PER_FILE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getBytesLimitPerFile()); + hash = (37 * hash) + BYTES_LIMIT_PER_FILE_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getBytesLimitPerFilePercent(); if (getFileTypesCount() > 0) { hash = (37 * hash) + FILE_TYPES_FIELD_NUMBER; hash = (53 * hash) + fileTypes_.hashCode(); @@ -1286,8 +1320,10 @@ public Builder clear() { } bytesLimitPerFile_ = 0L; + bytesLimitPerFilePercent_ = 0; + fileTypes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); sampleMethod_ = 0; filesLimitPercent_ = 0; @@ -1326,9 +1362,10 @@ public com.google.privacy.dlp.v2.CloudStorageOptions buildPartial() { result.fileSet_ = fileSetBuilder_.build(); } result.bytesLimitPerFile_ = bytesLimitPerFile_; - if (((bitField0_ & 0x00000004) == 0x00000004)) { + result.bytesLimitPerFilePercent_ = bytesLimitPerFilePercent_; + if (((bitField0_ & 0x00000008) == 0x00000008)) { fileTypes_ = java.util.Collections.unmodifiableList(fileTypes_); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } result.fileTypes_ = fileTypes_; result.sampleMethod_ = sampleMethod_; @@ -1388,10 +1425,13 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.CloudStorageOptions other) { if (other.getBytesLimitPerFile() != 0L) { setBytesLimitPerFile(other.getBytesLimitPerFile()); } + if (other.getBytesLimitPerFilePercent() != 0) { + setBytesLimitPerFilePercent(other.getBytesLimitPerFilePercent()); + } if (!other.fileTypes_.isEmpty()) { if (fileTypes_.isEmpty()) { fileTypes_ = other.fileTypes_; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); } else { ensureFileTypesIsMutable(); fileTypes_.addAll(other.fileTypes_); @@ -1555,7 +1595,8 @@ public com.google.privacy.dlp.v2.CloudStorageOptions.FileSetOrBuilder getFileSet /** *
      * Max number of bytes to scan from a file. If a scanned file's size is bigger
-     * than this value then the rest of the bytes are omitted.
+     * than this value then the rest of the bytes are omitted. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
      * 
* * int64 bytes_limit_per_file = 4; @@ -1566,7 +1607,8 @@ public long getBytesLimitPerFile() { /** *
      * Max number of bytes to scan from a file. If a scanned file's size is bigger
-     * than this value then the rest of the bytes are omitted.
+     * than this value then the rest of the bytes are omitted. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
      * 
* * int64 bytes_limit_per_file = 4; @@ -1580,7 +1622,8 @@ public Builder setBytesLimitPerFile(long value) { /** *
      * Max number of bytes to scan from a file. If a scanned file's size is bigger
-     * than this value then the rest of the bytes are omitted.
+     * than this value then the rest of the bytes are omitted. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
      * 
* * int64 bytes_limit_per_file = 4; @@ -1592,12 +1635,59 @@ public Builder clearBytesLimitPerFile() { return this; } + private int bytesLimitPerFilePercent_ ; + /** + *
+     * Max percentage of bytes to scan from a file. The rest are omitted. The
+     * number of bytes scanned is rounded down. Must be between 0 and 100,
+     * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
+     * 
+ * + * int32 bytes_limit_per_file_percent = 8; + */ + public int getBytesLimitPerFilePercent() { + return bytesLimitPerFilePercent_; + } + /** + *
+     * Max percentage of bytes to scan from a file. The rest are omitted. The
+     * number of bytes scanned is rounded down. Must be between 0 and 100,
+     * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
+     * 
+ * + * int32 bytes_limit_per_file_percent = 8; + */ + public Builder setBytesLimitPerFilePercent(int value) { + + bytesLimitPerFilePercent_ = value; + onChanged(); + return this; + } + /** + *
+     * Max percentage of bytes to scan from a file. The rest are omitted. The
+     * number of bytes scanned is rounded down. Must be between 0 and 100,
+     * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
+     * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
+     * 
+ * + * int32 bytes_limit_per_file_percent = 8; + */ + public Builder clearBytesLimitPerFilePercent() { + + bytesLimitPerFilePercent_ = 0; + onChanged(); + return this; + } + private java.util.List fileTypes_ = java.util.Collections.emptyList(); private void ensureFileTypesIsMutable() { - if (!((bitField0_ & 0x00000004) == 0x00000004)) { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { fileTypes_ = new java.util.ArrayList(fileTypes_); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000008; } } /** @@ -1703,7 +1793,7 @@ public Builder addAllFileTypes( */ public Builder clearFileTypes() { fileTypes_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000008); onChanged(); return this; } diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptionsOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptionsOrBuilder.java index 7b707e8a207a..3feb90a40652 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptionsOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CloudStorageOptionsOrBuilder.java @@ -23,13 +23,26 @@ public interface CloudStorageOptionsOrBuilder extends /** *
    * Max number of bytes to scan from a file. If a scanned file's size is bigger
-   * than this value then the rest of the bytes are omitted.
+   * than this value then the rest of the bytes are omitted. Only one
+   * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
    * 
* * int64 bytes_limit_per_file = 4; */ long getBytesLimitPerFile(); + /** + *
+   * Max percentage of bytes to scan from a file. The rest are omitted. The
+   * number of bytes scanned is rounded down. Must be between 0 and 100,
+   * inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one
+   * of bytes_limit_per_file and bytes_limit_per_file_percent can be specified.
+   * 
+ * + * int32 bytes_limit_per_file_percent = 8; + */ + int getBytesLimitPerFilePercent(); + /** *
    * List of file type groups to include in the scan.
diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequest.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequest.java
new file mode 100644
index 000000000000..a9eb6fa5a2b3
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequest.java
@@ -0,0 +1,989 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/privacy/dlp/v2/dlp.proto
+
+package com.google.privacy.dlp.v2;
+
+/**
+ * 
+ * Request message for CreateStoredInfoType.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.CreateStoredInfoTypeRequest} + */ +public final class CreateStoredInfoTypeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + CreateStoredInfoTypeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateStoredInfoTypeRequest.newBuilder() to construct. + private CreateStoredInfoTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CreateStoredInfoTypeRequest() { + parent_ = ""; + storedInfoTypeId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateStoredInfoTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.privacy.dlp.v2.StoredInfoTypeConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + storedInfoTypeId_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_FIELD_NUMBER = 2; + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_; + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int STORED_INFO_TYPE_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object storedInfoTypeId_; + /** + *
+   * The storedInfoType ID can contain uppercase and lowercase letters,
+   * numbers, and hyphens; that is, it must match the regular
+   * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+   * characters. Can be empty to allow the system to generate one.
+   * 
+ * + * string stored_info_type_id = 3; + */ + public java.lang.String getStoredInfoTypeId() { + java.lang.Object ref = storedInfoTypeId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storedInfoTypeId_ = s; + return s; + } + } + /** + *
+   * The storedInfoType ID can contain uppercase and lowercase letters,
+   * numbers, and hyphens; that is, it must match the regular
+   * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+   * characters. Can be empty to allow the system to generate one.
+   * 
+ * + * string stored_info_type_id = 3; + */ + public com.google.protobuf.ByteString + getStoredInfoTypeIdBytes() { + java.lang.Object ref = storedInfoTypeId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storedInfoTypeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (config_ != null) { + output.writeMessage(2, getConfig()); + } + if (!getStoredInfoTypeIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, storedInfoTypeId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getConfig()); + } + if (!getStoredInfoTypeIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, storedInfoTypeId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest other = (com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && (hasConfig() == other.hasConfig()); + if (hasConfig()) { + result = result && getConfig() + .equals(other.getConfig()); + } + result = result && getStoredInfoTypeId() + .equals(other.getStoredInfoTypeId()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + hash = (37 * hash) + STORED_INFO_TYPE_ID_FIELD_NUMBER; + hash = (53 * hash) + getStoredInfoTypeId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for CreateStoredInfoType.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.CreateStoredInfoTypeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + storedInfoTypeId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest build() { + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest buildPartial() { + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest result = new com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest(this); + result.parent_ = parent_; + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + result.storedInfoTypeId_ = storedInfoTypeId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest) { + return mergeFrom((com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest other) { + if (other == com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (!other.getStoredInfoTypeId().isEmpty()) { + storedInfoTypeId_ = other.storedInfoTypeId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> configBuilder_; + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder setConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder setConfig( + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder mergeConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.privacy.dlp.v2.StoredInfoTypeConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Configuration of the storedInfoType to create.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private java.lang.Object storedInfoTypeId_ = ""; + /** + *
+     * The storedInfoType ID can contain uppercase and lowercase letters,
+     * numbers, and hyphens; that is, it must match the regular
+     * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+     * characters. Can be empty to allow the system to generate one.
+     * 
+ * + * string stored_info_type_id = 3; + */ + public java.lang.String getStoredInfoTypeId() { + java.lang.Object ref = storedInfoTypeId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storedInfoTypeId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The storedInfoType ID can contain uppercase and lowercase letters,
+     * numbers, and hyphens; that is, it must match the regular
+     * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+     * characters. Can be empty to allow the system to generate one.
+     * 
+ * + * string stored_info_type_id = 3; + */ + public com.google.protobuf.ByteString + getStoredInfoTypeIdBytes() { + java.lang.Object ref = storedInfoTypeId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storedInfoTypeId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The storedInfoType ID can contain uppercase and lowercase letters,
+     * numbers, and hyphens; that is, it must match the regular
+     * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+     * characters. Can be empty to allow the system to generate one.
+     * 
+ * + * string stored_info_type_id = 3; + */ + public Builder setStoredInfoTypeId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storedInfoTypeId_ = value; + onChanged(); + return this; + } + /** + *
+     * The storedInfoType ID can contain uppercase and lowercase letters,
+     * numbers, and hyphens; that is, it must match the regular
+     * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+     * characters. Can be empty to allow the system to generate one.
+     * 
+ * + * string stored_info_type_id = 3; + */ + public Builder clearStoredInfoTypeId() { + + storedInfoTypeId_ = getDefaultInstance().getStoredInfoTypeId(); + onChanged(); + return this; + } + /** + *
+     * The storedInfoType ID can contain uppercase and lowercase letters,
+     * numbers, and hyphens; that is, it must match the regular
+     * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+     * characters. Can be empty to allow the system to generate one.
+     * 
+ * + * string stored_info_type_id = 3; + */ + public Builder setStoredInfoTypeIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storedInfoTypeId_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + private static final com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest(); + } + + public static com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateStoredInfoTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateStoredInfoTypeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.CreateStoredInfoTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequestOrBuilder.java new file mode 100644 index 000000000000..f247ddf9a4cf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CreateStoredInfoTypeRequestOrBuilder.java @@ -0,0 +1,78 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface CreateStoredInfoTypeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.CreateStoredInfoTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + boolean hasConfig(); + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig(); + /** + *
+   * Configuration of the storedInfoType to create.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * The storedInfoType ID can contain uppercase and lowercase letters,
+   * numbers, and hyphens; that is, it must match the regular
+   * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+   * characters. Can be empty to allow the system to generate one.
+   * 
+ * + * string stored_info_type_id = 3; + */ + java.lang.String getStoredInfoTypeId(); + /** + *
+   * The storedInfoType ID can contain uppercase and lowercase letters,
+   * numbers, and hyphens; that is, it must match the regular
+   * expression: `[a-zA-Z\\d-]+`. The maximum length is 100
+   * characters. Can be empty to allow the system to generate one.
+   * 
+ * + * string stored_info_type_id = 3; + */ + com.google.protobuf.ByteString + getStoredInfoTypeIdBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoType.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoType.java index e335387f8565..8eed31fa81c7 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoType.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoType.java @@ -104,6 +104,20 @@ private CustomInfoType( typeCase_ = 4; break; } + case 42: { + com.google.privacy.dlp.v2.StoredType.Builder subBuilder = null; + if (typeCase_ == 5) { + subBuilder = ((com.google.privacy.dlp.v2.StoredType) type_).toBuilder(); + } + type_ = + input.readMessage(com.google.privacy.dlp.v2.StoredType.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.privacy.dlp.v2.StoredType) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 5; + break; + } case 48: { int rawValue = input.readEnum(); @@ -111,9 +125,9 @@ private CustomInfoType( break; } case 58: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { detectionRules_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; + mutable_bitField0_ |= 0x00000040; } detectionRules_.add( input.readMessage(com.google.privacy.dlp.v2.CustomInfoType.DetectionRule.parser(), extensionRegistry)); @@ -134,7 +148,7 @@ private CustomInfoType( throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { detectionRules_ = java.util.Collections.unmodifiableList(detectionRules_); } this.unknownFields = unknownFields.build(); @@ -231,7 +245,11 @@ public interface DictionaryOrBuilder extends * matches for "jennifer". * Dictionary words containing a large number of characters that are not * letters or digits may result in unexpected findings because such characters - * are treated as whitespace. + * are treated as whitespace. The + * [limits](https://cloud.google.com/dlp/limits) page contains details about + * the size limits of dictionaries. For dictionaries that do not fit within + * these constraints, consider using `LargeCustomDictionaryConfig` in the + * `StoredInfoType` API. *
* * Protobuf type {@code google.privacy.dlp.v2.CustomInfoType.Dictionary} @@ -1367,7 +1385,11 @@ protected Builder newBuilderForType( * matches for "jennifer". * Dictionary words containing a large number of characters that are not * letters or digits may result in unexpected findings because such characters - * are treated as whitespace. + * are treated as whitespace. The + * [limits](https://cloud.google.com/dlp/limits) page contains details about + * the size limits of dictionaries. For dictionaries that do not fit within + * these constraints, consider using `LargeCustomDictionaryConfig` in the + * `StoredInfoType` API. * * * Protobuf type {@code google.privacy.dlp.v2.CustomInfoType.Dictionary} @@ -6424,6 +6446,7 @@ public enum TypeCase DICTIONARY(2), REGEX(3), SURROGATE_TYPE(4), + STORED_TYPE(5), TYPE_NOT_SET(0); private final int value; private TypeCase(int value) { @@ -6442,6 +6465,7 @@ public static TypeCase forNumber(int value) { case 2: return DICTIONARY; case 3: return REGEX; case 4: return SURROGATE_TYPE; + case 5: return STORED_TYPE; case 0: return TYPE_NOT_SET; default: return null; } @@ -6639,6 +6663,47 @@ public com.google.privacy.dlp.v2.CustomInfoType.SurrogateTypeOrBuilder getSurrog return com.google.privacy.dlp.v2.CustomInfoType.SurrogateType.getDefaultInstance(); } + public static final int STORED_TYPE_FIELD_NUMBER = 5; + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public boolean hasStoredType() { + return typeCase_ == 5; + } + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public com.google.privacy.dlp.v2.StoredType getStoredType() { + if (typeCase_ == 5) { + return (com.google.privacy.dlp.v2.StoredType) type_; + } + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public com.google.privacy.dlp.v2.StoredTypeOrBuilder getStoredTypeOrBuilder() { + if (typeCase_ == 5) { + return (com.google.privacy.dlp.v2.StoredType) type_; + } + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + public static final int DETECTION_RULES_FIELD_NUMBER = 7; private java.util.List detectionRules_; /** @@ -6730,6 +6795,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (typeCase_ == 4) { output.writeMessage(4, (com.google.privacy.dlp.v2.CustomInfoType.SurrogateType) type_); } + if (typeCase_ == 5) { + output.writeMessage(5, (com.google.privacy.dlp.v2.StoredType) type_); + } if (likelihood_ != com.google.privacy.dlp.v2.Likelihood.LIKELIHOOD_UNSPECIFIED.getNumber()) { output.writeEnum(6, likelihood_); } @@ -6761,6 +6829,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(4, (com.google.privacy.dlp.v2.CustomInfoType.SurrogateType) type_); } + if (typeCase_ == 5) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, (com.google.privacy.dlp.v2.StoredType) type_); + } if (likelihood_ != com.google.privacy.dlp.v2.Likelihood.LIKELIHOOD_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(6, likelihood_); @@ -6809,6 +6881,10 @@ public boolean equals(final java.lang.Object obj) { result = result && getSurrogateType() .equals(other.getSurrogateType()); break; + case 5: + result = result && getStoredType() + .equals(other.getStoredType()); + break; case 0: default: } @@ -6846,6 +6922,10 @@ public int hashCode() { hash = (37 * hash) + SURROGATE_TYPE_FIELD_NUMBER; hash = (53 * hash) + getSurrogateType().hashCode(); break; + case 5: + hash = (37 * hash) + STORED_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getStoredType().hashCode(); + break; case 0: default: } @@ -6998,7 +7078,7 @@ public Builder clear() { if (detectionRulesBuilder_ == null) { detectionRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); } else { detectionRulesBuilder_.clear(); } @@ -7059,10 +7139,17 @@ public com.google.privacy.dlp.v2.CustomInfoType buildPartial() { result.type_ = surrogateTypeBuilder_.build(); } } + if (typeCase_ == 5) { + if (storedTypeBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = storedTypeBuilder_.build(); + } + } if (detectionRulesBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000040) == 0x00000040)) { detectionRules_ = java.util.Collections.unmodifiableList(detectionRules_); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); } result.detectionRules_ = detectionRules_; } else { @@ -7128,7 +7215,7 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.CustomInfoType other) { if (!other.detectionRules_.isEmpty()) { if (detectionRules_.isEmpty()) { detectionRules_ = other.detectionRules_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); } else { ensureDetectionRulesIsMutable(); detectionRules_.addAll(other.detectionRules_); @@ -7141,7 +7228,7 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.CustomInfoType other) { detectionRulesBuilder_.dispose(); detectionRulesBuilder_ = null; detectionRules_ = other.detectionRules_; - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); detectionRulesBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getDetectionRulesFieldBuilder() : null; @@ -7163,6 +7250,10 @@ public Builder mergeFrom(com.google.privacy.dlp.v2.CustomInfoType other) { mergeSurrogateType(other.getSurrogateType()); break; } + case STORED_TYPE: { + mergeStoredType(other.getStoredType()); + break; + } case TYPE_NOT_SET: { break; } @@ -7974,12 +8065,193 @@ public com.google.privacy.dlp.v2.CustomInfoType.SurrogateTypeOrBuilder getSurrog return surrogateTypeBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredType, com.google.privacy.dlp.v2.StoredType.Builder, com.google.privacy.dlp.v2.StoredTypeOrBuilder> storedTypeBuilder_; + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public boolean hasStoredType() { + return typeCase_ == 5; + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public com.google.privacy.dlp.v2.StoredType getStoredType() { + if (storedTypeBuilder_ == null) { + if (typeCase_ == 5) { + return (com.google.privacy.dlp.v2.StoredType) type_; + } + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } else { + if (typeCase_ == 5) { + return storedTypeBuilder_.getMessage(); + } + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public Builder setStoredType(com.google.privacy.dlp.v2.StoredType value) { + if (storedTypeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + storedTypeBuilder_.setMessage(value); + } + typeCase_ = 5; + return this; + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public Builder setStoredType( + com.google.privacy.dlp.v2.StoredType.Builder builderForValue) { + if (storedTypeBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + storedTypeBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 5; + return this; + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public Builder mergeStoredType(com.google.privacy.dlp.v2.StoredType value) { + if (storedTypeBuilder_ == null) { + if (typeCase_ == 5 && + type_ != com.google.privacy.dlp.v2.StoredType.getDefaultInstance()) { + type_ = com.google.privacy.dlp.v2.StoredType.newBuilder((com.google.privacy.dlp.v2.StoredType) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 5) { + storedTypeBuilder_.mergeFrom(value); + } + storedTypeBuilder_.setMessage(value); + } + typeCase_ = 5; + return this; + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public Builder clearStoredType() { + if (storedTypeBuilder_ == null) { + if (typeCase_ == 5) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 5) { + typeCase_ = 0; + type_ = null; + } + storedTypeBuilder_.clear(); + } + return this; + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public com.google.privacy.dlp.v2.StoredType.Builder getStoredTypeBuilder() { + return getStoredTypeFieldBuilder().getBuilder(); + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + public com.google.privacy.dlp.v2.StoredTypeOrBuilder getStoredTypeOrBuilder() { + if ((typeCase_ == 5) && (storedTypeBuilder_ != null)) { + return storedTypeBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 5) { + return (com.google.privacy.dlp.v2.StoredType) type_; + } + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + } + /** + *
+     * Load an existing `StoredInfoType` resource for use in
+     * `InspectDataSource`. Not currently supported in `InspectContent`.
+     * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredType, com.google.privacy.dlp.v2.StoredType.Builder, com.google.privacy.dlp.v2.StoredTypeOrBuilder> + getStoredTypeFieldBuilder() { + if (storedTypeBuilder_ == null) { + if (!(typeCase_ == 5)) { + type_ = com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + storedTypeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredType, com.google.privacy.dlp.v2.StoredType.Builder, com.google.privacy.dlp.v2.StoredTypeOrBuilder>( + (com.google.privacy.dlp.v2.StoredType) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 5; + onChanged();; + return storedTypeBuilder_; + } + private java.util.List detectionRules_ = java.util.Collections.emptyList(); private void ensureDetectionRulesIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { detectionRules_ = new java.util.ArrayList(detectionRules_); - bitField0_ |= 0x00000020; + bitField0_ |= 0x00000040; } } @@ -8195,7 +8467,7 @@ public Builder addAllDetectionRules( public Builder clearDetectionRules() { if (detectionRulesBuilder_ == null) { detectionRules_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000040); onChanged(); } else { detectionRulesBuilder_.clear(); @@ -8314,7 +8586,7 @@ public com.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Builder addDetecti detectionRulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.privacy.dlp.v2.CustomInfoType.DetectionRule, com.google.privacy.dlp.v2.CustomInfoType.DetectionRule.Builder, com.google.privacy.dlp.v2.CustomInfoType.DetectionRuleOrBuilder>( detectionRules_, - ((bitField0_ & 0x00000020) == 0x00000020), + ((bitField0_ & 0x00000040) == 0x00000040), getParentForChildren(), isClean()); detectionRules_ = null; diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoTypeOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoTypeOrBuilder.java index 501f194b7141..28c2dd8ab722 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoTypeOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/CustomInfoTypeOrBuilder.java @@ -134,6 +134,34 @@ public interface CustomInfoTypeOrBuilder extends */ com.google.privacy.dlp.v2.CustomInfoType.SurrogateTypeOrBuilder getSurrogateTypeOrBuilder(); + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + boolean hasStoredType(); + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + com.google.privacy.dlp.v2.StoredType getStoredType(); + /** + *
+   * Load an existing `StoredInfoType` resource for use in
+   * `InspectDataSource`. Not currently supported in `InspectContent`.
+   * 
+ * + * .google.privacy.dlp.v2.StoredType stored_type = 5; + */ + com.google.privacy.dlp.v2.StoredTypeOrBuilder getStoredTypeOrBuilder(); + /** *
    * Set of detection rules to apply to all findings of this CustomInfoType.
diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequest.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequest.java
new file mode 100644
index 000000000000..d5ecc1c47754
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequest.java
@@ -0,0 +1,591 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/privacy/dlp/v2/dlp.proto
+
+package com.google.privacy.dlp.v2;
+
+/**
+ * 
+ * Request message for DeleteStoredInfoType.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} + */ +public final class DeleteStoredInfoTypeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + DeleteStoredInfoTypeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DeleteStoredInfoTypeRequest.newBuilder() to construct. + private DeleteStoredInfoTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteStoredInfoTypeRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteStoredInfoTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the organization and storedInfoType to be deleted, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of the organization and storedInfoType to be deleted, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest other = (com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for DeleteStoredInfoType.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.DeleteStoredInfoTypeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest build() { + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest buildPartial() { + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest result = new com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) { + return mergeFrom((com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest other) { + if (other == com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the organization and storedInfoType to be deleted, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of the organization and storedInfoType to be deleted, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of the organization and storedInfoType to be deleted, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of the organization and storedInfoType to be deleted, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the organization and storedInfoType to be deleted, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + private static final com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest(); + } + + public static com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteStoredInfoTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteStoredInfoTypeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.DeleteStoredInfoTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequestOrBuilder.java new file mode 100644 index 000000000000..027242d350c9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DeleteStoredInfoTypeRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface DeleteStoredInfoTypeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.DeleteStoredInfoTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the organization and storedInfoType to be deleted, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the organization and storedInfoType to be deleted, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpProto.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpProto.java index 7addf9ab6c97..8fdd3d5f8b96 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpProto.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpProto.java @@ -694,6 +694,56 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_privacy_dlp_v2_DeleteDeidentifyTemplateRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_StoredInfoType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -1287,133 +1337,198 @@ public static void registerAllExtensions( "ates\030\001 \003(\0132).google.privacy.dlp.v2.Deide" + "ntifyTemplate\022\027\n\017next_page_token\030\002 \001(\t\"/" + "\n\037DeleteDeidentifyTemplateRequest\022\014\n\004nam" + - "e\030\001 \001(\t*M\n\rContentOption\022\027\n\023CONTENT_UNSP" + - "ECIFIED\020\000\022\020\n\014CONTENT_TEXT\020\001\022\021\n\rCONTENT_I" + - "MAGE\020\002*P\n\023InfoTypeSupportedBy\022\031\n\025ENUM_TY" + - "PE_UNSPECIFIED\020\000\022\013\n\007INSPECT\020\001\022\021\n\rRISK_AN" + - "ALYSIS\020\002*\273\001\n\022RelationalOperator\022#\n\037RELAT" + - "IONAL_OPERATOR_UNSPECIFIED\020\000\022\014\n\010EQUAL_TO" + - "\020\001\022\020\n\014NOT_EQUAL_TO\020\002\022\020\n\014GREATER_THAN\020\003\022\r" + - "\n\tLESS_THAN\020\004\022\032\n\026GREATER_THAN_OR_EQUALS\020" + - "\005\022\027\n\023LESS_THAN_OR_EQUALS\020\006\022\n\n\006EXISTS\020\007*R" + - "\n\nDlpJobType\022\034\n\030DLP_JOB_TYPE_UNSPECIFIED" + - "\020\000\022\017\n\013INSPECT_JOB\020\001\022\025\n\021RISK_ANALYSIS_JOB" + - "\020\0022\376\"\n\nDlpService\022\241\001\n\016InspectContent\022,.g" + - "oogle.privacy.dlp.v2.InspectContentReque" + - "st\032-.google.privacy.dlp.v2.InspectConten" + - "tResponse\"2\202\323\344\223\002,\"\'/v2/{parent=projects/" + - "*}/content:inspect:\001*\022\225\001\n\013RedactImage\022)." + - "google.privacy.dlp.v2.RedactImageRequest" + - "\032*.google.privacy.dlp.v2.RedactImageResp" + - "onse\"/\202\323\344\223\002)\"$/v2/{parent=projects/*}/im" + - "age:redact:\001*\022\255\001\n\021DeidentifyContent\022/.go" + - "ogle.privacy.dlp.v2.DeidentifyContentReq" + - "uest\0320.google.privacy.dlp.v2.DeidentifyC" + - "ontentResponse\"5\202\323\344\223\002/\"*/v2/{parent=proj" + - "ects/*}/content:deidentify:\001*\022\255\001\n\021Reiden" + - "tifyContent\022/.google.privacy.dlp.v2.Reid" + - "entifyContentRequest\0320.google.privacy.dl" + - "p.v2.ReidentifyContentResponse\"5\202\323\344\223\002/\"*" + - "/v2/{parent=projects/*}/content:reidenti" + - "fy:\001*\022\201\001\n\rListInfoTypes\022+.google.privacy" + - ".dlp.v2.ListInfoTypesRequest\032,.google.pr" + - "ivacy.dlp.v2.ListInfoTypesResponse\"\025\202\323\344\223" + - "\002\017\022\r/v2/infoTypes\022\335\001\n\025CreateInspectTempl" + - "ate\0223.google.privacy.dlp.v2.CreateInspec" + - "tTemplateRequest\032&.google.privacy.dlp.v2" + - ".InspectTemplate\"g\202\323\344\223\002a\"-/v2/{parent=or" + - "ganizations/*}/inspectTemplates:\001*Z-\"(/v" + - "2/{parent=projects/*}/inspectTemplates:\001" + - "*\022\335\001\n\025UpdateInspectTemplate\0223.google.pri" + - "vacy.dlp.v2.UpdateInspectTemplateRequest" + - "\032&.google.privacy.dlp.v2.InspectTemplate" + - "\"g\202\323\344\223\002a2-/v2/{name=organizations/*/insp" + - "ectTemplates/*}:\001*Z-2(/v2/{name=projects" + - "/*/inspectTemplates/*}:\001*\022\321\001\n\022GetInspect" + - "Template\0220.google.privacy.dlp.v2.GetInsp" + - "ectTemplateRequest\032&.google.privacy.dlp." + - "v2.InspectTemplate\"a\202\323\344\223\002[\022-/v2/{name=or" + - "ganizations/*/inspectTemplates/*}Z*\022(/v2" + - "/{name=projects/*/inspectTemplates/*}\022\342\001" + - "\n\024ListInspectTemplates\0222.google.privacy." + - "dlp.v2.ListInspectTemplatesRequest\0323.goo" + - "gle.privacy.dlp.v2.ListInspectTemplatesR" + - "esponse\"a\202\323\344\223\002[\022-/v2/{parent=organizatio" + - "ns/*}/inspectTemplatesZ*\022(/v2/{parent=pr" + - "ojects/*}/inspectTemplates\022\307\001\n\025DeleteIns" + - "pectTemplate\0223.google.privacy.dlp.v2.Del" + - "eteInspectTemplateRequest\032\026.google.proto" + - "buf.Empty\"a\202\323\344\223\002[*-/v2/{name=organizatio" + - "ns/*/inspectTemplates/*}Z**(/v2/{name=pr" + - "ojects/*/inspectTemplates/*}\022\354\001\n\030CreateD" + - "eidentifyTemplate\0226.google.privacy.dlp.v" + - "2.CreateDeidentifyTemplateRequest\032).goog" + - "le.privacy.dlp.v2.DeidentifyTemplate\"m\202\323" + - "\344\223\002g\"0/v2/{parent=organizations/*}/deide" + - "ntifyTemplates:\001*Z0\"+/v2/{parent=project" + - "s/*}/deidentifyTemplates:\001*\022\354\001\n\030UpdateDe" + - "identifyTemplate\0226.google.privacy.dlp.v2" + - ".UpdateDeidentifyTemplateRequest\032).googl" + - "e.privacy.dlp.v2.DeidentifyTemplate\"m\202\323\344" + - "\223\002g20/v2/{name=organizations/*/deidentif" + - "yTemplates/*}:\001*Z02+/v2/{name=projects/*" + - "/deidentifyTemplates/*}:\001*\022\340\001\n\025GetDeiden" + - "tifyTemplate\0223.google.privacy.dlp.v2.Get" + - "DeidentifyTemplateRequest\032).google.priva" + - "cy.dlp.v2.DeidentifyTemplate\"g\202\323\344\223\002a\0220/v" + - "2/{name=organizations/*/deidentifyTempla" + - "tes/*}Z-\022+/v2/{name=projects/*/deidentif" + - "yTemplates/*}\022\361\001\n\027ListDeidentifyTemplate" + - "s\0225.google.privacy.dlp.v2.ListDeidentify" + - "TemplatesRequest\0326.google.privacy.dlp.v2" + - ".ListDeidentifyTemplatesResponse\"g\202\323\344\223\002a" + - "\0220/v2/{parent=organizations/*}/deidentif" + - "yTemplatesZ-\022+/v2/{parent=projects/*}/de" + - "identifyTemplates\022\323\001\n\030DeleteDeidentifyTe" + - "mplate\0226.google.privacy.dlp.v2.DeleteDei" + - "dentifyTemplateRequest\032\026.google.protobuf" + - ".Empty\"g\202\323\344\223\002a*0/v2/{name=organizations/" + - "*/deidentifyTemplates/*}Z-*+/v2/{name=pr" + - "ojects/*/deidentifyTemplates/*}\022\225\001\n\020Crea" + - "teJobTrigger\022..google.privacy.dlp.v2.Cre" + - "ateJobTriggerRequest\032!.google.privacy.dl" + - "p.v2.JobTrigger\".\202\323\344\223\002(\"#/v2/{parent=pro" + - "jects/*}/jobTriggers:\001*\022\225\001\n\020UpdateJobTri" + - "gger\022..google.privacy.dlp.v2.UpdateJobTr" + - "iggerRequest\032!.google.privacy.dlp.v2.Job" + - "Trigger\".\202\323\344\223\002(2#/v2/{name=projects/*/jo" + - "bTriggers/*}:\001*\022\214\001\n\rGetJobTrigger\022+.goog" + - "le.privacy.dlp.v2.GetJobTriggerRequest\032!" + - ".google.privacy.dlp.v2.JobTrigger\"+\202\323\344\223\002" + - "%\022#/v2/{name=projects/*/jobTriggers/*}\022\235" + - "\001\n\017ListJobTriggers\022-.google.privacy.dlp." + - "v2.ListJobTriggersRequest\032..google.priva" + - "cy.dlp.v2.ListJobTriggersResponse\"+\202\323\344\223\002" + - "%\022#/v2/{parent=projects/*}/jobTriggers\022\207" + - "\001\n\020DeleteJobTrigger\022..google.privacy.dlp" + - ".v2.DeleteJobTriggerRequest\032\026.google.pro" + - "tobuf.Empty\"+\202\323\344\223\002%*#/v2/{name=projects/" + - "*/jobTriggers/*}\022\205\001\n\014CreateDlpJob\022*.goog" + - "le.privacy.dlp.v2.CreateDlpJobRequest\032\035." + - "google.privacy.dlp.v2.DlpJob\"*\202\323\344\223\002$\"\037/v" + - "2/{parent=projects/*}/dlpJobs:\001*\022\215\001\n\013Lis" + - "tDlpJobs\022).google.privacy.dlp.v2.ListDlp" + - "JobsRequest\032*.google.privacy.dlp.v2.List" + - "DlpJobsResponse\"\'\202\323\344\223\002!\022\037/v2/{parent=pro" + - "jects/*}/dlpJobs\022|\n\tGetDlpJob\022\'.google.p" + - "rivacy.dlp.v2.GetDlpJobRequest\032\035.google." + - "privacy.dlp.v2.DlpJob\"\'\202\323\344\223\002!\022\037/v2/{name" + - "=projects/*/dlpJobs/*}\022{\n\014DeleteDlpJob\022*" + - ".google.privacy.dlp.v2.DeleteDlpJobReque" + - "st\032\026.google.protobuf.Empty\"\'\202\323\344\223\002!*\037/v2/" + - "{name=projects/*/dlpJobs/*}\022\205\001\n\014CancelDl" + - "pJob\022*.google.privacy.dlp.v2.CancelDlpJo" + - "bRequest\032\026.google.protobuf.Empty\"1\202\323\344\223\002+" + - "\"&/v2/{name=projects/*/dlpJobs/*}:cancel" + - ":\001*B\215\001\n\031com.google.privacy.dlp.v2B\010DlpPr" + - "otoP\001Z8google.golang.org/genproto/google" + - "apis/privacy/dlp/v2;dlp\252\002\023Google.Cloud.D" + - "lp.V2\312\002\023Google\\Cloud\\Dlp\\V2b\006proto3" + "e\030\001 \001(\t\"\364\001\n\033LargeCustomDictionaryConfig\022" + + "<\n\013output_path\030\001 \001(\0132\'.google.privacy.dl" + + "p.v2.CloudStoragePath\022L\n\026cloud_storage_f" + + "ile_set\030\002 \001(\0132*.google.privacy.dlp.v2.Cl" + + "oudStorageFileSetH\000\022?\n\017big_query_field\030\003" + + " \001(\0132$.google.privacy.dlp.v2.BigQueryFie" + + "ldH\000B\010\n\006source\"\240\001\n\024StoredInfoTypeConfig\022" + + "\024\n\014display_name\030\001 \001(\t\022\023\n\013description\030\002 \001" + + "(\t\022U\n\027large_custom_dictionary\030\003 \001(\01322.go" + + "ogle.privacy.dlp.v2.LargeCustomDictionar" + + "yConfigH\000B\006\n\004type\"\356\001\n\025StoredInfoTypeVers" + + "ion\022;\n\006config\030\001 \001(\0132+.google.privacy.dlp" + + ".v2.StoredInfoTypeConfig\022/\n\013create_time\030" + + "\002 \001(\0132\032.google.protobuf.Timestamp\0229\n\005sta" + + "te\030\003 \001(\0162*.google.privacy.dlp.v2.StoredI" + + "nfoTypeState\022,\n\006errors\030\004 \003(\0132\034.google.pr" + + "ivacy.dlp.v2.Error\"\255\001\n\016StoredInfoType\022\014\n" + + "\004name\030\001 \001(\t\022E\n\017current_version\030\002 \001(\0132,.g" + + "oogle.privacy.dlp.v2.StoredInfoTypeVersi" + + "on\022F\n\020pending_versions\030\003 \003(\0132,.google.pr" + + "ivacy.dlp.v2.StoredInfoTypeVersion\"\207\001\n\033C" + + "reateStoredInfoTypeRequest\022\016\n\006parent\030\001 \001" + + "(\t\022;\n\006config\030\002 \001(\0132+.google.privacy.dlp." + + "v2.StoredInfoTypeConfig\022\033\n\023stored_info_t" + + "ype_id\030\003 \001(\t\"\231\001\n\033UpdateStoredInfoTypeReq" + + "uest\022\014\n\004name\030\001 \001(\t\022;\n\006config\030\002 \001(\0132+.goo" + + "gle.privacy.dlp.v2.StoredInfoTypeConfig\022" + + "/\n\013update_mask\030\003 \001(\0132\032.google.protobuf.F" + + "ieldMask\"(\n\030GetStoredInfoTypeRequest\022\014\n\004" + + "name\030\001 \001(\t\"S\n\032ListStoredInfoTypesRequest" + + "\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t\022\021\n\t" + + "page_size\030\003 \001(\005\"x\n\033ListStoredInfoTypesRe" + + "sponse\022@\n\021stored_info_types\030\001 \003(\0132%.goog" + + "le.privacy.dlp.v2.StoredInfoType\022\027\n\017next" + + "_page_token\030\002 \001(\t\"+\n\033DeleteStoredInfoTyp" + + "eRequest\022\014\n\004name\030\001 \001(\t*M\n\rContentOption\022" + + "\027\n\023CONTENT_UNSPECIFIED\020\000\022\020\n\014CONTENT_TEXT" + + "\020\001\022\021\n\rCONTENT_IMAGE\020\002*P\n\023InfoTypeSupport" + + "edBy\022\031\n\025ENUM_TYPE_UNSPECIFIED\020\000\022\013\n\007INSPE" + + "CT\020\001\022\021\n\rRISK_ANALYSIS\020\002*\273\001\n\022RelationalOp" + + "erator\022#\n\037RELATIONAL_OPERATOR_UNSPECIFIE" + + "D\020\000\022\014\n\010EQUAL_TO\020\001\022\020\n\014NOT_EQUAL_TO\020\002\022\020\n\014G" + + "REATER_THAN\020\003\022\r\n\tLESS_THAN\020\004\022\032\n\026GREATER_" + + "THAN_OR_EQUALS\020\005\022\027\n\023LESS_THAN_OR_EQUALS\020" + + "\006\022\n\n\006EXISTS\020\007*R\n\nDlpJobType\022\034\n\030DLP_JOB_T" + + "YPE_UNSPECIFIED\020\000\022\017\n\013INSPECT_JOB\020\001\022\025\n\021RI" + + "SK_ANALYSIS_JOB\020\002*n\n\023StoredInfoTypeState" + + "\022&\n\"STORED_INFO_TYPE_STATE_UNSPECIFIED\020\000" + + "\022\013\n\007PENDING\020\001\022\t\n\005READY\020\002\022\n\n\006FAILED\020\003\022\013\n\007" + + "INVALID\020\0042\251+\n\nDlpService\022\241\001\n\016InspectCont" + + "ent\022,.google.privacy.dlp.v2.InspectConte" + + "ntRequest\032-.google.privacy.dlp.v2.Inspec" + + "tContentResponse\"2\202\323\344\223\002,\"\'/v2/{parent=pr" + + "ojects/*}/content:inspect:\001*\022\225\001\n\013RedactI" + + "mage\022).google.privacy.dlp.v2.RedactImage" + + "Request\032*.google.privacy.dlp.v2.RedactIm" + + "ageResponse\"/\202\323\344\223\002)\"$/v2/{parent=project" + + "s/*}/image:redact:\001*\022\255\001\n\021DeidentifyConte" + + "nt\022/.google.privacy.dlp.v2.DeidentifyCon" + + "tentRequest\0320.google.privacy.dlp.v2.Deid" + + "entifyContentResponse\"5\202\323\344\223\002/\"*/v2/{pare" + + "nt=projects/*}/content:deidentify:\001*\022\255\001\n" + + "\021ReidentifyContent\022/.google.privacy.dlp." + + "v2.ReidentifyContentRequest\0320.google.pri" + + "vacy.dlp.v2.ReidentifyContentResponse\"5\202" + + "\323\344\223\002/\"*/v2/{parent=projects/*}/content:r" + + "eidentify:\001*\022\201\001\n\rListInfoTypes\022+.google." + + "privacy.dlp.v2.ListInfoTypesRequest\032,.go" + + "ogle.privacy.dlp.v2.ListInfoTypesRespons" + + "e\"\025\202\323\344\223\002\017\022\r/v2/infoTypes\022\335\001\n\025CreateInspe" + + "ctTemplate\0223.google.privacy.dlp.v2.Creat" + + "eInspectTemplateRequest\032&.google.privacy" + + ".dlp.v2.InspectTemplate\"g\202\323\344\223\002a\"-/v2/{pa" + + "rent=organizations/*}/inspectTemplates:\001" + + "*Z-\"(/v2/{parent=projects/*}/inspectTemp" + + "lates:\001*\022\335\001\n\025UpdateInspectTemplate\0223.goo" + + "gle.privacy.dlp.v2.UpdateInspectTemplate" + + "Request\032&.google.privacy.dlp.v2.InspectT" + + "emplate\"g\202\323\344\223\002a2-/v2/{name=organizations" + + "/*/inspectTemplates/*}:\001*Z-2(/v2/{name=p" + + "rojects/*/inspectTemplates/*}:\001*\022\321\001\n\022Get" + + "InspectTemplate\0220.google.privacy.dlp.v2." + + "GetInspectTemplateRequest\032&.google.priva" + + "cy.dlp.v2.InspectTemplate\"a\202\323\344\223\002[\022-/v2/{" + + "name=organizations/*/inspectTemplates/*}" + + "Z*\022(/v2/{name=projects/*/inspectTemplate" + + "s/*}\022\342\001\n\024ListInspectTemplates\0222.google.p" + + "rivacy.dlp.v2.ListInspectTemplatesReques" + + "t\0323.google.privacy.dlp.v2.ListInspectTem" + + "platesResponse\"a\202\323\344\223\002[\022-/v2/{parent=orga" + + "nizations/*}/inspectTemplatesZ*\022(/v2/{pa" + + "rent=projects/*}/inspectTemplates\022\307\001\n\025De" + + "leteInspectTemplate\0223.google.privacy.dlp" + + ".v2.DeleteInspectTemplateRequest\032\026.googl" + + "e.protobuf.Empty\"a\202\323\344\223\002[*-/v2/{name=orga" + + "nizations/*/inspectTemplates/*}Z**(/v2/{" + + "name=projects/*/inspectTemplates/*}\022\354\001\n\030" + + "CreateDeidentifyTemplate\0226.google.privac" + + "y.dlp.v2.CreateDeidentifyTemplateRequest" + + "\032).google.privacy.dlp.v2.DeidentifyTempl" + + "ate\"m\202\323\344\223\002g\"0/v2/{parent=organizations/*" + + "}/deidentifyTemplates:\001*Z0\"+/v2/{parent=" + + "projects/*}/deidentifyTemplates:\001*\022\354\001\n\030U" + + "pdateDeidentifyTemplate\0226.google.privacy" + + ".dlp.v2.UpdateDeidentifyTemplateRequest\032" + + ").google.privacy.dlp.v2.DeidentifyTempla" + + "te\"m\202\323\344\223\002g20/v2/{name=organizations/*/de" + + "identifyTemplates/*}:\001*Z02+/v2/{name=pro" + + "jects/*/deidentifyTemplates/*}:\001*\022\340\001\n\025Ge" + + "tDeidentifyTemplate\0223.google.privacy.dlp" + + ".v2.GetDeidentifyTemplateRequest\032).googl" + + "e.privacy.dlp.v2.DeidentifyTemplate\"g\202\323\344" + + "\223\002a\0220/v2/{name=organizations/*/deidentif" + + "yTemplates/*}Z-\022+/v2/{name=projects/*/de" + + "identifyTemplates/*}\022\361\001\n\027ListDeidentifyT" + + "emplates\0225.google.privacy.dlp.v2.ListDei" + + "dentifyTemplatesRequest\0326.google.privacy" + + ".dlp.v2.ListDeidentifyTemplatesResponse\"" + + "g\202\323\344\223\002a\0220/v2/{parent=organizations/*}/de" + + "identifyTemplatesZ-\022+/v2/{parent=project" + + "s/*}/deidentifyTemplates\022\323\001\n\030DeleteDeide" + + "ntifyTemplate\0226.google.privacy.dlp.v2.De" + + "leteDeidentifyTemplateRequest\032\026.google.p" + + "rotobuf.Empty\"g\202\323\344\223\002a*0/v2/{name=organiz" + + "ations/*/deidentifyTemplates/*}Z-*+/v2/{" + + "name=projects/*/deidentifyTemplates/*}\022\225" + + "\001\n\020CreateJobTrigger\022..google.privacy.dlp" + + ".v2.CreateJobTriggerRequest\032!.google.pri" + + "vacy.dlp.v2.JobTrigger\".\202\323\344\223\002(\"#/v2/{par" + + "ent=projects/*}/jobTriggers:\001*\022\225\001\n\020Updat" + + "eJobTrigger\022..google.privacy.dlp.v2.Upda" + + "teJobTriggerRequest\032!.google.privacy.dlp" + + ".v2.JobTrigger\".\202\323\344\223\002(2#/v2/{name=projec" + + "ts/*/jobTriggers/*}:\001*\022\214\001\n\rGetJobTrigger" + + "\022+.google.privacy.dlp.v2.GetJobTriggerRe" + + "quest\032!.google.privacy.dlp.v2.JobTrigger" + + "\"+\202\323\344\223\002%\022#/v2/{name=projects/*/jobTrigge" + + "rs/*}\022\235\001\n\017ListJobTriggers\022-.google.priva" + + "cy.dlp.v2.ListJobTriggersRequest\032..googl" + + "e.privacy.dlp.v2.ListJobTriggersResponse" + + "\"+\202\323\344\223\002%\022#/v2/{parent=projects/*}/jobTri" + + "ggers\022\207\001\n\020DeleteJobTrigger\022..google.priv" + + "acy.dlp.v2.DeleteJobTriggerRequest\032\026.goo" + + "gle.protobuf.Empty\"+\202\323\344\223\002%*#/v2/{name=pr" + + "ojects/*/jobTriggers/*}\022\205\001\n\014CreateDlpJob" + + "\022*.google.privacy.dlp.v2.CreateDlpJobReq" + + "uest\032\035.google.privacy.dlp.v2.DlpJob\"*\202\323\344" + + "\223\002$\"\037/v2/{parent=projects/*}/dlpJobs:\001*\022" + + "\215\001\n\013ListDlpJobs\022).google.privacy.dlp.v2." + + "ListDlpJobsRequest\032*.google.privacy.dlp." + + "v2.ListDlpJobsResponse\"\'\202\323\344\223\002!\022\037/v2/{par" + + "ent=projects/*}/dlpJobs\022|\n\tGetDlpJob\022\'.g" + + "oogle.privacy.dlp.v2.GetDlpJobRequest\032\035." + + "google.privacy.dlp.v2.DlpJob\"\'\202\323\344\223\002!\022\037/v" + + "2/{name=projects/*/dlpJobs/*}\022{\n\014DeleteD" + + "lpJob\022*.google.privacy.dlp.v2.DeleteDlpJ" + + "obRequest\032\026.google.protobuf.Empty\"\'\202\323\344\223\002" + + "!*\037/v2/{name=projects/*/dlpJobs/*}\022\205\001\n\014C" + + "ancelDlpJob\022*.google.privacy.dlp.v2.Canc" + + "elDlpJobRequest\032\026.google.protobuf.Empty\"" + + "1\202\323\344\223\002+\"&/v2/{name=projects/*/dlpJobs/*}" + + ":cancel:\001*\022\330\001\n\024CreateStoredInfoType\0222.go" + + "ogle.privacy.dlp.v2.CreateStoredInfoType" + + "Request\032%.google.privacy.dlp.v2.StoredIn" + + "foType\"e\202\323\344\223\002_\",/v2/{parent=organization" + + "s/*}/storedInfoTypes:\001*Z,\"\'/v2/{parent=p" + + "rojects/*}/storedInfoTypes:\001*\022\330\001\n\024Update" + + "StoredInfoType\0222.google.privacy.dlp.v2.U" + + "pdateStoredInfoTypeRequest\032%.google.priv" + + "acy.dlp.v2.StoredInfoType\"e\202\323\344\223\002_2,/v2/{" + + "name=organizations/*/storedInfoTypes/*}:" + + "\001*Z,2\'/v2/{name=projects/*/storedInfoTyp" + + "es/*}:\001*\022\314\001\n\021GetStoredInfoType\022/.google." + + "privacy.dlp.v2.GetStoredInfoTypeRequest\032" + + "%.google.privacy.dlp.v2.StoredInfoType\"_" + + "\202\323\344\223\002Y\022,/v2/{name=organizations/*/stored" + + "InfoTypes/*}Z)\022\'/v2/{name=projects/*/sto" + + "redInfoTypes/*}\022\335\001\n\023ListStoredInfoTypes\022" + + "1.google.privacy.dlp.v2.ListStoredInfoTy" + + "pesRequest\0322.google.privacy.dlp.v2.ListS" + + "toredInfoTypesResponse\"_\202\323\344\223\002Y\022,/v2/{par" + + "ent=organizations/*}/storedInfoTypesZ)\022\'" + + "/v2/{parent=projects/*}/storedInfoTypes\022" + + "\303\001\n\024DeleteStoredInfoType\0222.google.privac" + + "y.dlp.v2.DeleteStoredInfoTypeRequest\032\026.g" + + "oogle.protobuf.Empty\"_\202\323\344\223\002Y*,/v2/{name=" + + "organizations/*/storedInfoTypes/*}Z)*\'/v" + + "2/{name=projects/*/storedInfoTypes/*}B\215\001" + + "\n\031com.google.privacy.dlp.v2B\010DlpProtoP\001Z" + + "8google.golang.org/genproto/googleapis/p" + + "rivacy/dlp/v2;dlp\252\002\023Google.Cloud.Dlp.V2\312" + + "\002\023Google\\Cloud\\Dlp\\V2b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -2253,6 +2368,66 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_DeleteDeidentifyTemplateRequest_descriptor, new java.lang.String[] { "Name", }); + internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor = + getDescriptor().getMessageTypes().get(94); + internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor, + new java.lang.String[] { "OutputPath", "CloudStorageFileSet", "BigQueryField", "Source", }); + internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor = + getDescriptor().getMessageTypes().get(95); + internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor, + new java.lang.String[] { "DisplayName", "Description", "LargeCustomDictionary", "Type", }); + internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor = + getDescriptor().getMessageTypes().get(96); + internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor, + new java.lang.String[] { "Config", "CreateTime", "State", "Errors", }); + internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor = + getDescriptor().getMessageTypes().get(97); + internal_static_google_privacy_dlp_v2_StoredInfoType_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor, + new java.lang.String[] { "Name", "CurrentVersion", "PendingVersions", }); + internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(98); + internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_CreateStoredInfoTypeRequest_descriptor, + new java.lang.String[] { "Parent", "Config", "StoredInfoTypeId", }); + internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(99); + internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor, + new java.lang.String[] { "Name", "Config", "UpdateMask", }); + internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(100); + internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor, + new java.lang.String[] { "Name", }); + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor = + getDescriptor().getMessageTypes().get(101); + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor, + new java.lang.String[] { "Parent", "PageToken", "PageSize", }); + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor = + getDescriptor().getMessageTypes().get(102); + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor, + new java.lang.String[] { "StoredInfoTypes", "NextPageToken", }); + internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor = + getDescriptor().getMessageTypes().get(103); + internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_DeleteStoredInfoTypeRequest_descriptor, + new java.lang.String[] { "Name", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.AnnotationsProto.http); diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpStorage.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpStorage.java index c1f1d9849930..c0f6eb2b4118 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpStorage.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/DlpStorage.java @@ -19,6 +19,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_privacy_dlp_v2_InfoType_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_StoredType_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_StoredType_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_privacy_dlp_v2_CustomInfoType_descriptor; static final @@ -94,6 +99,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_privacy_dlp_v2_CloudStorageOptions_FileSet_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_CloudStorageFileSet_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_privacy_dlp_v2_CloudStoragePath_descriptor; static final @@ -144,6 +154,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_privacy_dlp_v2_BigQueryTable_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_privacy_dlp_v2_BigQueryField_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_privacy_dlp_v2_BigQueryField_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_privacy_dlp_v2_EntityId_descriptor; static final @@ -161,101 +176,110 @@ public static void registerAllExtensions( "\n#google/privacy/dlp/v2/storage.proto\022\025g" + "oogle.privacy.dlp.v2\032\034google/api/annotat" + "ions.proto\032\037google/protobuf/timestamp.pr" + - "oto\"\030\n\010InfoType\022\014\n\004name\030\001 \001(\t\"\335\t\n\016Custom" + - "InfoType\0222\n\tinfo_type\030\001 \001(\0132\037.google.pri" + - "vacy.dlp.v2.InfoType\0225\n\nlikelihood\030\006 \001(\016" + - "2!.google.privacy.dlp.v2.Likelihood\022F\n\nd" + - "ictionary\030\002 \001(\01320.google.privacy.dlp.v2." + - "CustomInfoType.DictionaryH\000\022<\n\005regex\030\003 \001" + - "(\0132+.google.privacy.dlp.v2.CustomInfoTyp" + - "e.RegexH\000\022M\n\016surrogate_type\030\004 \001(\01323.goog" + - "le.privacy.dlp.v2.CustomInfoType.Surroga" + - "teTypeH\000\022L\n\017detection_rules\030\007 \003(\01323.goog" + - "le.privacy.dlp.v2.CustomInfoType.Detecti" + - "onRule\032\310\001\n\nDictionary\022N\n\tword_list\030\001 \001(\013" + - "29.google.privacy.dlp.v2.CustomInfoType." + - "Dictionary.WordListH\000\022E\n\022cloud_storage_p" + - "ath\030\003 \001(\0132\'.google.privacy.dlp.v2.CloudS" + - "toragePathH\000\032\031\n\010WordList\022\r\n\005words\030\001 \003(\tB" + - "\010\n\006source\032\030\n\005Regex\022\017\n\007pattern\030\001 \001(\t\032\017\n\rS" + - "urrogateType\032\276\004\n\rDetectionRule\022W\n\014hotwor" + - "d_rule\030\001 \001(\0132?.google.privacy.dlp.v2.Cus" + - "tomInfoType.DetectionRule.HotwordRuleH\000\032" + - "8\n\tProximity\022\025\n\rwindow_before\030\001 \001(\005\022\024\n\014w" + - "indow_after\030\002 \001(\005\032\202\001\n\024LikelihoodAdjustme" + - "nt\022=\n\020fixed_likelihood\030\001 \001(\0162!.google.pr" + - "ivacy.dlp.v2.LikelihoodH\000\022\035\n\023relative_li" + - "kelihood\030\002 \001(\005H\000B\014\n\nadjustment\032\214\002\n\013Hotwo" + - "rdRule\022B\n\rhotword_regex\030\001 \001(\0132+.google.p" + - "rivacy.dlp.v2.CustomInfoType.Regex\022P\n\tpr" + - "oximity\030\002 \001(\0132=.google.privacy.dlp.v2.Cu" + - "stomInfoType.DetectionRule.Proximity\022g\n\025" + - "likelihood_adjustment\030\003 \001(\0132H.google.pri" + + "oto\"\030\n\010InfoType\022\014\n\004name\030\001 \001(\t\"K\n\nStoredT" + + "ype\022\014\n\004name\030\001 \001(\t\022/\n\013create_time\030\002 \001(\0132\032" + + ".google.protobuf.Timestamp\"\227\n\n\016CustomInf" + + "oType\0222\n\tinfo_type\030\001 \001(\0132\037.google.privac" + + "y.dlp.v2.InfoType\0225\n\nlikelihood\030\006 \001(\0162!." + + "google.privacy.dlp.v2.Likelihood\022F\n\ndict" + + "ionary\030\002 \001(\01320.google.privacy.dlp.v2.Cus" + + "tomInfoType.DictionaryH\000\022<\n\005regex\030\003 \001(\0132" + + "+.google.privacy.dlp.v2.CustomInfoType.R" + + "egexH\000\022M\n\016surrogate_type\030\004 \001(\01323.google." + + "privacy.dlp.v2.CustomInfoType.SurrogateT" + + "ypeH\000\0228\n\013stored_type\030\005 \001(\0132!.google.priv" + + "acy.dlp.v2.StoredTypeH\000\022L\n\017detection_rul" + + "es\030\007 \003(\01323.google.privacy.dlp.v2.CustomI" + + "nfoType.DetectionRule\032\310\001\n\nDictionary\022N\n\t" + + "word_list\030\001 \001(\01329.google.privacy.dlp.v2." + + "CustomInfoType.Dictionary.WordListH\000\022E\n\022" + + "cloud_storage_path\030\003 \001(\0132\'.google.privac" + + "y.dlp.v2.CloudStoragePathH\000\032\031\n\010WordList\022" + + "\r\n\005words\030\001 \003(\tB\010\n\006source\032\030\n\005Regex\022\017\n\007pat" + + "tern\030\001 \001(\t\032\017\n\rSurrogateType\032\276\004\n\rDetectio" + + "nRule\022W\n\014hotword_rule\030\001 \001(\0132?.google.pri" + "vacy.dlp.v2.CustomInfoType.DetectionRule" + - ".LikelihoodAdjustmentB\006\n\004typeB\006\n\004type\"\027\n" + - "\007FieldId\022\014\n\004name\030\001 \001(\t\"7\n\013PartitionId\022\022\n" + - "\nproject_id\030\002 \001(\t\022\024\n\014namespace_id\030\004 \001(\t\"" + - "\036\n\016KindExpression\022\014\n\004name\030\001 \001(\t\"\201\001\n\020Data" + - "storeOptions\0228\n\014partition_id\030\001 \001(\0132\".goo" + - "gle.privacy.dlp.v2.PartitionId\0223\n\004kind\030\002" + - " \001(\0132%.google.privacy.dlp.v2.KindExpress" + - "ion\"\375\002\n\023CloudStorageOptions\022D\n\010file_set\030" + - "\001 \001(\01322.google.privacy.dlp.v2.CloudStora" + - "geOptions.FileSet\022\034\n\024bytes_limit_per_fil" + - "e\030\004 \001(\003\0223\n\nfile_types\030\005 \003(\0162\037.google.pri" + - "vacy.dlp.v2.FileType\022N\n\rsample_method\030\006 " + - "\001(\01627.google.privacy.dlp.v2.CloudStorage" + - "Options.SampleMethod\022\033\n\023files_limit_perc" + - "ent\030\007 \001(\005\032\026\n\007FileSet\022\013\n\003url\030\001 \001(\t\"H\n\014Sam" + - "pleMethod\022\035\n\031SAMPLE_METHOD_UNSPECIFIED\020\000" + - "\022\007\n\003TOP\020\001\022\020\n\014RANDOM_START\020\002\" \n\020CloudStor" + - "agePath\022\014\n\004path\030\001 \001(\t\"\266\002\n\017BigQueryOption" + - "s\022=\n\017table_reference\030\001 \001(\0132$.google.priv" + - "acy.dlp.v2.BigQueryTable\022:\n\022identifying_" + - "fields\030\002 \003(\0132\036.google.privacy.dlp.v2.Fie" + - "ldId\022\022\n\nrows_limit\030\003 \001(\003\022J\n\rsample_metho" + - "d\030\004 \001(\01623.google.privacy.dlp.v2.BigQuery" + - "Options.SampleMethod\"H\n\014SampleMethod\022\035\n\031" + - "SAMPLE_METHOD_UNSPECIFIED\020\000\022\007\n\003TOP\020\001\022\020\n\014" + - "RANDOM_START\020\002\"\232\004\n\rStorageConfig\022D\n\021data" + - "store_options\030\002 \001(\0132\'.google.privacy.dlp" + - ".v2.DatastoreOptionsH\000\022K\n\025cloud_storage_" + - "options\030\003 \001(\0132*.google.privacy.dlp.v2.Cl" + - "oudStorageOptionsH\000\022C\n\021big_query_options" + - "\030\004 \001(\0132&.google.privacy.dlp.v2.BigQueryO" + - "ptionsH\000\022L\n\017timespan_config\030\006 \001(\01323.goog" + - "le.privacy.dlp.v2.StorageConfig.Timespan" + - "Config\032\332\001\n\016TimespanConfig\022.\n\nstart_time\030" + - "\001 \001(\0132\032.google.protobuf.Timestamp\022,\n\010end" + - "_time\030\002 \001(\0132\032.google.protobuf.Timestamp\022" + - "7\n\017timestamp_field\030\003 \001(\0132\036.google.privac" + - "y.dlp.v2.FieldId\0221\n)enable_auto_populati" + - "on_of_timespan_config\030\004 \001(\010B\006\n\004type\"`\n\013B" + - "igQueryKey\022=\n\017table_reference\030\001 \001(\0132$.go" + - "ogle.privacy.dlp.v2.BigQueryTable\022\022\n\nrow" + - "_number\030\002 \001(\003\">\n\014DatastoreKey\022.\n\nentity_" + - "key\030\001 \001(\0132\032.google.privacy.dlp.v2.Key\"\273\001" + - "\n\003Key\0228\n\014partition_id\030\001 \001(\0132\".google.pri" + - "vacy.dlp.v2.PartitionId\0224\n\004path\030\002 \003(\0132&." + - "google.privacy.dlp.v2.Key.PathElement\032D\n" + - "\013PathElement\022\014\n\004kind\030\001 \001(\t\022\014\n\002id\030\002 \001(\003H\000" + - "\022\016\n\004name\030\003 \001(\tH\000B\t\n\007id_type\"\216\001\n\tRecordKe" + - "y\022<\n\rdatastore_key\030\002 \001(\0132#.google.privac" + - "y.dlp.v2.DatastoreKeyH\000\022;\n\rbig_query_key" + - "\030\003 \001(\0132\".google.privacy.dlp.v2.BigQueryK" + - "eyH\000B\006\n\004type\"I\n\rBigQueryTable\022\022\n\nproject" + - "_id\030\001 \001(\t\022\022\n\ndataset_id\030\002 \001(\t\022\020\n\010table_i" + - "d\030\003 \001(\t\"9\n\010EntityId\022-\n\005field\030\001 \001(\0132\036.goo" + - "gle.privacy.dlp.v2.FieldId*t\n\nLikelihood" + - "\022\032\n\026LIKELIHOOD_UNSPECIFIED\020\000\022\021\n\rVERY_UNL" + - "IKELY\020\001\022\014\n\010UNLIKELY\020\002\022\014\n\010POSSIBLE\020\003\022\n\n\006L" + - "IKELY\020\004\022\017\n\013VERY_LIKELY\020\005*E\n\010FileType\022\031\n\025" + - "FILE_TYPE_UNSPECIFIED\020\000\022\017\n\013BINARY_FILE\020\001" + - "\022\r\n\tTEXT_FILE\020\002B\217\001\n\031com.google.privacy.d" + - "lp.v2B\nDlpStorageP\001Z8google.golang.org/g" + - "enproto/googleapis/privacy/dlp/v2;dlp\252\002\023" + - "Google.Cloud.Dlp.V2\312\002\023Google\\Cloud\\Dlp\\V" + - "2b\006proto3" + ".HotwordRuleH\000\0328\n\tProximity\022\025\n\rwindow_be" + + "fore\030\001 \001(\005\022\024\n\014window_after\030\002 \001(\005\032\202\001\n\024Lik" + + "elihoodAdjustment\022=\n\020fixed_likelihood\030\001 " + + "\001(\0162!.google.privacy.dlp.v2.LikelihoodH\000" + + "\022\035\n\023relative_likelihood\030\002 \001(\005H\000B\014\n\nadjus" + + "tment\032\214\002\n\013HotwordRule\022B\n\rhotword_regex\030\001" + + " \001(\0132+.google.privacy.dlp.v2.CustomInfoT" + + "ype.Regex\022P\n\tproximity\030\002 \001(\0132=.google.pr" + + "ivacy.dlp.v2.CustomInfoType.DetectionRul" + + "e.Proximity\022g\n\025likelihood_adjustment\030\003 \001" + + "(\0132H.google.privacy.dlp.v2.CustomInfoTyp" + + "e.DetectionRule.LikelihoodAdjustmentB\006\n\004" + + "typeB\006\n\004type\"\027\n\007FieldId\022\014\n\004name\030\001 \001(\t\"7\n" + + "\013PartitionId\022\022\n\nproject_id\030\002 \001(\t\022\024\n\014name" + + "space_id\030\004 \001(\t\"\036\n\016KindExpression\022\014\n\004name" + + "\030\001 \001(\t\"\201\001\n\020DatastoreOptions\0228\n\014partition" + + "_id\030\001 \001(\0132\".google.privacy.dlp.v2.Partit" + + "ionId\0223\n\004kind\030\002 \001(\0132%.google.privacy.dlp" + + ".v2.KindExpression\"\243\003\n\023CloudStorageOptio" + + "ns\022D\n\010file_set\030\001 \001(\01322.google.privacy.dl" + + "p.v2.CloudStorageOptions.FileSet\022\034\n\024byte" + + "s_limit_per_file\030\004 \001(\003\022$\n\034bytes_limit_pe" + + "r_file_percent\030\010 \001(\005\0223\n\nfile_types\030\005 \003(\016" + + "2\037.google.privacy.dlp.v2.FileType\022N\n\rsam" + + "ple_method\030\006 \001(\01627.google.privacy.dlp.v2" + + ".CloudStorageOptions.SampleMethod\022\033\n\023fil" + + "es_limit_percent\030\007 \001(\005\032\026\n\007FileSet\022\013\n\003url" + + "\030\001 \001(\t\"H\n\014SampleMethod\022\035\n\031SAMPLE_METHOD_" + + "UNSPECIFIED\020\000\022\007\n\003TOP\020\001\022\020\n\014RANDOM_START\020\002" + + "\"\"\n\023CloudStorageFileSet\022\013\n\003url\030\001 \001(\t\" \n\020" + + "CloudStoragePath\022\014\n\004path\030\001 \001(\t\"\322\002\n\017BigQu" + + "eryOptions\022=\n\017table_reference\030\001 \001(\0132$.go" + + "ogle.privacy.dlp.v2.BigQueryTable\022:\n\022ide" + + "ntifying_fields\030\002 \003(\0132\036.google.privacy.d" + + "lp.v2.FieldId\022\022\n\nrows_limit\030\003 \001(\003\022\032\n\022row" + + "s_limit_percent\030\006 \001(\005\022J\n\rsample_method\030\004" + + " \001(\01623.google.privacy.dlp.v2.BigQueryOpt" + + "ions.SampleMethod\"H\n\014SampleMethod\022\035\n\031SAM" + + "PLE_METHOD_UNSPECIFIED\020\000\022\007\n\003TOP\020\001\022\020\n\014RAN" + + "DOM_START\020\002\"\232\004\n\rStorageConfig\022D\n\021datasto" + + "re_options\030\002 \001(\0132\'.google.privacy.dlp.v2" + + ".DatastoreOptionsH\000\022K\n\025cloud_storage_opt" + + "ions\030\003 \001(\0132*.google.privacy.dlp.v2.Cloud" + + "StorageOptionsH\000\022C\n\021big_query_options\030\004 " + + "\001(\0132&.google.privacy.dlp.v2.BigQueryOpti" + + "onsH\000\022L\n\017timespan_config\030\006 \001(\01323.google." + + "privacy.dlp.v2.StorageConfig.TimespanCon" + + "fig\032\332\001\n\016TimespanConfig\022.\n\nstart_time\030\001 \001" + + "(\0132\032.google.protobuf.Timestamp\022,\n\010end_ti" + + "me\030\002 \001(\0132\032.google.protobuf.Timestamp\0227\n\017" + + "timestamp_field\030\003 \001(\0132\036.google.privacy.d" + + "lp.v2.FieldId\0221\n)enable_auto_population_" + + "of_timespan_config\030\004 \001(\010B\006\n\004type\"`\n\013BigQ" + + "ueryKey\022=\n\017table_reference\030\001 \001(\0132$.googl" + + "e.privacy.dlp.v2.BigQueryTable\022\022\n\nrow_nu" + + "mber\030\002 \001(\003\">\n\014DatastoreKey\022.\n\nentity_key" + + "\030\001 \001(\0132\032.google.privacy.dlp.v2.Key\"\273\001\n\003K" + + "ey\0228\n\014partition_id\030\001 \001(\0132\".google.privac" + + "y.dlp.v2.PartitionId\0224\n\004path\030\002 \003(\0132&.goo" + + "gle.privacy.dlp.v2.Key.PathElement\032D\n\013Pa" + + "thElement\022\014\n\004kind\030\001 \001(\t\022\014\n\002id\030\002 \001(\003H\000\022\016\n" + + "\004name\030\003 \001(\tH\000B\t\n\007id_type\"\216\001\n\tRecordKey\022<" + + "\n\rdatastore_key\030\002 \001(\0132#.google.privacy.d" + + "lp.v2.DatastoreKeyH\000\022;\n\rbig_query_key\030\003 " + + "\001(\0132\".google.privacy.dlp.v2.BigQueryKeyH" + + "\000B\006\n\004type\"I\n\rBigQueryTable\022\022\n\nproject_id" + + "\030\001 \001(\t\022\022\n\ndataset_id\030\002 \001(\t\022\020\n\010table_id\030\003" + + " \001(\t\"s\n\rBigQueryField\0223\n\005table\030\001 \001(\0132$.g" + + "oogle.privacy.dlp.v2.BigQueryTable\022-\n\005fi" + + "eld\030\002 \001(\0132\036.google.privacy.dlp.v2.FieldI" + + "d\"9\n\010EntityId\022-\n\005field\030\001 \001(\0132\036.google.pr" + + "ivacy.dlp.v2.FieldId*t\n\nLikelihood\022\032\n\026LI" + + "KELIHOOD_UNSPECIFIED\020\000\022\021\n\rVERY_UNLIKELY\020" + + "\001\022\014\n\010UNLIKELY\020\002\022\014\n\010POSSIBLE\020\003\022\n\n\006LIKELY\020" + + "\004\022\017\n\013VERY_LIKELY\020\005*E\n\010FileType\022\031\n\025FILE_T" + + "YPE_UNSPECIFIED\020\000\022\017\n\013BINARY_FILE\020\001\022\r\n\tTE" + + "XT_FILE\020\002B\217\001\n\031com.google.privacy.dlp.v2B" + + "\nDlpStorageP\001Z8google.golang.org/genprot" + + "o/googleapis/privacy/dlp/v2;dlp\252\002\023Google" + + ".Cloud.Dlp.V2\312\002\023Google\\Cloud\\Dlp\\V2b\006pro" + + "to3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -277,12 +301,18 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_InfoType_descriptor, new java.lang.String[] { "Name", }); - internal_static_google_privacy_dlp_v2_CustomInfoType_descriptor = + internal_static_google_privacy_dlp_v2_StoredType_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_google_privacy_dlp_v2_StoredType_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_StoredType_descriptor, + new java.lang.String[] { "Name", "CreateTime", }); + internal_static_google_privacy_dlp_v2_CustomInfoType_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_google_privacy_dlp_v2_CustomInfoType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_CustomInfoType_descriptor, - new java.lang.String[] { "InfoType", "Likelihood", "Dictionary", "Regex", "SurrogateType", "DetectionRules", "Type", }); + new java.lang.String[] { "InfoType", "Likelihood", "Dictionary", "Regex", "SurrogateType", "StoredType", "DetectionRules", "Type", }); internal_static_google_privacy_dlp_v2_CustomInfoType_Dictionary_descriptor = internal_static_google_privacy_dlp_v2_CustomInfoType_descriptor.getNestedTypes().get(0); internal_static_google_privacy_dlp_v2_CustomInfoType_Dictionary_fieldAccessorTable = new @@ -332,55 +362,61 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_privacy_dlp_v2_CustomInfoType_DetectionRule_HotwordRule_descriptor, new java.lang.String[] { "HotwordRegex", "Proximity", "LikelihoodAdjustment", }); internal_static_google_privacy_dlp_v2_FieldId_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(3); internal_static_google_privacy_dlp_v2_FieldId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_FieldId_descriptor, new java.lang.String[] { "Name", }); internal_static_google_privacy_dlp_v2_PartitionId_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(4); internal_static_google_privacy_dlp_v2_PartitionId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_PartitionId_descriptor, new java.lang.String[] { "ProjectId", "NamespaceId", }); internal_static_google_privacy_dlp_v2_KindExpression_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_google_privacy_dlp_v2_KindExpression_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_KindExpression_descriptor, new java.lang.String[] { "Name", }); internal_static_google_privacy_dlp_v2_DatastoreOptions_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_privacy_dlp_v2_DatastoreOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_DatastoreOptions_descriptor, new java.lang.String[] { "PartitionId", "Kind", }); internal_static_google_privacy_dlp_v2_CloudStorageOptions_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_privacy_dlp_v2_CloudStorageOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_CloudStorageOptions_descriptor, - new java.lang.String[] { "FileSet", "BytesLimitPerFile", "FileTypes", "SampleMethod", "FilesLimitPercent", }); + new java.lang.String[] { "FileSet", "BytesLimitPerFile", "BytesLimitPerFilePercent", "FileTypes", "SampleMethod", "FilesLimitPercent", }); internal_static_google_privacy_dlp_v2_CloudStorageOptions_FileSet_descriptor = internal_static_google_privacy_dlp_v2_CloudStorageOptions_descriptor.getNestedTypes().get(0); internal_static_google_privacy_dlp_v2_CloudStorageOptions_FileSet_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_CloudStorageOptions_FileSet_descriptor, new java.lang.String[] { "Url", }); + internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_privacy_dlp_v2_CloudStorageFileSet_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_CloudStorageFileSet_descriptor, + new java.lang.String[] { "Url", }); internal_static_google_privacy_dlp_v2_CloudStoragePath_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(9); internal_static_google_privacy_dlp_v2_CloudStoragePath_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_CloudStoragePath_descriptor, new java.lang.String[] { "Path", }); internal_static_google_privacy_dlp_v2_BigQueryOptions_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_google_privacy_dlp_v2_BigQueryOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_BigQueryOptions_descriptor, - new java.lang.String[] { "TableReference", "IdentifyingFields", "RowsLimit", "SampleMethod", }); + new java.lang.String[] { "TableReference", "IdentifyingFields", "RowsLimit", "RowsLimitPercent", "SampleMethod", }); internal_static_google_privacy_dlp_v2_StorageConfig_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_google_privacy_dlp_v2_StorageConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_StorageConfig_descriptor, @@ -392,19 +428,19 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_privacy_dlp_v2_StorageConfig_TimespanConfig_descriptor, new java.lang.String[] { "StartTime", "EndTime", "TimestampField", "EnableAutoPopulationOfTimespanConfig", }); internal_static_google_privacy_dlp_v2_BigQueryKey_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_google_privacy_dlp_v2_BigQueryKey_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_BigQueryKey_descriptor, new java.lang.String[] { "TableReference", "RowNumber", }); internal_static_google_privacy_dlp_v2_DatastoreKey_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_privacy_dlp_v2_DatastoreKey_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_DatastoreKey_descriptor, new java.lang.String[] { "EntityKey", }); internal_static_google_privacy_dlp_v2_Key_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_google_privacy_dlp_v2_Key_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_Key_descriptor, @@ -416,19 +452,25 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_privacy_dlp_v2_Key_PathElement_descriptor, new java.lang.String[] { "Kind", "Id", "Name", "IdType", }); internal_static_google_privacy_dlp_v2_RecordKey_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_privacy_dlp_v2_RecordKey_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_RecordKey_descriptor, new java.lang.String[] { "DatastoreKey", "BigQueryKey", "Type", }); internal_static_google_privacy_dlp_v2_BigQueryTable_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_google_privacy_dlp_v2_BigQueryTable_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_BigQueryTable_descriptor, new java.lang.String[] { "ProjectId", "DatasetId", "TableId", }); + internal_static_google_privacy_dlp_v2_BigQueryField_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_google_privacy_dlp_v2_BigQueryField_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_privacy_dlp_v2_BigQueryField_descriptor, + new java.lang.String[] { "Table", "Field", }); internal_static_google_privacy_dlp_v2_EntityId_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(18); internal_static_google_privacy_dlp_v2_EntityId_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_privacy_dlp_v2_EntityId_descriptor, diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequest.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequest.java new file mode 100644 index 000000000000..dbd36178bdd6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequest.java @@ -0,0 +1,591 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Request message for GetStoredInfoType.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.GetStoredInfoTypeRequest} + */ +public final class GetStoredInfoTypeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.GetStoredInfoTypeRequest) + GetStoredInfoTypeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use GetStoredInfoTypeRequest.newBuilder() to construct. + private GetStoredInfoTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetStoredInfoTypeRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetStoredInfoTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the organization and storedInfoType to be read, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of the organization and storedInfoType to be read, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.GetStoredInfoTypeRequest)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest other = (com.google.privacy.dlp.v2.GetStoredInfoTypeRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for GetStoredInfoType.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.GetStoredInfoTypeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.GetStoredInfoTypeRequest) + com.google.privacy.dlp.v2.GetStoredInfoTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_GetStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.GetStoredInfoTypeRequest getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.GetStoredInfoTypeRequest build() { + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.GetStoredInfoTypeRequest buildPartial() { + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest result = new com.google.privacy.dlp.v2.GetStoredInfoTypeRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.GetStoredInfoTypeRequest) { + return mergeFrom((com.google.privacy.dlp.v2.GetStoredInfoTypeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.GetStoredInfoTypeRequest other) { + if (other == com.google.privacy.dlp.v2.GetStoredInfoTypeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.GetStoredInfoTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.GetStoredInfoTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the organization and storedInfoType to be read, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of the organization and storedInfoType to be read, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of the organization and storedInfoType to be read, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of the organization and storedInfoType to be read, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the organization and storedInfoType to be read, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.GetStoredInfoTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.GetStoredInfoTypeRequest) + private static final com.google.privacy.dlp.v2.GetStoredInfoTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.GetStoredInfoTypeRequest(); + } + + public static com.google.privacy.dlp.v2.GetStoredInfoTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStoredInfoTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetStoredInfoTypeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.GetStoredInfoTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequestOrBuilder.java new file mode 100644 index 000000000000..487a922d04ff --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/GetStoredInfoTypeRequestOrBuilder.java @@ -0,0 +1,31 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface GetStoredInfoTypeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.GetStoredInfoTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the organization and storedInfoType to be read, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the organization and storedInfoType to be read, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfig.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfig.java index c01e21ed6687..668efd358c54 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfig.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfig.java @@ -2069,6 +2069,10 @@ public com.google.privacy.dlp.v2.InspectConfig.FindingLimits getDefaultInstanceF * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. *
* * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2084,6 +2088,10 @@ public java.util.List getInfoTypesList() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2100,6 +2108,10 @@ public java.util.List getInfoTypesList() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2115,6 +2127,10 @@ public int getInfoTypesCount() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2130,6 +2146,10 @@ public com.google.privacy.dlp.v2.InfoType getInfoTypes(int index) { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2897,6 +2917,10 @@ private void ensureInfoTypesIsMutable() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2916,6 +2940,10 @@ public java.util.List getInfoTypesList() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2935,6 +2963,10 @@ public int getInfoTypesCount() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2954,6 +2986,10 @@ public com.google.privacy.dlp.v2.InfoType getInfoTypes(int index) { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -2980,6 +3016,10 @@ public Builder setInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3003,6 +3043,10 @@ public Builder setInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3028,6 +3072,10 @@ public Builder addInfoTypes(com.google.privacy.dlp.v2.InfoType value) { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3054,6 +3102,10 @@ public Builder addInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3077,6 +3129,10 @@ public Builder addInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3100,6 +3156,10 @@ public Builder addInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3124,6 +3184,10 @@ public Builder addAllInfoTypes( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3146,6 +3210,10 @@ public Builder clearInfoTypes() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3168,6 +3236,10 @@ public Builder removeInfoTypes(int index) { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3184,6 +3256,10 @@ public com.google.privacy.dlp.v2.InfoType.Builder getInfoTypesBuilder( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3203,6 +3279,10 @@ public com.google.privacy.dlp.v2.InfoTypeOrBuilder getInfoTypesOrBuilder( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3223,6 +3303,10 @@ public com.google.privacy.dlp.v2.InfoTypeOrBuilder getInfoTypesOrBuilder( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3239,6 +3323,10 @@ public com.google.privacy.dlp.v2.InfoType.Builder addInfoTypesBuilder() { * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -3256,6 +3344,10 @@ public com.google.privacy.dlp.v2.InfoType.Builder addInfoTypesBuilder( * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfigOrBuilder.java index 4cbfdd76de1b..36cf563cd270 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfigOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/InspectConfigOrBuilder.java @@ -15,6 +15,10 @@ public interface InspectConfigOrBuilder extends * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -29,6 +33,10 @@ public interface InspectConfigOrBuilder extends * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -42,6 +50,10 @@ public interface InspectConfigOrBuilder extends * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -55,6 +67,10 @@ public interface InspectConfigOrBuilder extends * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; @@ -69,6 +85,10 @@ public interface InspectConfigOrBuilder extends * When no InfoTypes or CustomInfoTypes are specified in a request, the * system may automatically choose what detectors to run. By default this may * be all types, but may change over time as detectors are updated. + * The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + * but may change over time as new InfoTypes are added. If you need precise + * control and predictability as to what detectors are run you should specify + * specific InfoTypes listed in the reference. * * * repeated .google.privacy.dlp.v2.InfoType info_types = 1; diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfig.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfig.java new file mode 100644 index 000000000000..58b8146a1c76 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfig.java @@ -0,0 +1,1269 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Configuration for a custom dictionary created from a data source of any size
+ * up to the maximum size defined in the
+ * [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
+ * dictionary creation are stored in the specified Google Cloud Storage
+ * location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
+ * that satisfy the size requirements.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.LargeCustomDictionaryConfig} + */ +public final class LargeCustomDictionaryConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.LargeCustomDictionaryConfig) + LargeCustomDictionaryConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use LargeCustomDictionaryConfig.newBuilder() to construct. + private LargeCustomDictionaryConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LargeCustomDictionaryConfig() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LargeCustomDictionaryConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.privacy.dlp.v2.CloudStoragePath.Builder subBuilder = null; + if (outputPath_ != null) { + subBuilder = outputPath_.toBuilder(); + } + outputPath_ = input.readMessage(com.google.privacy.dlp.v2.CloudStoragePath.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputPath_); + outputPath_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.privacy.dlp.v2.CloudStorageFileSet.Builder subBuilder = null; + if (sourceCase_ == 2) { + subBuilder = ((com.google.privacy.dlp.v2.CloudStorageFileSet) source_).toBuilder(); + } + source_ = + input.readMessage(com.google.privacy.dlp.v2.CloudStorageFileSet.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.privacy.dlp.v2.CloudStorageFileSet) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 2; + break; + } + case 26: { + com.google.privacy.dlp.v2.BigQueryField.Builder subBuilder = null; + if (sourceCase_ == 3) { + subBuilder = ((com.google.privacy.dlp.v2.BigQueryField) source_).toBuilder(); + } + source_ = + input.readMessage(com.google.privacy.dlp.v2.BigQueryField.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.privacy.dlp.v2.BigQueryField) source_); + source_ = subBuilder.buildPartial(); + } + sourceCase_ = 3; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.class, com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder.class); + } + + private int sourceCase_ = 0; + private java.lang.Object source_; + public enum SourceCase + implements com.google.protobuf.Internal.EnumLite { + CLOUD_STORAGE_FILE_SET(2), + BIG_QUERY_FIELD(3), + SOURCE_NOT_SET(0); + private final int value; + private SourceCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static SourceCase valueOf(int value) { + return forNumber(value); + } + + public static SourceCase forNumber(int value) { + switch (value) { + case 2: return CLOUD_STORAGE_FILE_SET; + case 3: return BIG_QUERY_FIELD; + case 0: return SOURCE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public SourceCase + getSourceCase() { + return SourceCase.forNumber( + sourceCase_); + } + + public static final int OUTPUT_PATH_FIELD_NUMBER = 1; + private com.google.privacy.dlp.v2.CloudStoragePath outputPath_; + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public boolean hasOutputPath() { + return outputPath_ != null; + } + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public com.google.privacy.dlp.v2.CloudStoragePath getOutputPath() { + return outputPath_ == null ? com.google.privacy.dlp.v2.CloudStoragePath.getDefaultInstance() : outputPath_; + } + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public com.google.privacy.dlp.v2.CloudStoragePathOrBuilder getOutputPathOrBuilder() { + return getOutputPath(); + } + + public static final int CLOUD_STORAGE_FILE_SET_FIELD_NUMBER = 2; + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public boolean hasCloudStorageFileSet() { + return sourceCase_ == 2; + } + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public com.google.privacy.dlp.v2.CloudStorageFileSet getCloudStorageFileSet() { + if (sourceCase_ == 2) { + return (com.google.privacy.dlp.v2.CloudStorageFileSet) source_; + } + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder getCloudStorageFileSetOrBuilder() { + if (sourceCase_ == 2) { + return (com.google.privacy.dlp.v2.CloudStorageFileSet) source_; + } + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + + public static final int BIG_QUERY_FIELD_FIELD_NUMBER = 3; + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public boolean hasBigQueryField() { + return sourceCase_ == 3; + } + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public com.google.privacy.dlp.v2.BigQueryField getBigQueryField() { + if (sourceCase_ == 3) { + return (com.google.privacy.dlp.v2.BigQueryField) source_; + } + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public com.google.privacy.dlp.v2.BigQueryFieldOrBuilder getBigQueryFieldOrBuilder() { + if (sourceCase_ == 3) { + return (com.google.privacy.dlp.v2.BigQueryField) source_; + } + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (outputPath_ != null) { + output.writeMessage(1, getOutputPath()); + } + if (sourceCase_ == 2) { + output.writeMessage(2, (com.google.privacy.dlp.v2.CloudStorageFileSet) source_); + } + if (sourceCase_ == 3) { + output.writeMessage(3, (com.google.privacy.dlp.v2.BigQueryField) source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (outputPath_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getOutputPath()); + } + if (sourceCase_ == 2) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, (com.google.privacy.dlp.v2.CloudStorageFileSet) source_); + } + if (sourceCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.privacy.dlp.v2.BigQueryField) source_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.LargeCustomDictionaryConfig)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig other = (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) obj; + + boolean result = true; + result = result && (hasOutputPath() == other.hasOutputPath()); + if (hasOutputPath()) { + result = result && getOutputPath() + .equals(other.getOutputPath()); + } + result = result && getSourceCase().equals( + other.getSourceCase()); + if (!result) return false; + switch (sourceCase_) { + case 2: + result = result && getCloudStorageFileSet() + .equals(other.getCloudStorageFileSet()); + break; + case 3: + result = result && getBigQueryField() + .equals(other.getBigQueryField()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasOutputPath()) { + hash = (37 * hash) + OUTPUT_PATH_FIELD_NUMBER; + hash = (53 * hash) + getOutputPath().hashCode(); + } + switch (sourceCase_) { + case 2: + hash = (37 * hash) + CLOUD_STORAGE_FILE_SET_FIELD_NUMBER; + hash = (53 * hash) + getCloudStorageFileSet().hashCode(); + break; + case 3: + hash = (37 * hash) + BIG_QUERY_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getBigQueryField().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.LargeCustomDictionaryConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Configuration for a custom dictionary created from a data source of any size
+   * up to the maximum size defined in the
+   * [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
+   * dictionary creation are stored in the specified Google Cloud Storage
+   * location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
+   * that satisfy the size requirements.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.LargeCustomDictionaryConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.LargeCustomDictionaryConfig) + com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.class, com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (outputPathBuilder_ == null) { + outputPath_ = null; + } else { + outputPath_ = null; + outputPathBuilder_ = null; + } + sourceCase_ = 0; + source_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_LargeCustomDictionaryConfig_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig build() { + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig buildPartial() { + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig result = new com.google.privacy.dlp.v2.LargeCustomDictionaryConfig(this); + if (outputPathBuilder_ == null) { + result.outputPath_ = outputPath_; + } else { + result.outputPath_ = outputPathBuilder_.build(); + } + if (sourceCase_ == 2) { + if (cloudStorageFileSetBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = cloudStorageFileSetBuilder_.build(); + } + } + if (sourceCase_ == 3) { + if (bigQueryFieldBuilder_ == null) { + result.source_ = source_; + } else { + result.source_ = bigQueryFieldBuilder_.build(); + } + } + result.sourceCase_ = sourceCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) { + return mergeFrom((com.google.privacy.dlp.v2.LargeCustomDictionaryConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.LargeCustomDictionaryConfig other) { + if (other == com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance()) return this; + if (other.hasOutputPath()) { + mergeOutputPath(other.getOutputPath()); + } + switch (other.getSourceCase()) { + case CLOUD_STORAGE_FILE_SET: { + mergeCloudStorageFileSet(other.getCloudStorageFileSet()); + break; + } + case BIG_QUERY_FIELD: { + mergeBigQueryField(other.getBigQueryField()); + break; + } + case SOURCE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int sourceCase_ = 0; + private java.lang.Object source_; + public SourceCase + getSourceCase() { + return SourceCase.forNumber( + sourceCase_); + } + + public Builder clearSource() { + sourceCase_ = 0; + source_ = null; + onChanged(); + return this; + } + + + private com.google.privacy.dlp.v2.CloudStoragePath outputPath_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStoragePath, com.google.privacy.dlp.v2.CloudStoragePath.Builder, com.google.privacy.dlp.v2.CloudStoragePathOrBuilder> outputPathBuilder_; + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public boolean hasOutputPath() { + return outputPathBuilder_ != null || outputPath_ != null; + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public com.google.privacy.dlp.v2.CloudStoragePath getOutputPath() { + if (outputPathBuilder_ == null) { + return outputPath_ == null ? com.google.privacy.dlp.v2.CloudStoragePath.getDefaultInstance() : outputPath_; + } else { + return outputPathBuilder_.getMessage(); + } + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public Builder setOutputPath(com.google.privacy.dlp.v2.CloudStoragePath value) { + if (outputPathBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputPath_ = value; + onChanged(); + } else { + outputPathBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public Builder setOutputPath( + com.google.privacy.dlp.v2.CloudStoragePath.Builder builderForValue) { + if (outputPathBuilder_ == null) { + outputPath_ = builderForValue.build(); + onChanged(); + } else { + outputPathBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public Builder mergeOutputPath(com.google.privacy.dlp.v2.CloudStoragePath value) { + if (outputPathBuilder_ == null) { + if (outputPath_ != null) { + outputPath_ = + com.google.privacy.dlp.v2.CloudStoragePath.newBuilder(outputPath_).mergeFrom(value).buildPartial(); + } else { + outputPath_ = value; + } + onChanged(); + } else { + outputPathBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public Builder clearOutputPath() { + if (outputPathBuilder_ == null) { + outputPath_ = null; + onChanged(); + } else { + outputPath_ = null; + outputPathBuilder_ = null; + } + + return this; + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public com.google.privacy.dlp.v2.CloudStoragePath.Builder getOutputPathBuilder() { + + onChanged(); + return getOutputPathFieldBuilder().getBuilder(); + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + public com.google.privacy.dlp.v2.CloudStoragePathOrBuilder getOutputPathOrBuilder() { + if (outputPathBuilder_ != null) { + return outputPathBuilder_.getMessageOrBuilder(); + } else { + return outputPath_ == null ? + com.google.privacy.dlp.v2.CloudStoragePath.getDefaultInstance() : outputPath_; + } + } + /** + *
+     * Location to store dictionary artifacts in Google Cloud Storage. These files
+     * will only be accessible by project owners and the DLP API. If any of these
+     * artifacts are modified, the dictionary is considered invalid and can no
+     * longer be used.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStoragePath, com.google.privacy.dlp.v2.CloudStoragePath.Builder, com.google.privacy.dlp.v2.CloudStoragePathOrBuilder> + getOutputPathFieldBuilder() { + if (outputPathBuilder_ == null) { + outputPathBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStoragePath, com.google.privacy.dlp.v2.CloudStoragePath.Builder, com.google.privacy.dlp.v2.CloudStoragePathOrBuilder>( + getOutputPath(), + getParentForChildren(), + isClean()); + outputPath_ = null; + } + return outputPathBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStorageFileSet, com.google.privacy.dlp.v2.CloudStorageFileSet.Builder, com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder> cloudStorageFileSetBuilder_; + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public boolean hasCloudStorageFileSet() { + return sourceCase_ == 2; + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public com.google.privacy.dlp.v2.CloudStorageFileSet getCloudStorageFileSet() { + if (cloudStorageFileSetBuilder_ == null) { + if (sourceCase_ == 2) { + return (com.google.privacy.dlp.v2.CloudStorageFileSet) source_; + } + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } else { + if (sourceCase_ == 2) { + return cloudStorageFileSetBuilder_.getMessage(); + } + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public Builder setCloudStorageFileSet(com.google.privacy.dlp.v2.CloudStorageFileSet value) { + if (cloudStorageFileSetBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + cloudStorageFileSetBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public Builder setCloudStorageFileSet( + com.google.privacy.dlp.v2.CloudStorageFileSet.Builder builderForValue) { + if (cloudStorageFileSetBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + cloudStorageFileSetBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 2; + return this; + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public Builder mergeCloudStorageFileSet(com.google.privacy.dlp.v2.CloudStorageFileSet value) { + if (cloudStorageFileSetBuilder_ == null) { + if (sourceCase_ == 2 && + source_ != com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance()) { + source_ = com.google.privacy.dlp.v2.CloudStorageFileSet.newBuilder((com.google.privacy.dlp.v2.CloudStorageFileSet) source_) + .mergeFrom(value).buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 2) { + cloudStorageFileSetBuilder_.mergeFrom(value); + } + cloudStorageFileSetBuilder_.setMessage(value); + } + sourceCase_ = 2; + return this; + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public Builder clearCloudStorageFileSet() { + if (cloudStorageFileSetBuilder_ == null) { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 2) { + sourceCase_ = 0; + source_ = null; + } + cloudStorageFileSetBuilder_.clear(); + } + return this; + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public com.google.privacy.dlp.v2.CloudStorageFileSet.Builder getCloudStorageFileSetBuilder() { + return getCloudStorageFileSetFieldBuilder().getBuilder(); + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + public com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder getCloudStorageFileSetOrBuilder() { + if ((sourceCase_ == 2) && (cloudStorageFileSetBuilder_ != null)) { + return cloudStorageFileSetBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 2) { + return (com.google.privacy.dlp.v2.CloudStorageFileSet) source_; + } + return com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + } + /** + *
+     * Set of files containing newline-delimited lists of dictionary phrases.
+     * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStorageFileSet, com.google.privacy.dlp.v2.CloudStorageFileSet.Builder, com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder> + getCloudStorageFileSetFieldBuilder() { + if (cloudStorageFileSetBuilder_ == null) { + if (!(sourceCase_ == 2)) { + source_ = com.google.privacy.dlp.v2.CloudStorageFileSet.getDefaultInstance(); + } + cloudStorageFileSetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.CloudStorageFileSet, com.google.privacy.dlp.v2.CloudStorageFileSet.Builder, com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder>( + (com.google.privacy.dlp.v2.CloudStorageFileSet) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 2; + onChanged();; + return cloudStorageFileSetBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryField, com.google.privacy.dlp.v2.BigQueryField.Builder, com.google.privacy.dlp.v2.BigQueryFieldOrBuilder> bigQueryFieldBuilder_; + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public boolean hasBigQueryField() { + return sourceCase_ == 3; + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public com.google.privacy.dlp.v2.BigQueryField getBigQueryField() { + if (bigQueryFieldBuilder_ == null) { + if (sourceCase_ == 3) { + return (com.google.privacy.dlp.v2.BigQueryField) source_; + } + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } else { + if (sourceCase_ == 3) { + return bigQueryFieldBuilder_.getMessage(); + } + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public Builder setBigQueryField(com.google.privacy.dlp.v2.BigQueryField value) { + if (bigQueryFieldBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + source_ = value; + onChanged(); + } else { + bigQueryFieldBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public Builder setBigQueryField( + com.google.privacy.dlp.v2.BigQueryField.Builder builderForValue) { + if (bigQueryFieldBuilder_ == null) { + source_ = builderForValue.build(); + onChanged(); + } else { + bigQueryFieldBuilder_.setMessage(builderForValue.build()); + } + sourceCase_ = 3; + return this; + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public Builder mergeBigQueryField(com.google.privacy.dlp.v2.BigQueryField value) { + if (bigQueryFieldBuilder_ == null) { + if (sourceCase_ == 3 && + source_ != com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance()) { + source_ = com.google.privacy.dlp.v2.BigQueryField.newBuilder((com.google.privacy.dlp.v2.BigQueryField) source_) + .mergeFrom(value).buildPartial(); + } else { + source_ = value; + } + onChanged(); + } else { + if (sourceCase_ == 3) { + bigQueryFieldBuilder_.mergeFrom(value); + } + bigQueryFieldBuilder_.setMessage(value); + } + sourceCase_ = 3; + return this; + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public Builder clearBigQueryField() { + if (bigQueryFieldBuilder_ == null) { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + onChanged(); + } + } else { + if (sourceCase_ == 3) { + sourceCase_ = 0; + source_ = null; + } + bigQueryFieldBuilder_.clear(); + } + return this; + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public com.google.privacy.dlp.v2.BigQueryField.Builder getBigQueryFieldBuilder() { + return getBigQueryFieldFieldBuilder().getBuilder(); + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + public com.google.privacy.dlp.v2.BigQueryFieldOrBuilder getBigQueryFieldOrBuilder() { + if ((sourceCase_ == 3) && (bigQueryFieldBuilder_ != null)) { + return bigQueryFieldBuilder_.getMessageOrBuilder(); + } else { + if (sourceCase_ == 3) { + return (com.google.privacy.dlp.v2.BigQueryField) source_; + } + return com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + } + /** + *
+     * Field in a BigQuery table where each cell represents a dictionary phrase.
+     * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryField, com.google.privacy.dlp.v2.BigQueryField.Builder, com.google.privacy.dlp.v2.BigQueryFieldOrBuilder> + getBigQueryFieldFieldBuilder() { + if (bigQueryFieldBuilder_ == null) { + if (!(sourceCase_ == 3)) { + source_ = com.google.privacy.dlp.v2.BigQueryField.getDefaultInstance(); + } + bigQueryFieldBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.BigQueryField, com.google.privacy.dlp.v2.BigQueryField.Builder, com.google.privacy.dlp.v2.BigQueryFieldOrBuilder>( + (com.google.privacy.dlp.v2.BigQueryField) source_, + getParentForChildren(), + isClean()); + source_ = null; + } + sourceCase_ = 3; + onChanged();; + return bigQueryFieldBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.LargeCustomDictionaryConfig) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.LargeCustomDictionaryConfig) + private static final com.google.privacy.dlp.v2.LargeCustomDictionaryConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.LargeCustomDictionaryConfig(); + } + + public static com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LargeCustomDictionaryConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LargeCustomDictionaryConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfigOrBuilder.java new file mode 100644 index 000000000000..aced71d6893c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/LargeCustomDictionaryConfigOrBuilder.java @@ -0,0 +1,95 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface LargeCustomDictionaryConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.LargeCustomDictionaryConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + boolean hasOutputPath(); + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + com.google.privacy.dlp.v2.CloudStoragePath getOutputPath(); + /** + *
+   * Location to store dictionary artifacts in Google Cloud Storage. These files
+   * will only be accessible by project owners and the DLP API. If any of these
+   * artifacts are modified, the dictionary is considered invalid and can no
+   * longer be used.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStoragePath output_path = 1; + */ + com.google.privacy.dlp.v2.CloudStoragePathOrBuilder getOutputPathOrBuilder(); + + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + boolean hasCloudStorageFileSet(); + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + com.google.privacy.dlp.v2.CloudStorageFileSet getCloudStorageFileSet(); + /** + *
+   * Set of files containing newline-delimited lists of dictionary phrases.
+   * 
+ * + * .google.privacy.dlp.v2.CloudStorageFileSet cloud_storage_file_set = 2; + */ + com.google.privacy.dlp.v2.CloudStorageFileSetOrBuilder getCloudStorageFileSetOrBuilder(); + + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + boolean hasBigQueryField(); + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + com.google.privacy.dlp.v2.BigQueryField getBigQueryField(); + /** + *
+   * Field in a BigQuery table where each cell represents a dictionary phrase.
+   * 
+ * + * .google.privacy.dlp.v2.BigQueryField big_query_field = 3; + */ + com.google.privacy.dlp.v2.BigQueryFieldOrBuilder getBigQueryFieldOrBuilder(); + + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.SourceCase getSourceCase(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequest.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequest.java new file mode 100644 index 000000000000..540687620e10 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequest.java @@ -0,0 +1,824 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Request message for ListStoredInfoTypes.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.ListStoredInfoTypesRequest} + */ +public final class ListStoredInfoTypesRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.ListStoredInfoTypesRequest) + ListStoredInfoTypesRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListStoredInfoTypesRequest.newBuilder() to construct. + private ListStoredInfoTypesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListStoredInfoTypesRequest() { + parent_ = ""; + pageToken_ = ""; + pageSize_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListStoredInfoTypesRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: { + + pageSize_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.class, com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + *
+   * Optional page token to continue retrieval. Comes from previous call
+   * to `ListStoredInfoTypes`.
+   * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + *
+   * Optional page token to continue retrieval. Comes from previous call
+   * to `ListStoredInfoTypes`.
+   * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + *
+   * Optional size of the page, can be limited by server. If zero server returns
+   * a page of max size 100.
+   * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.ListStoredInfoTypesRequest)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest other = (com.google.privacy.dlp.v2.ListStoredInfoTypesRequest) obj; + + boolean result = true; + result = result && getParent() + .equals(other.getParent()); + result = result && getPageToken() + .equals(other.getPageToken()); + result = result && (getPageSize() + == other.getPageSize()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for ListStoredInfoTypes.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.ListStoredInfoTypesRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.ListStoredInfoTypesRequest) + com.google.privacy.dlp.v2.ListStoredInfoTypesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.class, com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesRequest_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesRequest getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesRequest build() { + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesRequest buildPartial() { + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest result = new com.google.privacy.dlp.v2.ListStoredInfoTypesRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.ListStoredInfoTypesRequest) { + return mergeFrom((com.google.privacy.dlp.v2.ListStoredInfoTypesRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.ListStoredInfoTypesRequest other) { + if (other == com.google.privacy.dlp.v2.ListStoredInfoTypesRequest.getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.ListStoredInfoTypesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.ListStoredInfoTypesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString + getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder setParent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + *
+     * The parent resource name, for example projects/my-project-id or
+     * organizations/my-org-id.
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + *
+     * Optional page token to continue retrieval. Comes from previous call
+     * to `ListStoredInfoTypes`.
+     * 
+ * + * string page_token = 2; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional page token to continue retrieval. Comes from previous call
+     * to `ListStoredInfoTypes`.
+     * 
+ * + * string page_token = 2; + */ + public com.google.protobuf.ByteString + getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional page token to continue retrieval. Comes from previous call
+     * to `ListStoredInfoTypes`.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional page token to continue retrieval. Comes from previous call
+     * to `ListStoredInfoTypes`.
+     * 
+ * + * string page_token = 2; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + *
+     * Optional page token to continue retrieval. Comes from previous call
+     * to `ListStoredInfoTypes`.
+     * 
+ * + * string page_token = 2; + */ + public Builder setPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_ ; + /** + *
+     * Optional size of the page, can be limited by server. If zero server returns
+     * a page of max size 100.
+     * 
+ * + * int32 page_size = 3; + */ + public int getPageSize() { + return pageSize_; + } + /** + *
+     * Optional size of the page, can be limited by server. If zero server returns
+     * a page of max size 100.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional size of the page, can be limited by server. If zero server returns
+     * a page of max size 100.
+     * 
+ * + * int32 page_size = 3; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.ListStoredInfoTypesRequest) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListStoredInfoTypesRequest) + private static final com.google.privacy.dlp.v2.ListStoredInfoTypesRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.ListStoredInfoTypesRequest(); + } + + public static com.google.privacy.dlp.v2.ListStoredInfoTypesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListStoredInfoTypesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListStoredInfoTypesRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequestOrBuilder.java new file mode 100644 index 000000000000..81958a2cc189 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesRequestOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface ListStoredInfoTypesRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.ListStoredInfoTypesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + *
+   * The parent resource name, for example projects/my-project-id or
+   * organizations/my-org-id.
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString + getParentBytes(); + + /** + *
+   * Optional page token to continue retrieval. Comes from previous call
+   * to `ListStoredInfoTypes`.
+   * 
+ * + * string page_token = 2; + */ + java.lang.String getPageToken(); + /** + *
+   * Optional page token to continue retrieval. Comes from previous call
+   * to `ListStoredInfoTypes`.
+   * 
+ * + * string page_token = 2; + */ + com.google.protobuf.ByteString + getPageTokenBytes(); + + /** + *
+   * Optional size of the page, can be limited by server. If zero server returns
+   * a page of max size 100.
+   * 
+ * + * int32 page_size = 3; + */ + int getPageSize(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponse.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponse.java new file mode 100644 index 000000000000..8851e8ef4a1f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponse.java @@ -0,0 +1,1024 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Response message for ListStoredInfoTypes.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.ListStoredInfoTypesResponse} + */ +public final class ListStoredInfoTypesResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.ListStoredInfoTypesResponse) + ListStoredInfoTypesResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ListStoredInfoTypesResponse.newBuilder() to construct. + private ListStoredInfoTypesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListStoredInfoTypesResponse() { + storedInfoTypes_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListStoredInfoTypesResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + storedInfoTypes_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + storedInfoTypes_.add( + input.readMessage(com.google.privacy.dlp.v2.StoredInfoType.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + storedInfoTypes_ = java.util.Collections.unmodifiableList(storedInfoTypes_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.class, com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.Builder.class); + } + + private int bitField0_; + public static final int STORED_INFO_TYPES_FIELD_NUMBER = 1; + private java.util.List storedInfoTypes_; + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public java.util.List getStoredInfoTypesList() { + return storedInfoTypes_; + } + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public java.util.List + getStoredInfoTypesOrBuilderList() { + return storedInfoTypes_; + } + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public int getStoredInfoTypesCount() { + return storedInfoTypes_.size(); + } + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoType getStoredInfoTypes(int index) { + return storedInfoTypes_.get(index); + } + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder getStoredInfoTypesOrBuilder( + int index) { + return storedInfoTypes_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + *
+   * If the next page is available then the next page token to be used
+   * in following ListStoredInfoTypes request.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + *
+   * If the next page is available then the next page token to be used
+   * in following ListStoredInfoTypes request.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < storedInfoTypes_.size(); i++) { + output.writeMessage(1, storedInfoTypes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < storedInfoTypes_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, storedInfoTypes_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.ListStoredInfoTypesResponse)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse other = (com.google.privacy.dlp.v2.ListStoredInfoTypesResponse) obj; + + boolean result = true; + result = result && getStoredInfoTypesList() + .equals(other.getStoredInfoTypesList()); + result = result && getNextPageToken() + .equals(other.getNextPageToken()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getStoredInfoTypesCount() > 0) { + hash = (37 * hash) + STORED_INFO_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getStoredInfoTypesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.ListStoredInfoTypesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Response message for ListStoredInfoTypes.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.ListStoredInfoTypesResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.ListStoredInfoTypesResponse) + com.google.privacy.dlp.v2.ListStoredInfoTypesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.class, com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getStoredInfoTypesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (storedInfoTypesBuilder_ == null) { + storedInfoTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + storedInfoTypesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_ListStoredInfoTypesResponse_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesResponse getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesResponse build() { + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesResponse buildPartial() { + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse result = new com.google.privacy.dlp.v2.ListStoredInfoTypesResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (storedInfoTypesBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001)) { + storedInfoTypes_ = java.util.Collections.unmodifiableList(storedInfoTypes_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.storedInfoTypes_ = storedInfoTypes_; + } else { + result.storedInfoTypes_ = storedInfoTypesBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.ListStoredInfoTypesResponse) { + return mergeFrom((com.google.privacy.dlp.v2.ListStoredInfoTypesResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.ListStoredInfoTypesResponse other) { + if (other == com.google.privacy.dlp.v2.ListStoredInfoTypesResponse.getDefaultInstance()) return this; + if (storedInfoTypesBuilder_ == null) { + if (!other.storedInfoTypes_.isEmpty()) { + if (storedInfoTypes_.isEmpty()) { + storedInfoTypes_ = other.storedInfoTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.addAll(other.storedInfoTypes_); + } + onChanged(); + } + } else { + if (!other.storedInfoTypes_.isEmpty()) { + if (storedInfoTypesBuilder_.isEmpty()) { + storedInfoTypesBuilder_.dispose(); + storedInfoTypesBuilder_ = null; + storedInfoTypes_ = other.storedInfoTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + storedInfoTypesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getStoredInfoTypesFieldBuilder() : null; + } else { + storedInfoTypesBuilder_.addAllMessages(other.storedInfoTypes_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.ListStoredInfoTypesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.ListStoredInfoTypesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List storedInfoTypes_ = + java.util.Collections.emptyList(); + private void ensureStoredInfoTypesIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + storedInfoTypes_ = new java.util.ArrayList(storedInfoTypes_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoType, com.google.privacy.dlp.v2.StoredInfoType.Builder, com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder> storedInfoTypesBuilder_; + + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public java.util.List getStoredInfoTypesList() { + if (storedInfoTypesBuilder_ == null) { + return java.util.Collections.unmodifiableList(storedInfoTypes_); + } else { + return storedInfoTypesBuilder_.getMessageList(); + } + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public int getStoredInfoTypesCount() { + if (storedInfoTypesBuilder_ == null) { + return storedInfoTypes_.size(); + } else { + return storedInfoTypesBuilder_.getCount(); + } + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoType getStoredInfoTypes(int index) { + if (storedInfoTypesBuilder_ == null) { + return storedInfoTypes_.get(index); + } else { + return storedInfoTypesBuilder_.getMessage(index); + } + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder setStoredInfoTypes( + int index, com.google.privacy.dlp.v2.StoredInfoType value) { + if (storedInfoTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.set(index, value); + onChanged(); + } else { + storedInfoTypesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder setStoredInfoTypes( + int index, com.google.privacy.dlp.v2.StoredInfoType.Builder builderForValue) { + if (storedInfoTypesBuilder_ == null) { + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.set(index, builderForValue.build()); + onChanged(); + } else { + storedInfoTypesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder addStoredInfoTypes(com.google.privacy.dlp.v2.StoredInfoType value) { + if (storedInfoTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.add(value); + onChanged(); + } else { + storedInfoTypesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder addStoredInfoTypes( + int index, com.google.privacy.dlp.v2.StoredInfoType value) { + if (storedInfoTypesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.add(index, value); + onChanged(); + } else { + storedInfoTypesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder addStoredInfoTypes( + com.google.privacy.dlp.v2.StoredInfoType.Builder builderForValue) { + if (storedInfoTypesBuilder_ == null) { + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.add(builderForValue.build()); + onChanged(); + } else { + storedInfoTypesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder addStoredInfoTypes( + int index, com.google.privacy.dlp.v2.StoredInfoType.Builder builderForValue) { + if (storedInfoTypesBuilder_ == null) { + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.add(index, builderForValue.build()); + onChanged(); + } else { + storedInfoTypesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder addAllStoredInfoTypes( + java.lang.Iterable values) { + if (storedInfoTypesBuilder_ == null) { + ensureStoredInfoTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, storedInfoTypes_); + onChanged(); + } else { + storedInfoTypesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder clearStoredInfoTypes() { + if (storedInfoTypesBuilder_ == null) { + storedInfoTypes_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + storedInfoTypesBuilder_.clear(); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public Builder removeStoredInfoTypes(int index) { + if (storedInfoTypesBuilder_ == null) { + ensureStoredInfoTypesIsMutable(); + storedInfoTypes_.remove(index); + onChanged(); + } else { + storedInfoTypesBuilder_.remove(index); + } + return this; + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoType.Builder getStoredInfoTypesBuilder( + int index) { + return getStoredInfoTypesFieldBuilder().getBuilder(index); + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder getStoredInfoTypesOrBuilder( + int index) { + if (storedInfoTypesBuilder_ == null) { + return storedInfoTypes_.get(index); } else { + return storedInfoTypesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public java.util.List + getStoredInfoTypesOrBuilderList() { + if (storedInfoTypesBuilder_ != null) { + return storedInfoTypesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(storedInfoTypes_); + } + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoType.Builder addStoredInfoTypesBuilder() { + return getStoredInfoTypesFieldBuilder().addBuilder( + com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance()); + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoType.Builder addStoredInfoTypesBuilder( + int index) { + return getStoredInfoTypesFieldBuilder().addBuilder( + index, com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance()); + } + /** + *
+     * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + public java.util.List + getStoredInfoTypesBuilderList() { + return getStoredInfoTypesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoType, com.google.privacy.dlp.v2.StoredInfoType.Builder, com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder> + getStoredInfoTypesFieldBuilder() { + if (storedInfoTypesBuilder_ == null) { + storedInfoTypesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoType, com.google.privacy.dlp.v2.StoredInfoType.Builder, com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder>( + storedInfoTypes_, + ((bitField0_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + storedInfoTypes_ = null; + } + return storedInfoTypesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + *
+     * If the next page is available then the next page token to be used
+     * in following ListStoredInfoTypes request.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * If the next page is available then the next page token to be used
+     * in following ListStoredInfoTypes request.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString + getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * If the next page is available then the next page token to be used
+     * in following ListStoredInfoTypes request.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + *
+     * If the next page is available then the next page token to be used
+     * in following ListStoredInfoTypes request.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + *
+     * If the next page is available then the next page token to be used
+     * in following ListStoredInfoTypes request.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.ListStoredInfoTypesResponse) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.ListStoredInfoTypesResponse) + private static final com.google.privacy.dlp.v2.ListStoredInfoTypesResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.ListStoredInfoTypesResponse(); + } + + public static com.google.privacy.dlp.v2.ListStoredInfoTypesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListStoredInfoTypesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListStoredInfoTypesResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.ListStoredInfoTypesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponseOrBuilder.java new file mode 100644 index 000000000000..e90817bab8be --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/ListStoredInfoTypesResponseOrBuilder.java @@ -0,0 +1,73 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface ListStoredInfoTypesResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.ListStoredInfoTypesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + java.util.List + getStoredInfoTypesList(); + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + com.google.privacy.dlp.v2.StoredInfoType getStoredInfoTypes(int index); + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + int getStoredInfoTypesCount(); + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + java.util.List + getStoredInfoTypesOrBuilderList(); + /** + *
+   * List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoType stored_info_types = 1; + */ + com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder getStoredInfoTypesOrBuilder( + int index); + + /** + *
+   * If the next page is available then the next page token to be used
+   * in following ListStoredInfoTypes request.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + *
+   * If the next page is available then the next page token to be used
+   * in following ListStoredInfoTypes request.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString + getNextPageTokenBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StorageConfig.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StorageConfig.java index 7c36ac221453..ced2042bfa9f 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StorageConfig.java +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StorageConfig.java @@ -139,7 +139,7 @@ public interface TimespanConfigOrBuilder extends /** *
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -147,7 +147,7 @@ public interface TimespanConfigOrBuilder extends boolean hasStartTime(); /** *
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -155,7 +155,7 @@ public interface TimespanConfigOrBuilder extends com.google.protobuf.Timestamp getStartTime(); /** *
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -164,7 +164,7 @@ public interface TimespanConfigOrBuilder extends /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -173,7 +173,7 @@ public interface TimespanConfigOrBuilder extends boolean hasEndTime(); /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -182,7 +182,7 @@ public interface TimespanConfigOrBuilder extends com.google.protobuf.Timestamp getEndTime(); /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -193,7 +193,9 @@ public interface TimespanConfigOrBuilder extends /** *
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -207,7 +209,9 @@ public interface TimespanConfigOrBuilder extends
     /**
      * 
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -221,7 +225,9 @@ public interface TimespanConfigOrBuilder extends
     /**
      * 
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -370,7 +376,7 @@ private TimespanConfig(
     private com.google.protobuf.Timestamp startTime_;
     /**
      * 
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -380,7 +386,7 @@ public boolean hasStartTime() { } /** *
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -390,7 +396,7 @@ public com.google.protobuf.Timestamp getStartTime() { } /** *
-     * Exclude files older than this value.
+     * Exclude files or rows older than this value.
      * 
* * .google.protobuf.Timestamp start_time = 1; @@ -403,7 +409,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { private com.google.protobuf.Timestamp endTime_; /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -414,7 +420,7 @@ public boolean hasEndTime() { } /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -425,7 +431,7 @@ public com.google.protobuf.Timestamp getEndTime() { } /** *
-     * Exclude files newer than this value.
+     * Exclude files or rows newer than this value.
      * If set to zero, no upper time limit is applied.
      * 
* @@ -440,7 +446,9 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { /** *
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -456,7 +464,9 @@ public boolean hasTimestampField() {
     /**
      * 
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -472,7 +482,9 @@ public com.google.privacy.dlp.v2.FieldId getTimestampField() {
     /**
      * 
      * Specification of the field containing the timestamp of scanned items.
-     * Required for data sources like Datastore or BigQuery.
+     * Used for data sources like Datastore or BigQuery.
+     * If not specified for BigQuery, table last modification timestamp
+     * is checked against given time span.
      * The valid data types of the timestamp field are:
      * for BigQuery - timestamp, date, datetime;
      * for Datastore - timestamp.
@@ -906,7 +918,7 @@ public Builder mergeFrom(
           com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_;
       /**
        * 
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -916,7 +928,7 @@ public boolean hasStartTime() { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -930,7 +942,7 @@ public com.google.protobuf.Timestamp getStartTime() { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -950,7 +962,7 @@ public Builder setStartTime(com.google.protobuf.Timestamp value) { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -968,7 +980,7 @@ public Builder setStartTime( } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -990,7 +1002,7 @@ public Builder mergeStartTime(com.google.protobuf.Timestamp value) { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -1008,7 +1020,7 @@ public Builder clearStartTime() { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -1020,7 +1032,7 @@ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -1035,7 +1047,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { } /** *
-       * Exclude files older than this value.
+       * Exclude files or rows older than this value.
        * 
* * .google.protobuf.Timestamp start_time = 1; @@ -1059,7 +1071,7 @@ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1070,7 +1082,7 @@ public boolean hasEndTime() { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1085,7 +1097,7 @@ public com.google.protobuf.Timestamp getEndTime() { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1106,7 +1118,7 @@ public Builder setEndTime(com.google.protobuf.Timestamp value) { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1125,7 +1137,7 @@ public Builder setEndTime( } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1148,7 +1160,7 @@ public Builder mergeEndTime(com.google.protobuf.Timestamp value) { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1167,7 +1179,7 @@ public Builder clearEndTime() { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1180,7 +1192,7 @@ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1196,7 +1208,7 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { } /** *
-       * Exclude files newer than this value.
+       * Exclude files or rows newer than this value.
        * If set to zero, no upper time limit is applied.
        * 
* @@ -1222,7 +1234,9 @@ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { /** *
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1238,7 +1252,9 @@ public boolean hasTimestampField() {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1258,7 +1274,9 @@ public com.google.privacy.dlp.v2.FieldId getTimestampField() {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1284,7 +1302,9 @@ public Builder setTimestampField(com.google.privacy.dlp.v2.FieldId value) {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1308,7 +1328,9 @@ public Builder setTimestampField(
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1336,7 +1358,9 @@ public Builder mergeTimestampField(com.google.privacy.dlp.v2.FieldId value) {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1360,7 +1384,9 @@ public Builder clearTimestampField() {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1378,7 +1404,9 @@ public com.google.privacy.dlp.v2.FieldId.Builder getTimestampFieldBuilder() {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
@@ -1399,7 +1427,9 @@ public com.google.privacy.dlp.v2.FieldIdOrBuilder getTimestampFieldOrBuilder() {
       /**
        * 
        * Specification of the field containing the timestamp of scanned items.
-       * Required for data sources like Datastore or BigQuery.
+       * Used for data sources like Datastore or BigQuery.
+       * If not specified for BigQuery, table last modification timestamp
+       * is checked against given time span.
        * The valid data types of the timestamp field are:
        * for BigQuery - timestamp, date, datetime;
        * for Datastore - timestamp.
diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoType.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoType.java
new file mode 100644
index 000000000000..8d3fe4ebe10a
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoType.java
@@ -0,0 +1,1271 @@
+// Generated by the protocol buffer compiler.  DO NOT EDIT!
+// source: google/privacy/dlp/v2/dlp.proto
+
+package com.google.privacy.dlp.v2;
+
+/**
+ * 
+ * StoredInfoType resource message that contains information about the current
+ * version and any pending updates.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoType} + */ +public final class StoredInfoType extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.StoredInfoType) + StoredInfoTypeOrBuilder { +private static final long serialVersionUID = 0L; + // Use StoredInfoType.newBuilder() to construct. + private StoredInfoType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredInfoType() { + name_ = ""; + pendingVersions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredInfoType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder subBuilder = null; + if (currentVersion_ != null) { + subBuilder = currentVersion_.toBuilder(); + } + currentVersion_ = input.readMessage(com.google.privacy.dlp.v2.StoredInfoTypeVersion.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(currentVersion_); + currentVersion_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + pendingVersions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000004; + } + pendingVersions_.add( + input.readMessage(com.google.privacy.dlp.v2.StoredInfoTypeVersion.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + pendingVersions_ = java.util.Collections.unmodifiableList(pendingVersions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoType.class, com.google.privacy.dlp.v2.StoredInfoType.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CURRENT_VERSION_FIELD_NUMBER = 2; + private com.google.privacy.dlp.v2.StoredInfoTypeVersion currentVersion_; + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public boolean hasCurrentVersion() { + return currentVersion_ != null; + } + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getCurrentVersion() { + return currentVersion_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance() : currentVersion_; + } + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getCurrentVersionOrBuilder() { + return getCurrentVersion(); + } + + public static final int PENDING_VERSIONS_FIELD_NUMBER = 3; + private java.util.List pendingVersions_; + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public java.util.List getPendingVersionsList() { + return pendingVersions_; + } + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public java.util.List + getPendingVersionsOrBuilderList() { + return pendingVersions_; + } + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public int getPendingVersionsCount() { + return pendingVersions_.size(); + } + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getPendingVersions(int index) { + return pendingVersions_.get(index); + } + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getPendingVersionsOrBuilder( + int index) { + return pendingVersions_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (currentVersion_ != null) { + output.writeMessage(2, getCurrentVersion()); + } + for (int i = 0; i < pendingVersions_.size(); i++) { + output.writeMessage(3, pendingVersions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (currentVersion_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getCurrentVersion()); + } + for (int i = 0; i < pendingVersions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, pendingVersions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.StoredInfoType)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.StoredInfoType other = (com.google.privacy.dlp.v2.StoredInfoType) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasCurrentVersion() == other.hasCurrentVersion()); + if (hasCurrentVersion()) { + result = result && getCurrentVersion() + .equals(other.getCurrentVersion()); + } + result = result && getPendingVersionsList() + .equals(other.getPendingVersionsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCurrentVersion()) { + hash = (37 * hash) + CURRENT_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getCurrentVersion().hashCode(); + } + if (getPendingVersionsCount() > 0) { + hash = (37 * hash) + PENDING_VERSIONS_FIELD_NUMBER; + hash = (53 * hash) + getPendingVersionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.StoredInfoType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * StoredInfoType resource message that contains information about the current
+   * version and any pending updates.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoType} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.StoredInfoType) + com.google.privacy.dlp.v2.StoredInfoTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoType.class, com.google.privacy.dlp.v2.StoredInfoType.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.StoredInfoType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getPendingVersionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (currentVersionBuilder_ == null) { + currentVersion_ = null; + } else { + currentVersion_ = null; + currentVersionBuilder_ = null; + } + if (pendingVersionsBuilder_ == null) { + pendingVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + } else { + pendingVersionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoType_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoType getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoType build() { + com.google.privacy.dlp.v2.StoredInfoType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoType buildPartial() { + com.google.privacy.dlp.v2.StoredInfoType result = new com.google.privacy.dlp.v2.StoredInfoType(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (currentVersionBuilder_ == null) { + result.currentVersion_ = currentVersion_; + } else { + result.currentVersion_ = currentVersionBuilder_.build(); + } + if (pendingVersionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004)) { + pendingVersions_ = java.util.Collections.unmodifiableList(pendingVersions_); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.pendingVersions_ = pendingVersions_; + } else { + result.pendingVersions_ = pendingVersionsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.StoredInfoType) { + return mergeFrom((com.google.privacy.dlp.v2.StoredInfoType)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.StoredInfoType other) { + if (other == com.google.privacy.dlp.v2.StoredInfoType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCurrentVersion()) { + mergeCurrentVersion(other.getCurrentVersion()); + } + if (pendingVersionsBuilder_ == null) { + if (!other.pendingVersions_.isEmpty()) { + if (pendingVersions_.isEmpty()) { + pendingVersions_ = other.pendingVersions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePendingVersionsIsMutable(); + pendingVersions_.addAll(other.pendingVersions_); + } + onChanged(); + } + } else { + if (!other.pendingVersions_.isEmpty()) { + if (pendingVersionsBuilder_.isEmpty()) { + pendingVersionsBuilder_.dispose(); + pendingVersionsBuilder_ = null; + pendingVersions_ = other.pendingVersions_; + bitField0_ = (bitField0_ & ~0x00000004); + pendingVersionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getPendingVersionsFieldBuilder() : null; + } else { + pendingVersionsBuilder_.addAllMessages(other.pendingVersions_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.StoredInfoType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.StoredInfoType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.privacy.dlp.v2.StoredInfoTypeVersion currentVersion_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder> currentVersionBuilder_; + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public boolean hasCurrentVersion() { + return currentVersionBuilder_ != null || currentVersion_ != null; + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getCurrentVersion() { + if (currentVersionBuilder_ == null) { + return currentVersion_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance() : currentVersion_; + } else { + return currentVersionBuilder_.getMessage(); + } + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public Builder setCurrentVersion(com.google.privacy.dlp.v2.StoredInfoTypeVersion value) { + if (currentVersionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + currentVersion_ = value; + onChanged(); + } else { + currentVersionBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public Builder setCurrentVersion( + com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder builderForValue) { + if (currentVersionBuilder_ == null) { + currentVersion_ = builderForValue.build(); + onChanged(); + } else { + currentVersionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public Builder mergeCurrentVersion(com.google.privacy.dlp.v2.StoredInfoTypeVersion value) { + if (currentVersionBuilder_ == null) { + if (currentVersion_ != null) { + currentVersion_ = + com.google.privacy.dlp.v2.StoredInfoTypeVersion.newBuilder(currentVersion_).mergeFrom(value).buildPartial(); + } else { + currentVersion_ = value; + } + onChanged(); + } else { + currentVersionBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public Builder clearCurrentVersion() { + if (currentVersionBuilder_ == null) { + currentVersion_ = null; + onChanged(); + } else { + currentVersion_ = null; + currentVersionBuilder_ = null; + } + + return this; + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder getCurrentVersionBuilder() { + + onChanged(); + return getCurrentVersionFieldBuilder().getBuilder(); + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getCurrentVersionOrBuilder() { + if (currentVersionBuilder_ != null) { + return currentVersionBuilder_.getMessageOrBuilder(); + } else { + return currentVersion_ == null ? + com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance() : currentVersion_; + } + } + /** + *
+     * Current version of the stored info type.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder> + getCurrentVersionFieldBuilder() { + if (currentVersionBuilder_ == null) { + currentVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder>( + getCurrentVersion(), + getParentForChildren(), + isClean()); + currentVersion_ = null; + } + return currentVersionBuilder_; + } + + private java.util.List pendingVersions_ = + java.util.Collections.emptyList(); + private void ensurePendingVersionsIsMutable() { + if (!((bitField0_ & 0x00000004) == 0x00000004)) { + pendingVersions_ = new java.util.ArrayList(pendingVersions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder> pendingVersionsBuilder_; + + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public java.util.List getPendingVersionsList() { + if (pendingVersionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pendingVersions_); + } else { + return pendingVersionsBuilder_.getMessageList(); + } + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public int getPendingVersionsCount() { + if (pendingVersionsBuilder_ == null) { + return pendingVersions_.size(); + } else { + return pendingVersionsBuilder_.getCount(); + } + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getPendingVersions(int index) { + if (pendingVersionsBuilder_ == null) { + return pendingVersions_.get(index); + } else { + return pendingVersionsBuilder_.getMessage(index); + } + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder setPendingVersions( + int index, com.google.privacy.dlp.v2.StoredInfoTypeVersion value) { + if (pendingVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePendingVersionsIsMutable(); + pendingVersions_.set(index, value); + onChanged(); + } else { + pendingVersionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder setPendingVersions( + int index, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder builderForValue) { + if (pendingVersionsBuilder_ == null) { + ensurePendingVersionsIsMutable(); + pendingVersions_.set(index, builderForValue.build()); + onChanged(); + } else { + pendingVersionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder addPendingVersions(com.google.privacy.dlp.v2.StoredInfoTypeVersion value) { + if (pendingVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePendingVersionsIsMutable(); + pendingVersions_.add(value); + onChanged(); + } else { + pendingVersionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder addPendingVersions( + int index, com.google.privacy.dlp.v2.StoredInfoTypeVersion value) { + if (pendingVersionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePendingVersionsIsMutable(); + pendingVersions_.add(index, value); + onChanged(); + } else { + pendingVersionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder addPendingVersions( + com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder builderForValue) { + if (pendingVersionsBuilder_ == null) { + ensurePendingVersionsIsMutable(); + pendingVersions_.add(builderForValue.build()); + onChanged(); + } else { + pendingVersionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder addPendingVersions( + int index, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder builderForValue) { + if (pendingVersionsBuilder_ == null) { + ensurePendingVersionsIsMutable(); + pendingVersions_.add(index, builderForValue.build()); + onChanged(); + } else { + pendingVersionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder addAllPendingVersions( + java.lang.Iterable values) { + if (pendingVersionsBuilder_ == null) { + ensurePendingVersionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pendingVersions_); + onChanged(); + } else { + pendingVersionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder clearPendingVersions() { + if (pendingVersionsBuilder_ == null) { + pendingVersions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + pendingVersionsBuilder_.clear(); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public Builder removePendingVersions(int index) { + if (pendingVersionsBuilder_ == null) { + ensurePendingVersionsIsMutable(); + pendingVersions_.remove(index); + onChanged(); + } else { + pendingVersionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder getPendingVersionsBuilder( + int index) { + return getPendingVersionsFieldBuilder().getBuilder(index); + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getPendingVersionsOrBuilder( + int index) { + if (pendingVersionsBuilder_ == null) { + return pendingVersions_.get(index); } else { + return pendingVersionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public java.util.List + getPendingVersionsOrBuilderList() { + if (pendingVersionsBuilder_ != null) { + return pendingVersionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pendingVersions_); + } + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder addPendingVersionsBuilder() { + return getPendingVersionsFieldBuilder().addBuilder( + com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance()); + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder addPendingVersionsBuilder( + int index) { + return getPendingVersionsFieldBuilder().addBuilder( + index, com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance()); + } + /** + *
+     * Pending versions of the stored info type. Empty if no versions are
+     * pending.
+     * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + public java.util.List + getPendingVersionsBuilderList() { + return getPendingVersionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder> + getPendingVersionsFieldBuilder() { + if (pendingVersionsBuilder_ == null) { + pendingVersionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeVersion, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder, com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder>( + pendingVersions_, + ((bitField0_ & 0x00000004) == 0x00000004), + getParentForChildren(), + isClean()); + pendingVersions_ = null; + } + return pendingVersionsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.StoredInfoType) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoType) + private static final com.google.privacy.dlp.v2.StoredInfoType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.StoredInfoType(); + } + + public static com.google.privacy.dlp.v2.StoredInfoType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StoredInfoType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredInfoType(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfig.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfig.java new file mode 100644 index 000000000000..08b55cb44acd --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfig.java @@ -0,0 +1,1052 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Configuration for a StoredInfoType.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoTypeConfig} + */ +public final class StoredInfoTypeConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.StoredInfoTypeConfig) + StoredInfoTypeConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use StoredInfoTypeConfig.newBuilder() to construct. + private StoredInfoTypeConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredInfoTypeConfig() { + displayName_ = ""; + description_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredInfoTypeConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 26: { + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder subBuilder = null; + if (typeCase_ == 3) { + subBuilder = ((com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_).toBuilder(); + } + type_ = + input.readMessage(com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_); + type_ = subBuilder.buildPartial(); + } + typeCase_ = 3; + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoTypeConfig.class, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder.class); + } + + private int typeCase_ = 0; + private java.lang.Object type_; + public enum TypeCase + implements com.google.protobuf.Internal.EnumLite { + LARGE_CUSTOM_DICTIONARY(3), + TYPE_NOT_SET(0); + private final int value; + private TypeCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TypeCase valueOf(int value) { + return forNumber(value); + } + + public static TypeCase forNumber(int value) { + switch (value) { + case 3: return LARGE_CUSTOM_DICTIONARY; + case 0: return TYPE_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object displayName_; + /** + *
+   * Display name of the StoredInfoType (max 256 characters).
+   * 
+ * + * string display_name = 1; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + *
+   * Display name of the StoredInfoType (max 256 characters).
+   * 
+ * + * string display_name = 1; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+   * Description of the StoredInfoType (max 256 characters).
+   * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * Description of the StoredInfoType (max 256 characters).
+   * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LARGE_CUSTOM_DICTIONARY_FIELD_NUMBER = 3; + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public boolean hasLargeCustomDictionary() { + return typeCase_ == 3; + } + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getLargeCustomDictionary() { + if (typeCase_ == 3) { + return (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_; + } + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder getLargeCustomDictionaryOrBuilder() { + if (typeCase_ == 3) { + return (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_; + } + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + if (typeCase_ == 3) { + output.writeMessage(3, (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, displayName_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + if (typeCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.StoredInfoTypeConfig)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.StoredInfoTypeConfig other = (com.google.privacy.dlp.v2.StoredInfoTypeConfig) obj; + + boolean result = true; + result = result && getDisplayName() + .equals(other.getDisplayName()); + result = result && getDescription() + .equals(other.getDescription()); + result = result && getTypeCase().equals( + other.getTypeCase()); + if (!result) return false; + switch (typeCase_) { + case 3: + result = result && getLargeCustomDictionary() + .equals(other.getLargeCustomDictionary()); + break; + case 0: + default: + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + switch (typeCase_) { + case 3: + hash = (37 * hash) + LARGE_CUSTOM_DICTIONARY_FIELD_NUMBER; + hash = (53 * hash) + getLargeCustomDictionary().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.StoredInfoTypeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Configuration for a StoredInfoType.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoTypeConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.StoredInfoTypeConfig) + com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoTypeConfig.class, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.StoredInfoTypeConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + displayName_ = ""; + + description_ = ""; + + typeCase_ = 0; + type_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeConfig_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeConfig build() { + com.google.privacy.dlp.v2.StoredInfoTypeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeConfig buildPartial() { + com.google.privacy.dlp.v2.StoredInfoTypeConfig result = new com.google.privacy.dlp.v2.StoredInfoTypeConfig(this); + result.displayName_ = displayName_; + result.description_ = description_; + if (typeCase_ == 3) { + if (largeCustomDictionaryBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = largeCustomDictionaryBuilder_.build(); + } + } + result.typeCase_ = typeCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.StoredInfoTypeConfig) { + return mergeFrom((com.google.privacy.dlp.v2.StoredInfoTypeConfig)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.StoredInfoTypeConfig other) { + if (other == com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance()) return this; + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + switch (other.getTypeCase()) { + case LARGE_CUSTOM_DICTIONARY: { + mergeLargeCustomDictionary(other.getLargeCustomDictionary()); + break; + } + case TYPE_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.StoredInfoTypeConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.StoredInfoTypeConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int typeCase_ = 0; + private java.lang.Object type_; + public TypeCase + getTypeCase() { + return TypeCase.forNumber( + typeCase_); + } + + public Builder clearType() { + typeCase_ = 0; + type_ = null; + onChanged(); + return this; + } + + + private java.lang.Object displayName_ = ""; + /** + *
+     * Display name of the StoredInfoType (max 256 characters).
+     * 
+ * + * string display_name = 1; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Display name of the StoredInfoType (max 256 characters).
+     * 
+ * + * string display_name = 1; + */ + public com.google.protobuf.ByteString + getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Display name of the StoredInfoType (max 256 characters).
+     * 
+ * + * string display_name = 1; + */ + public Builder setDisplayName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + *
+     * Display name of the StoredInfoType (max 256 characters).
+     * 
+ * + * string display_name = 1; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + *
+     * Display name of the StoredInfoType (max 256 characters).
+     * 
+ * + * string display_name = 1; + */ + public Builder setDisplayNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Description of the StoredInfoType (max 256 characters).
+     * 
+ * + * string description = 2; + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Description of the StoredInfoType (max 256 characters).
+     * 
+ * + * string description = 2; + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Description of the StoredInfoType (max 256 characters).
+     * 
+ * + * string description = 2; + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Description of the StoredInfoType (max 256 characters).
+     * 
+ * + * string description = 2; + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Description of the StoredInfoType (max 256 characters).
+     * 
+ * + * string description = 2; + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig, com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder, com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder> largeCustomDictionaryBuilder_; + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public boolean hasLargeCustomDictionary() { + return typeCase_ == 3; + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getLargeCustomDictionary() { + if (largeCustomDictionaryBuilder_ == null) { + if (typeCase_ == 3) { + return (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_; + } + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } else { + if (typeCase_ == 3) { + return largeCustomDictionaryBuilder_.getMessage(); + } + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public Builder setLargeCustomDictionary(com.google.privacy.dlp.v2.LargeCustomDictionaryConfig value) { + if (largeCustomDictionaryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + largeCustomDictionaryBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public Builder setLargeCustomDictionary( + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder builderForValue) { + if (largeCustomDictionaryBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + largeCustomDictionaryBuilder_.setMessage(builderForValue.build()); + } + typeCase_ = 3; + return this; + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public Builder mergeLargeCustomDictionary(com.google.privacy.dlp.v2.LargeCustomDictionaryConfig value) { + if (largeCustomDictionaryBuilder_ == null) { + if (typeCase_ == 3 && + type_ != com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance()) { + type_ = com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.newBuilder((com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_) + .mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + if (typeCase_ == 3) { + largeCustomDictionaryBuilder_.mergeFrom(value); + } + largeCustomDictionaryBuilder_.setMessage(value); + } + typeCase_ = 3; + return this; + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public Builder clearLargeCustomDictionary() { + if (largeCustomDictionaryBuilder_ == null) { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + onChanged(); + } + } else { + if (typeCase_ == 3) { + typeCase_ = 0; + type_ = null; + } + largeCustomDictionaryBuilder_.clear(); + } + return this; + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder getLargeCustomDictionaryBuilder() { + return getLargeCustomDictionaryFieldBuilder().getBuilder(); + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + public com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder getLargeCustomDictionaryOrBuilder() { + if ((typeCase_ == 3) && (largeCustomDictionaryBuilder_ != null)) { + return largeCustomDictionaryBuilder_.getMessageOrBuilder(); + } else { + if (typeCase_ == 3) { + return (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_; + } + return com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + } + /** + *
+     * StoredInfoType where findings are defined by a dictionary of phrases.
+     * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig, com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder, com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder> + getLargeCustomDictionaryFieldBuilder() { + if (largeCustomDictionaryBuilder_ == null) { + if (!(typeCase_ == 3)) { + type_ = com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.getDefaultInstance(); + } + largeCustomDictionaryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig, com.google.privacy.dlp.v2.LargeCustomDictionaryConfig.Builder, com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder>( + (com.google.privacy.dlp.v2.LargeCustomDictionaryConfig) type_, + getParentForChildren(), + isClean()); + type_ = null; + } + typeCase_ = 3; + onChanged();; + return largeCustomDictionaryBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.StoredInfoTypeConfig) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoTypeConfig) + private static final com.google.privacy.dlp.v2.StoredInfoTypeConfig DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.StoredInfoTypeConfig(); + } + + public static com.google.privacy.dlp.v2.StoredInfoTypeConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StoredInfoTypeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredInfoTypeConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfigOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfigOrBuilder.java new file mode 100644 index 000000000000..222a3b5555eb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeConfigOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface StoredInfoTypeConfigOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.StoredInfoTypeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Display name of the StoredInfoType (max 256 characters).
+   * 
+ * + * string display_name = 1; + */ + java.lang.String getDisplayName(); + /** + *
+   * Display name of the StoredInfoType (max 256 characters).
+   * 
+ * + * string display_name = 1; + */ + com.google.protobuf.ByteString + getDisplayNameBytes(); + + /** + *
+   * Description of the StoredInfoType (max 256 characters).
+   * 
+ * + * string description = 2; + */ + java.lang.String getDescription(); + /** + *
+   * Description of the StoredInfoType (max 256 characters).
+   * 
+ * + * string description = 2; + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + boolean hasLargeCustomDictionary(); + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + com.google.privacy.dlp.v2.LargeCustomDictionaryConfig getLargeCustomDictionary(); + /** + *
+   * StoredInfoType where findings are defined by a dictionary of phrases.
+   * 
+ * + * .google.privacy.dlp.v2.LargeCustomDictionaryConfig large_custom_dictionary = 3; + */ + com.google.privacy.dlp.v2.LargeCustomDictionaryConfigOrBuilder getLargeCustomDictionaryOrBuilder(); + + public com.google.privacy.dlp.v2.StoredInfoTypeConfig.TypeCase getTypeCase(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeOrBuilder.java new file mode 100644 index 000000000000..776318f1be1f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeOrBuilder.java @@ -0,0 +1,101 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface StoredInfoTypeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.StoredInfoType) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + boolean hasCurrentVersion(); + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeVersion getCurrentVersion(); + /** + *
+   * Current version of the stored info type.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeVersion current_version = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getCurrentVersionOrBuilder(); + + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + java.util.List + getPendingVersionsList(); + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + com.google.privacy.dlp.v2.StoredInfoTypeVersion getPendingVersions(int index); + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + int getPendingVersionsCount(); + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + java.util.List + getPendingVersionsOrBuilderList(); + /** + *
+   * Pending versions of the stored info type. Empty if no versions are
+   * pending.
+   * 
+ * + * repeated .google.privacy.dlp.v2.StoredInfoTypeVersion pending_versions = 3; + */ + com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder getPendingVersionsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeState.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeState.java new file mode 100644 index 000000000000..f9204b537777 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeState.java @@ -0,0 +1,172 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * State of a StoredInfoType version.
+ * 
+ * + * Protobuf enum {@code google.privacy.dlp.v2.StoredInfoTypeState} + */ +public enum StoredInfoTypeState + implements com.google.protobuf.ProtocolMessageEnum { + /** + * STORED_INFO_TYPE_STATE_UNSPECIFIED = 0; + */ + STORED_INFO_TYPE_STATE_UNSPECIFIED(0), + /** + *
+   * StoredInfoType version is being created.
+   * 
+ * + * PENDING = 1; + */ + PENDING(1), + /** + *
+   * StoredInfoType version is ready for use.
+   * 
+ * + * READY = 2; + */ + READY(2), + /** + *
+   * StoredInfoType creation failed. All relevant error messages are returned in
+   * the `StoredInfoTypeVersion` message.
+   * 
+ * + * FAILED = 3; + */ + FAILED(3), + /** + *
+   * StoredInfoType is no longer valid because artifacts stored in
+   * user-controlled storage were modified. To fix an invalid StoredInfoType,
+   * use the `UpdateStoredInfoType` method to create a new version.
+   * 
+ * + * INVALID = 4; + */ + INVALID(4), + UNRECOGNIZED(-1), + ; + + /** + * STORED_INFO_TYPE_STATE_UNSPECIFIED = 0; + */ + public static final int STORED_INFO_TYPE_STATE_UNSPECIFIED_VALUE = 0; + /** + *
+   * StoredInfoType version is being created.
+   * 
+ * + * PENDING = 1; + */ + public static final int PENDING_VALUE = 1; + /** + *
+   * StoredInfoType version is ready for use.
+   * 
+ * + * READY = 2; + */ + public static final int READY_VALUE = 2; + /** + *
+   * StoredInfoType creation failed. All relevant error messages are returned in
+   * the `StoredInfoTypeVersion` message.
+   * 
+ * + * FAILED = 3; + */ + public static final int FAILED_VALUE = 3; + /** + *
+   * StoredInfoType is no longer valid because artifacts stored in
+   * user-controlled storage were modified. To fix an invalid StoredInfoType,
+   * use the `UpdateStoredInfoType` method to create a new version.
+   * 
+ * + * INVALID = 4; + */ + public static final int INVALID_VALUE = 4; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static StoredInfoTypeState valueOf(int value) { + return forNumber(value); + } + + public static StoredInfoTypeState forNumber(int value) { + switch (value) { + case 0: return STORED_INFO_TYPE_STATE_UNSPECIFIED; + case 1: return PENDING; + case 2: return READY; + case 3: return FAILED; + case 4: return INVALID; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StoredInfoTypeState> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StoredInfoTypeState findValueByNumber(int number) { + return StoredInfoTypeState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.getDescriptor().getEnumTypes().get(4); + } + + private static final StoredInfoTypeState[] VALUES = values(); + + public static StoredInfoTypeState valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private StoredInfoTypeState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.privacy.dlp.v2.StoredInfoTypeState) +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersion.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersion.java new file mode 100644 index 000000000000..0285a5ba52e4 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersion.java @@ -0,0 +1,1684 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Version of a StoredInfoType, including the configuration used to build it,
+ * create timestamp, and current state.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoTypeVersion} + */ +public final class StoredInfoTypeVersion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.StoredInfoTypeVersion) + StoredInfoTypeVersionOrBuilder { +private static final long serialVersionUID = 0L; + // Use StoredInfoTypeVersion.newBuilder() to construct. + private StoredInfoTypeVersion(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredInfoTypeVersion() { + state_ = 0; + errors_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredInfoTypeVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.privacy.dlp.v2.StoredInfoTypeConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + errors_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + errors_.add( + input.readMessage(com.google.privacy.dlp.v2.Error.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoTypeVersion.class, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder.class); + } + + private int bitField0_; + public static final int CONFIG_FIELD_NUMBER = 1; + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_; + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int STATE_FIELD_NUMBER = 3; + private int state_; + /** + *
+   * Stored info type version state. Read-only, updated by the system
+   * during dictionary creation.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public int getStateValue() { + return state_; + } + /** + *
+   * Stored info type version state. Read-only, updated by the system
+   * during dictionary creation.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeState getState() { + @SuppressWarnings("deprecation") + com.google.privacy.dlp.v2.StoredInfoTypeState result = com.google.privacy.dlp.v2.StoredInfoTypeState.valueOf(state_); + return result == null ? com.google.privacy.dlp.v2.StoredInfoTypeState.UNRECOGNIZED : result; + } + + public static final int ERRORS_FIELD_NUMBER = 4; + private java.util.List errors_; + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public java.util.List getErrorsList() { + return errors_; + } + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public java.util.List + getErrorsOrBuilderList() { + return errors_; + } + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public int getErrorsCount() { + return errors_.size(); + } + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.Error getErrors(int index) { + return errors_.get(index); + } + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.ErrorOrBuilder getErrorsOrBuilder( + int index) { + return errors_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (config_ != null) { + output.writeMessage(1, getConfig()); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + if (state_ != com.google.privacy.dlp.v2.StoredInfoTypeState.STORED_INFO_TYPE_STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(3, state_); + } + for (int i = 0; i < errors_.size(); i++) { + output.writeMessage(4, errors_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getConfig()); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getCreateTime()); + } + if (state_ != com.google.privacy.dlp.v2.StoredInfoTypeState.STORED_INFO_TYPE_STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, state_); + } + for (int i = 0; i < errors_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, errors_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.StoredInfoTypeVersion)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.StoredInfoTypeVersion other = (com.google.privacy.dlp.v2.StoredInfoTypeVersion) obj; + + boolean result = true; + result = result && (hasConfig() == other.hasConfig()); + if (hasConfig()) { + result = result && getConfig() + .equals(other.getConfig()); + } + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && state_ == other.state_; + result = result && getErrorsList() + .equals(other.getErrorsList()); + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (getErrorsCount() > 0) { + hash = (37 * hash) + ERRORS_FIELD_NUMBER; + hash = (53 * hash) + getErrorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.StoredInfoTypeVersion prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Version of a StoredInfoType, including the configuration used to build it,
+   * create timestamp, and current state.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredInfoTypeVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.StoredInfoTypeVersion) + com.google.privacy.dlp.v2.StoredInfoTypeVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredInfoTypeVersion.class, com.google.privacy.dlp.v2.StoredInfoTypeVersion.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.StoredInfoTypeVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getErrorsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + state_ = 0; + + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + } else { + errorsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_StoredInfoTypeVersion_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeVersion build() { + com.google.privacy.dlp.v2.StoredInfoTypeVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeVersion buildPartial() { + com.google.privacy.dlp.v2.StoredInfoTypeVersion result = new com.google.privacy.dlp.v2.StoredInfoTypeVersion(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.state_ = state_; + if (errorsBuilder_ == null) { + if (((bitField0_ & 0x00000008) == 0x00000008)) { + errors_ = java.util.Collections.unmodifiableList(errors_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.errors_ = errors_; + } else { + result.errors_ = errorsBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.StoredInfoTypeVersion) { + return mergeFrom((com.google.privacy.dlp.v2.StoredInfoTypeVersion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.StoredInfoTypeVersion other) { + if (other == com.google.privacy.dlp.v2.StoredInfoTypeVersion.getDefaultInstance()) return this; + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (errorsBuilder_ == null) { + if (!other.errors_.isEmpty()) { + if (errors_.isEmpty()) { + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureErrorsIsMutable(); + errors_.addAll(other.errors_); + } + onChanged(); + } + } else { + if (!other.errors_.isEmpty()) { + if (errorsBuilder_.isEmpty()) { + errorsBuilder_.dispose(); + errorsBuilder_ = null; + errors_ = other.errors_; + bitField0_ = (bitField0_ & ~0x00000008); + errorsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getErrorsFieldBuilder() : null; + } else { + errorsBuilder_.addAllMessages(other.errors_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.StoredInfoTypeVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.StoredInfoTypeVersion) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> configBuilder_; + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public Builder setConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public Builder setConfig( + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public Builder mergeConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.privacy.dlp.v2.StoredInfoTypeConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * StoredInfoType configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Create timestamp of the version. Read-only, determined by the system
+     * when the version is created.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int state_ = 0; + /** + *
+     * Stored info type version state. Read-only, updated by the system
+     * during dictionary creation.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public int getStateValue() { + return state_; + } + /** + *
+     * Stored info type version state. Read-only, updated by the system
+     * during dictionary creation.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public Builder setStateValue(int value) { + state_ = value; + onChanged(); + return this; + } + /** + *
+     * Stored info type version state. Read-only, updated by the system
+     * during dictionary creation.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeState getState() { + @SuppressWarnings("deprecation") + com.google.privacy.dlp.v2.StoredInfoTypeState result = com.google.privacy.dlp.v2.StoredInfoTypeState.valueOf(state_); + return result == null ? com.google.privacy.dlp.v2.StoredInfoTypeState.UNRECOGNIZED : result; + } + /** + *
+     * Stored info type version state. Read-only, updated by the system
+     * during dictionary creation.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public Builder setState(com.google.privacy.dlp.v2.StoredInfoTypeState value) { + if (value == null) { + throw new NullPointerException(); + } + + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Stored info type version state. Read-only, updated by the system
+     * during dictionary creation.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + public Builder clearState() { + + state_ = 0; + onChanged(); + return this; + } + + private java.util.List errors_ = + java.util.Collections.emptyList(); + private void ensureErrorsIsMutable() { + if (!((bitField0_ & 0x00000008) == 0x00000008)) { + errors_ = new java.util.ArrayList(errors_); + bitField0_ |= 0x00000008; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.Error, com.google.privacy.dlp.v2.Error.Builder, com.google.privacy.dlp.v2.ErrorOrBuilder> errorsBuilder_; + + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public java.util.List getErrorsList() { + if (errorsBuilder_ == null) { + return java.util.Collections.unmodifiableList(errors_); + } else { + return errorsBuilder_.getMessageList(); + } + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public int getErrorsCount() { + if (errorsBuilder_ == null) { + return errors_.size(); + } else { + return errorsBuilder_.getCount(); + } + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.Error getErrors(int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); + } else { + return errorsBuilder_.getMessage(index); + } + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder setErrors( + int index, com.google.privacy.dlp.v2.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.set(index, value); + onChanged(); + } else { + errorsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder setErrors( + int index, com.google.privacy.dlp.v2.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.set(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder addErrors(com.google.privacy.dlp.v2.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(value); + onChanged(); + } else { + errorsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder addErrors( + int index, com.google.privacy.dlp.v2.Error value) { + if (errorsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureErrorsIsMutable(); + errors_.add(index, value); + onChanged(); + } else { + errorsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder addErrors( + com.google.privacy.dlp.v2.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder addErrors( + int index, com.google.privacy.dlp.v2.Error.Builder builderForValue) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.add(index, builderForValue.build()); + onChanged(); + } else { + errorsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder addAllErrors( + java.lang.Iterable values) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, errors_); + onChanged(); + } else { + errorsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder clearErrors() { + if (errorsBuilder_ == null) { + errors_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + } else { + errorsBuilder_.clear(); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public Builder removeErrors(int index) { + if (errorsBuilder_ == null) { + ensureErrorsIsMutable(); + errors_.remove(index); + onChanged(); + } else { + errorsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.Error.Builder getErrorsBuilder( + int index) { + return getErrorsFieldBuilder().getBuilder(index); + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.ErrorOrBuilder getErrorsOrBuilder( + int index) { + if (errorsBuilder_ == null) { + return errors_.get(index); } else { + return errorsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public java.util.List + getErrorsOrBuilderList() { + if (errorsBuilder_ != null) { + return errorsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(errors_); + } + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.Error.Builder addErrorsBuilder() { + return getErrorsFieldBuilder().addBuilder( + com.google.privacy.dlp.v2.Error.getDefaultInstance()); + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public com.google.privacy.dlp.v2.Error.Builder addErrorsBuilder( + int index) { + return getErrorsFieldBuilder().addBuilder( + index, com.google.privacy.dlp.v2.Error.getDefaultInstance()); + } + /** + *
+     * Errors that occurred when creating this storedInfoType version, or
+     * anomalies detected in the storedInfoType data that render it unusable. Only
+     * the five most recent errors will be displayed, with the most recent error
+     * appearing first.
+     * <p>For example, some of the data for stored custom dictionaries is put in
+     * the user's Google Cloud Storage bucket, and if this data is modified or
+     * deleted by the user or another system, the dictionary becomes invalid.
+     * <p>If any errors occur, fix the problem indicated by the error message and
+     * use the UpdateStoredInfoType API method to create another version of the
+     * storedInfoType to continue using it, reusing the same `config` if it was
+     * not the source of the error.
+     * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + public java.util.List + getErrorsBuilderList() { + return getErrorsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.Error, com.google.privacy.dlp.v2.Error.Builder, com.google.privacy.dlp.v2.ErrorOrBuilder> + getErrorsFieldBuilder() { + if (errorsBuilder_ == null) { + errorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.privacy.dlp.v2.Error, com.google.privacy.dlp.v2.Error.Builder, com.google.privacy.dlp.v2.ErrorOrBuilder>( + errors_, + ((bitField0_ & 0x00000008) == 0x00000008), + getParentForChildren(), + isClean()); + errors_ = null; + } + return errorsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.StoredInfoTypeVersion) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredInfoTypeVersion) + private static final com.google.privacy.dlp.v2.StoredInfoTypeVersion DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.StoredInfoTypeVersion(); + } + + public static com.google.privacy.dlp.v2.StoredInfoTypeVersion getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StoredInfoTypeVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredInfoTypeVersion(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredInfoTypeVersion getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersionOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersionOrBuilder.java new file mode 100644 index 000000000000..73614155dc36 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredInfoTypeVersionOrBuilder.java @@ -0,0 +1,175 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface StoredInfoTypeVersionOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.StoredInfoTypeVersion) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + boolean hasConfig(); + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig(); + /** + *
+   * StoredInfoType configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 1; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Create timestamp of the version. Read-only, determined by the system
+   * when the version is created.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + *
+   * Stored info type version state. Read-only, updated by the system
+   * during dictionary creation.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + int getStateValue(); + /** + *
+   * Stored info type version state. Read-only, updated by the system
+   * during dictionary creation.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeState state = 3; + */ + com.google.privacy.dlp.v2.StoredInfoTypeState getState(); + + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + java.util.List + getErrorsList(); + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + com.google.privacy.dlp.v2.Error getErrors(int index); + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + int getErrorsCount(); + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + java.util.List + getErrorsOrBuilderList(); + /** + *
+   * Errors that occurred when creating this storedInfoType version, or
+   * anomalies detected in the storedInfoType data that render it unusable. Only
+   * the five most recent errors will be displayed, with the most recent error
+   * appearing first.
+   * <p>For example, some of the data for stored custom dictionaries is put in
+   * the user's Google Cloud Storage bucket, and if this data is modified or
+   * deleted by the user or another system, the dictionary becomes invalid.
+   * <p>If any errors occur, fix the problem indicated by the error message and
+   * use the UpdateStoredInfoType API method to create another version of the
+   * storedInfoType to continue using it, reusing the same `config` if it was
+   * not the source of the error.
+   * 
+ * + * repeated .google.privacy.dlp.v2.Error errors = 4; + */ + com.google.privacy.dlp.v2.ErrorOrBuilder getErrorsOrBuilder( + int index); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredType.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredType.java new file mode 100644 index 000000000000..8c255d9c5e1c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredType.java @@ -0,0 +1,832 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * A reference to a StoredInfoType to use with scanning.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredType} + */ +public final class StoredType extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.StoredType) + StoredTypeOrBuilder { +private static final long serialVersionUID = 0L; + // Use StoredType.newBuilder() to construct. + private StoredType(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StoredType() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredType( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_StoredType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_StoredType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredType.class, com.google.privacy.dlp.v2.StoredType.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of the requested `StoredInfoType`, for example
+   * `organizations/433245324/storedInfoTypes/432452342` or
+   * `projects/project-id/storedInfoTypes/432452342`.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of the requested `StoredInfoType`, for example
+   * `organizations/433245324/storedInfoTypes/432452342` or
+   * `projects/project-id/storedInfoTypes/432452342`.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp createTime_; + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (createTime_ != null) { + output.writeMessage(2, getCreateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getCreateTime()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.StoredType)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.StoredType other = (com.google.privacy.dlp.v2.StoredType) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasCreateTime() == other.hasCreateTime()); + if (hasCreateTime()) { + result = result && getCreateTime() + .equals(other.getCreateTime()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.StoredType parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredType parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredType parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.StoredType parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.StoredType prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A reference to a StoredInfoType to use with scanning.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.StoredType} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.StoredType) + com.google.privacy.dlp.v2.StoredTypeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_StoredType_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_StoredType_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.StoredType.class, com.google.privacy.dlp.v2.StoredType.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.StoredType.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpStorage.internal_static_google_privacy_dlp_v2_StoredType_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredType getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.StoredType.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredType build() { + com.google.privacy.dlp.v2.StoredType result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredType buildPartial() { + com.google.privacy.dlp.v2.StoredType result = new com.google.privacy.dlp.v2.StoredType(this); + result.name_ = name_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.StoredType) { + return mergeFrom((com.google.privacy.dlp.v2.StoredType)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.StoredType other) { + if (other == com.google.privacy.dlp.v2.StoredType.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.StoredType parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.StoredType) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of the requested `StoredInfoType`, for example
+     * `organizations/433245324/storedInfoTypes/432452342` or
+     * `projects/project-id/storedInfoTypes/432452342`.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of the requested `StoredInfoType`, for example
+     * `organizations/433245324/storedInfoTypes/432452342` or
+     * `projects/project-id/storedInfoTypes/432452342`.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of the requested `StoredInfoType`, for example
+     * `organizations/433245324/storedInfoTypes/432452342` or
+     * `projects/project-id/storedInfoTypes/432452342`.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of the requested `StoredInfoType`, for example
+     * `organizations/433245324/storedInfoTypes/432452342` or
+     * `projects/project-id/storedInfoTypes/432452342`.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of the requested `StoredInfoType`, for example
+     * `organizations/433245324/storedInfoTypes/432452342` or
+     * `projects/project-id/storedInfoTypes/432452342`.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_; + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder setCreateTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + } + /** + *
+     * Timestamp indicating when the version of the `StoredInfoType` used for
+     * inspection was created. Output-only field, populated by the system.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), + getParentForChildren(), + isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.StoredType) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.StoredType) + private static final com.google.privacy.dlp.v2.StoredType DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.StoredType(); + } + + public static com.google.privacy.dlp.v2.StoredType getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StoredType parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredType(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.StoredType getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredTypeOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredTypeOrBuilder.java new file mode 100644 index 000000000000..5764c770fbe0 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/StoredTypeOrBuilder.java @@ -0,0 +1,59 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/storage.proto + +package com.google.privacy.dlp.v2; + +public interface StoredTypeOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.StoredType) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of the requested `StoredInfoType`, for example
+   * `organizations/433245324/storedInfoTypes/432452342` or
+   * `projects/project-id/storedInfoTypes/432452342`.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of the requested `StoredInfoType`, for example
+   * `organizations/433245324/storedInfoTypes/432452342` or
+   * `projects/project-id/storedInfoTypes/432452342`.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + boolean hasCreateTime(); + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + *
+   * Timestamp indicating when the version of the `StoredInfoType` used for
+   * inspection was created. Output-only field, populated by the system.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequest.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequest.java new file mode 100644 index 000000000000..aae1a99dff5b --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequest.java @@ -0,0 +1,1073 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +/** + *
+ * Request message for UpdateStoredInfoType.
+ * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} + */ +public final class UpdateStoredInfoTypeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + UpdateStoredInfoTypeRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use UpdateStoredInfoTypeRequest.newBuilder() to construct. + private UpdateStoredInfoTypeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UpdateStoredInfoTypeRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdateStoredInfoTypeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder subBuilder = null; + if (config_ != null) { + subBuilder = config_.toBuilder(); + } + config_ = input.readMessage(com.google.privacy.dlp.v2.StoredInfoTypeConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(config_); + config_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+   * Resource name of organization and storedInfoType to be updated, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + *
+   * Resource name of organization and storedInfoType to be updated, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONFIG_FIELD_NUMBER = 2; + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_; + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public boolean hasConfig() { + return config_ != null; + } + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + return getConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (config_ != null) { + output.writeMessage(2, getConfig()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (config_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest)) { + return super.equals(obj); + } + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest other = (com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) obj; + + boolean result = true; + result = result && getName() + .equals(other.getName()); + result = result && (hasConfig() == other.hasConfig()); + if (hasConfig()) { + result = result && getConfig() + .equals(other.getConfig()); + } + result = result && (hasUpdateMask() == other.hasUpdateMask()); + if (hasUpdateMask()) { + result = result && getUpdateMask() + .equals(other.getUpdateMask()); + } + result = result && unknownFields.equals(other.unknownFields); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasConfig()) { + hash = (37 * hash) + CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Request message for UpdateStoredInfoType.
+   * 
+ * + * Protobuf type {@code google.privacy.dlp.v2.UpdateStoredInfoTypeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.class, com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.Builder.class); + } + + // Construct using com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (configBuilder_ == null) { + config_ = null; + } else { + config_ = null; + configBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.privacy.dlp.v2.DlpProto.internal_static_google_privacy_dlp_v2_UpdateStoredInfoTypeRequest_descriptor; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest getDefaultInstanceForType() { + return com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest build() { + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest buildPartial() { + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest result = new com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest(this); + result.name_ = name_; + if (configBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = configBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return (Builder) super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return (Builder) super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) { + return mergeFrom((com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest other) { + if (other == com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasConfig()) { + mergeConfig(other.getConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+     * Resource name of organization and storedInfoType to be updated, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Resource name of organization and storedInfoType to be updated, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Resource name of organization and storedInfoType to be updated, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+     * Resource name of organization and storedInfoType to be updated, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+     * Resource name of organization and storedInfoType to be updated, for
+     * example `organizations/433245324/storedInfoTypes/432452342` or
+     * projects/project-id/storedInfoTypes/432452342.
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.privacy.dlp.v2.StoredInfoTypeConfig config_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> configBuilder_; + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public boolean hasConfig() { + return configBuilder_ != null || config_ != null; + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig() { + if (configBuilder_ == null) { + return config_ == null ? com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } else { + return configBuilder_.getMessage(); + } + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder setConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + configBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder setConfig( + com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder builderForValue) { + if (configBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + configBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder mergeConfig(com.google.privacy.dlp.v2.StoredInfoTypeConfig value) { + if (configBuilder_ == null) { + if (config_ != null) { + config_ = + com.google.privacy.dlp.v2.StoredInfoTypeConfig.newBuilder(config_).mergeFrom(value).buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + configBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public Builder clearConfig() { + if (configBuilder_ == null) { + config_ = null; + onChanged(); + } else { + config_ = null; + configBuilder_ = null; + } + + return this; + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder getConfigBuilder() { + + onChanged(); + return getConfigFieldBuilder().getBuilder(); + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + public com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder() { + if (configBuilder_ != null) { + return configBuilder_.getMessageOrBuilder(); + } else { + return config_ == null ? + com.google.privacy.dlp.v2.StoredInfoTypeConfig.getDefaultInstance() : config_; + } + } + /** + *
+     * Updated configuration for the storedInfoType. If not provided, a new
+     * version of the storedInfoType will be created with the existing
+     * configuration.
+     * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder> + getConfigFieldBuilder() { + if (configBuilder_ == null) { + configBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.privacy.dlp.v2.StoredInfoTypeConfig, com.google.privacy.dlp.v2.StoredInfoTypeConfig.Builder, com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder>( + getConfig(), + getParentForChildren(), + isClean()); + config_ = null; + } + return configBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> updateMaskBuilder_; + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask( + com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null ? + com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + } + /** + *
+     * Mask to control which fields get updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, com.google.protobuf.FieldMask.Builder, com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), + getParentForChildren(), + isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFieldsProto3(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + } + + // @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + private static final com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest(); + } + + public static com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateStoredInfoTypeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateStoredInfoTypeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.privacy.dlp.v2.UpdateStoredInfoTypeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequestOrBuilder.java new file mode 100644 index 000000000000..45c5795d79ea --- /dev/null +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/java/com/google/privacy/dlp/v2/UpdateStoredInfoTypeRequestOrBuilder.java @@ -0,0 +1,87 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/privacy/dlp/v2/dlp.proto + +package com.google.privacy.dlp.v2; + +public interface UpdateStoredInfoTypeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.privacy.dlp.v2.UpdateStoredInfoTypeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Resource name of organization and storedInfoType to be updated, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + *
+   * Resource name of organization and storedInfoType to be updated, for
+   * example `organizations/433245324/storedInfoTypes/432452342` or
+   * projects/project-id/storedInfoTypes/432452342.
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + boolean hasConfig(); + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfig getConfig(); + /** + *
+   * Updated configuration for the storedInfoType. If not provided, a new
+   * version of the storedInfoType will be created with the existing
+   * configuration.
+   * 
+ * + * .google.privacy.dlp.v2.StoredInfoTypeConfig config = 2; + */ + com.google.privacy.dlp.v2.StoredInfoTypeConfigOrBuilder getConfigOrBuilder(); + + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + boolean hasUpdateMask(); + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + *
+   * Mask to control which fields get updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/dlp.proto b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/dlp.proto index 4b151b3ed685..fdf835822747 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/dlp.proto +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/dlp.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -333,6 +333,71 @@ service DlpService { body: "*" }; } + + // Creates a pre-built stored infoType to be used for inspection. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + post: "/v2/{parent=organizations/*}/storedInfoTypes" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*}/storedInfoTypes" + body: "*" + } + }; + } + + // Updates the stored infoType by creating a new version. The existing version + // will continue to be used until the new version is ready. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + patch: "/v2/{name=organizations/*/storedInfoTypes/*}" + body: "*" + additional_bindings { + patch: "/v2/{name=projects/*/storedInfoTypes/*}" + body: "*" + } + }; + } + + // Gets a stored infoType. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) { + option (google.api.http) = { + get: "/v2/{name=organizations/*/storedInfoTypes/*}" + additional_bindings { + get: "/v2/{name=projects/*/storedInfoTypes/*}" + } + }; + } + + // Lists stored infoTypes. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) { + option (google.api.http) = { + get: "/v2/{parent=organizations/*}/storedInfoTypes" + additional_bindings { + get: "/v2/{parent=projects/*}/storedInfoTypes" + } + }; + } + + // Deletes a stored infoType. + // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to + // learn more. + rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=organizations/*/storedInfoTypes/*}" + additional_bindings { + delete: "/v2/{name=projects/*/storedInfoTypes/*}" + } + }; + } } // Configuration description of the scanning process. @@ -375,6 +440,11 @@ message InspectConfig { // When no InfoTypes or CustomInfoTypes are specified in a request, the // system may automatically choose what detectors to run. By default this may // be all types, but may change over time as detectors are updated. + // + // The special InfoType name "ALL_BASIC" can be used to trigger all detectors, + // but may change over time as new InfoTypes are added. If you need precise + // control and predictability as to what detectors are run you should specify + // specific InfoTypes listed in the reference. repeated InfoType info_types = 1; // Only returns findings equal or above this threshold. The default is @@ -2597,6 +2667,157 @@ message DeleteDeidentifyTemplateRequest { string name = 1; } +// Configuration for a custom dictionary created from a data source of any size +// up to the maximum size defined in the +// [limits](https://cloud.google.com/dlp/limits) page. The artifacts of +// dictionary creation are stored in the specified Google Cloud Storage +// location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries +// that satisfy the size requirements. +message LargeCustomDictionaryConfig { + // Location to store dictionary artifacts in Google Cloud Storage. These files + // will only be accessible by project owners and the DLP API. If any of these + // artifacts are modified, the dictionary is considered invalid and can no + // longer be used. + CloudStoragePath output_path = 1; + + oneof source { + // Set of files containing newline-delimited lists of dictionary phrases. + CloudStorageFileSet cloud_storage_file_set = 2; + + // Field in a BigQuery table where each cell represents a dictionary phrase. + BigQueryField big_query_field = 3; + } +} + +// Configuration for a StoredInfoType. +message StoredInfoTypeConfig { + // Display name of the StoredInfoType (max 256 characters). + string display_name = 1; + + // Description of the StoredInfoType (max 256 characters). + string description = 2; + + oneof type { + // StoredInfoType where findings are defined by a dictionary of phrases. + LargeCustomDictionaryConfig large_custom_dictionary = 3; + } +} + +// Version of a StoredInfoType, including the configuration used to build it, +// create timestamp, and current state. +message StoredInfoTypeVersion { + // StoredInfoType configuration. + StoredInfoTypeConfig config = 1; + + // Create timestamp of the version. Read-only, determined by the system + // when the version is created. + google.protobuf.Timestamp create_time = 2; + + // Stored info type version state. Read-only, updated by the system + // during dictionary creation. + StoredInfoTypeState state = 3; + + // Errors that occurred when creating this storedInfoType version, or + // anomalies detected in the storedInfoType data that render it unusable. Only + // the five most recent errors will be displayed, with the most recent error + // appearing first. + //

For example, some of the data for stored custom dictionaries is put in + // the user's Google Cloud Storage bucket, and if this data is modified or + // deleted by the user or another system, the dictionary becomes invalid. + //

If any errors occur, fix the problem indicated by the error message and + // use the UpdateStoredInfoType API method to create another version of the + // storedInfoType to continue using it, reusing the same `config` if it was + // not the source of the error. + repeated Error errors = 4; +} + +// StoredInfoType resource message that contains information about the current +// version and any pending updates. +message StoredInfoType { + // Resource name. + string name = 1; + + // Current version of the stored info type. + StoredInfoTypeVersion current_version = 2; + + // Pending versions of the stored info type. Empty if no versions are + // pending. + repeated StoredInfoTypeVersion pending_versions = 3; +} + +// Request message for CreateStoredInfoType. +message CreateStoredInfoTypeRequest { + // The parent resource name, for example projects/my-project-id or + // organizations/my-org-id. + string parent = 1; + + // Configuration of the storedInfoType to create. + StoredInfoTypeConfig config = 2; + + // The storedInfoType ID can contain uppercase and lowercase letters, + // numbers, and hyphens; that is, it must match the regular + // expression: `[a-zA-Z\\d-]+`. The maximum length is 100 + // characters. Can be empty to allow the system to generate one. + string stored_info_type_id = 3; +} + +// Request message for UpdateStoredInfoType. +message UpdateStoredInfoTypeRequest { + // Resource name of organization and storedInfoType to be updated, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1; + + // Updated configuration for the storedInfoType. If not provided, a new + // version of the storedInfoType will be created with the existing + // configuration. + StoredInfoTypeConfig config = 2; + + // Mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 3; +} + +// Request message for GetStoredInfoType. +message GetStoredInfoTypeRequest { + // Resource name of the organization and storedInfoType to be read, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1; +} + +// Request message for ListStoredInfoTypes. +message ListStoredInfoTypesRequest { + // The parent resource name, for example projects/my-project-id or + // organizations/my-org-id. + string parent = 1; + + // Optional page token to continue retrieval. Comes from previous call + // to `ListStoredInfoTypes`. + string page_token = 2; + + // Optional size of the page, can be limited by server. If zero server returns + // a page of max size 100. + int32 page_size = 3; +} + +// Response message for ListStoredInfoTypes. +message ListStoredInfoTypesResponse { + // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest. + repeated StoredInfoType stored_info_types = 1; + + // If the next page is available then the next page token to be used + // in following ListStoredInfoTypes request. + string next_page_token = 2; +} + +// Request message for DeleteStoredInfoType. +message DeleteStoredInfoTypeRequest { + // Resource name of the organization and storedInfoType to be deleted, for + // example `organizations/433245324/storedInfoTypes/432452342` or + // projects/project-id/storedInfoTypes/432452342. + string name = 1; +} + // Options describing which parts of the provided content should be scanned. enum ContentOption { // Includes entire content of a file or a data stream. @@ -2656,3 +2877,23 @@ enum DlpJobType { // The job executed a Risk Analysis computation. RISK_ANALYSIS_JOB = 2; } + +// State of a StoredInfoType version. +enum StoredInfoTypeState { + STORED_INFO_TYPE_STATE_UNSPECIFIED = 0; + + // StoredInfoType version is being created. + PENDING = 1; + + // StoredInfoType version is ready for use. + READY = 2; + + // StoredInfoType creation failed. All relevant error messages are returned in + // the `StoredInfoTypeVersion` message. + FAILED = 3; + + // StoredInfoType is no longer valid because artifacts stored in + // user-controlled storage were modified. To fix an invalid StoredInfoType, + // use the `UpdateStoredInfoType` method to create a new version. + INVALID = 4; +} diff --git a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/storage.proto b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/storage.proto index 5c2ca5031a49..54c47e9eb985 100644 --- a/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/storage.proto +++ b/google-api-grpc/proto-google-cloud-dlp-v2/src/main/proto/google/privacy/dlp/v2/storage.proto @@ -1,4 +1,4 @@ -// Copyright 2018 Google Inc. +// 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. @@ -36,6 +36,18 @@ message InfoType { string name = 1; } +// A reference to a StoredInfoType to use with scanning. +message StoredType { + // Resource name of the requested `StoredInfoType`, for example + // `organizations/433245324/storedInfoTypes/432452342` or + // `projects/project-id/storedInfoTypes/432452342`. + string name = 1; + + // Timestamp indicating when the version of the `StoredInfoType` used for + // inspection was created. Output-only field, populated by the system. + google.protobuf.Timestamp create_time = 2; +} + // Custom information type provided by the user. Used to find domain-specific // sensitive information configurable to the data in question. message CustomInfoType { @@ -57,7 +69,11 @@ message CustomInfoType { // // Dictionary words containing a large number of characters that are not // letters or digits may result in unexpected findings because such characters - // are treated as whitespace. + // are treated as whitespace. The + // [limits](https://cloud.google.com/dlp/limits) page contains details about + // the size limits of dictionaries. For dictionaries that do not fit within + // these constraints, consider using `LargeCustomDictionaryConfig` in the + // `StoredInfoType` API. message Dictionary { // Message defining a list of words or phrases to search for in the data. message WordList { @@ -173,6 +189,10 @@ message CustomInfoType { // Message for detecting output from deidentification transformations that // support reversing. SurrogateType surrogate_type = 4; + + // Load an existing `StoredInfoType` resource for use in + // `InspectDataSource`. Not currently supported in `InspectContent`. + StoredType stored_type = 5; } // Set of detection rules to apply to all findings of this CustomInfoType. @@ -244,9 +264,16 @@ message CloudStorageOptions { FileSet file_set = 1; // Max number of bytes to scan from a file. If a scanned file's size is bigger - // than this value then the rest of the bytes are omitted. + // than this value then the rest of the bytes are omitted. Only one + // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. int64 bytes_limit_per_file = 4; + // Max percentage of bytes to scan from a file. The rest are omitted. The + // number of bytes scanned is rounded down. Must be between 0 and 100, + // inclusively. Both 0 and 100 means no limit. Defaults to 0. Only one + // of bytes_limit_per_file and bytes_limit_per_file_percent can be specified. + int32 bytes_limit_per_file_percent = 8; + // List of file type groups to include in the scan. // If empty, all files are scanned and available data format processors // are applied. @@ -260,6 +287,13 @@ message CloudStorageOptions { int32 files_limit_percent = 7; } +// Message representing a set of files in Cloud Storage. +message CloudStorageFileSet { + // The url, in the format `gs:///`. Trailing wildcard in the + // path is allowed. + string url = 1; +} + // Message representing a single file or path in Cloud Storage. message CloudStoragePath { // A url representing a file or path (no wildcards) in Cloud Storage. @@ -291,9 +325,17 @@ message BigQueryOptions { // Max number of rows to scan. If the table has more rows than this value, the // rest of the rows are omitted. If not set, or if set to 0, all rows will be - // scanned. Cannot be used in conjunction with TimespanConfig. + // scanned. Only one of rows_limit and rows_limit_percent can be specified. + // Cannot be used in conjunction with TimespanConfig. int64 rows_limit = 3; + // Max percentage of rows to scan. The rest are omitted. The number of rows + // scanned is rounded down. Must be between 0 and 100, inclusively. Both 0 and + // 100 means no limit. Defaults to 0. Only one of rows_limit and + // rows_limit_percent can be specified. Cannot be used in conjunction with + // TimespanConfig. + int32 rows_limit_percent = 6; + SampleMethod sample_method = 4; } @@ -302,15 +344,17 @@ message StorageConfig { // Configuration of the timespan of the items to include in scanning. // Currently only supported when inspecting Google Cloud Storage and BigQuery. message TimespanConfig { - // Exclude files older than this value. + // Exclude files or rows older than this value. google.protobuf.Timestamp start_time = 1; - // Exclude files newer than this value. + // Exclude files or rows newer than this value. // If set to zero, no upper time limit is applied. google.protobuf.Timestamp end_time = 2; // Specification of the field containing the timestamp of scanned items. - // Required for data sources like Datastore or BigQuery. + // Used for data sources like Datastore or BigQuery. + // If not specified for BigQuery, table last modification timestamp + // is checked against given time span. // The valid data types of the timestamp field are: // for BigQuery - timestamp, date, datetime; // for Datastore - timestamp. @@ -429,6 +473,15 @@ message BigQueryTable { string table_id = 3; } +// Message defining a field of a BigQuery table. +message BigQueryField { + // Source table of the field. + BigQueryTable table = 1; + + // Designated field in the BigQuery table. + FieldId field = 2; +} + // An entity in a dataset is a field or set of fields that correspond to a // single person. For example, in medical records the `EntityId` might be a // patient identifier, or for financial records it might be an account diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 4565babf7148..111861e752e8 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -341,6 +341,27 @@ grpc-google-cloud-container-v1 0.22.1-SNAPSHOT + + com.google.cloud + google-cloud-containeranalysis + 0.57.1-beta-SNAPSHOT + + + com.google.cloud + google-cloud-containeranalysis + 0.57.1-beta-SNAPSHOT + test-jar + + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-containeranalysis-v1beta1 + 0.22.1-SNAPSHOT + com.google.cloud google-cloud-contrib diff --git a/google-cloud-clients/google-cloud-containeranalysis/README.md b/google-cloud-clients/google-cloud-containeranalysis/README.md new file mode 100644 index 000000000000..16d015a0c680 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/README.md @@ -0,0 +1,99 @@ +Google Cloud Java Client for Container Analysis +====================================== + +Java idiomatic client for [Google Cloud Container Analysis][cloud-containeranalysis]. + +[![CircleCI](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master.svg?style=shield)](https://circleci.com/gh/GoogleCloudPlatform/google-cloud-java/tree/master) +[![Coverage Status](https://coveralls.io/repos/GoogleCloudPlatform/google-cloud-java/badge.svg?branch=master)](https://coveralls.io/r/GoogleCloudPlatform/google-cloud-java?branch=master) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-containeranalysis.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-containeranalysis.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) +[![Dependency Status](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772/badge.svg?style=flat)](https://www.versioneye.com/user/projects/58fe4c8d6ac171426c414772) + +- [Product Documentation][containeranalysis-product-docs] +- [Client Library Documentation][containeranalysis-client-lib-docs] + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-containeranalysis:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-containeranalysis + 0.57.0-beta + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-containeranalysis:0.57.0-beta' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-containeranalysis" % "0.57.0-beta" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/GoogleCloudPlatform/google-cloud-java#authentication) section in the base directory's README. + +About Google Cloud Natural Container Analysis +---------------------------- + +Google [Cloud Container Analysis API][cloud-containeranalysis] is an implementation of the Grafeas API, which stores, and enables querying and retrieval of critical metadata about all of your software artifacts. + +See the [Container Analysis client library docs][containeranalysis-client-lib-docs] to learn how to use this Cloud Container Analysis API Client Library. + +Getting Started +--------------- +#### Prerequisites +You will need a [Google Developers Console](https://console.developers.google.com/) project with the Container Analysis API enabled. [Follow these instructions](https://cloud.google.com/docs/authentication#preparation) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-containeranalysis` library. See the [Quickstart](#quickstart) section to add `google-cloud-containeranalysis` as a dependency in your code. + +Troubleshooting +--------------- + +To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/troubleshooting/readme.md#troubleshooting). + +Transport +--------- +Container Analysis uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version one (``1.y.z``), which means that the public API should be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/GoogleCloudPlatform/gcloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/GoogleCloudPlatform/google-cloud-java/blob/master/LICENSE +[cloud-platform]: https://cloud.google.com/ +[cloud-containeranalysis]: https://cloud.google.com/container-analysis/ +[containeranalysis-product-docs]: https://cloud.google.com/container-registry/docs/container-analysis +[containeranalysis-client-lib-docs]: https://googlecloudplatform.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/devtools/containeranalysis/v1beta1/package-summary.html diff --git a/google-cloud-clients/google-cloud-containeranalysis/pom.xml b/google-cloud-clients/google-cloud-containeranalysis/pom.xml new file mode 100644 index 000000000000..92ba0bd1cc16 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/pom.xml @@ -0,0 +1,65 @@ + + + 4.0.0 + google-cloud-containeranalysis + 0.57.1-beta-SNAPSHOT + jar + Google Cloud Container Analysis + https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-clients/google-cloud-containeranalysis + + + Java idiomatic client for Google Cloud Container Analysis. + + + com.google.cloud + google-cloud-clients + 0.57.1-alpha-SNAPSHOT + + + google-cloud-containeranalysis + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-containeranalysis-v1beta1 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + junit + junit + test + + + com.google.api.grpc + grpc-google-cloud-containeranalysis-v1beta1 + test + + + com.google.api + gax-grpc + testlib + test + + + diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java new file mode 100644 index 000000000000..e26caf301914 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Client.java @@ -0,0 +1,867 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1Stub; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1StubSettings; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+ *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+ *   Policy policy = Policy.newBuilder().build();
+ *   Policy response = containerAnalysisV1Beta1Client.setIamPolicy(formattedResource, policy);
+ * }
+ * 
+ * 
+ * + *

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

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

To customize credentials: + * + *

+ * 
+ * ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
+ *     ContainerAnalysisV1Beta1Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
+ *     ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings =
+ *     ContainerAnalysisV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client =
+ *     ContainerAnalysisV1Beta1Client.create(containerAnalysisV1Beta1Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisV1Beta1Client implements BackgroundResource { + private final ContainerAnalysisV1Beta1Settings settings; + private final ContainerAnalysisV1Beta1Stub stub; + + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private static final PathTemplate NOTE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private static final PathTemplate SCAN_CONFIG_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/scanConfigs/{scan_config}"); + + /** Formats a string containing the fully-qualified path to represent a project resource. */ + public static final String formatProjectName(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** Formats a string containing the fully-qualified path to represent a note resource. */ + public static final String formatNoteName(String project, String note) { + return NOTE_PATH_TEMPLATE.instantiate( + "project", project, + "note", note); + } + + /** Formats a string containing the fully-qualified path to represent a scan_config resource. */ + public static final String formatScanConfigName(String project, String scanConfig) { + return SCAN_CONFIG_PATH_TEMPLATE.instantiate( + "project", project, + "scan_config", scanConfig); + } + + /** Parses the project from the given fully-qualified path which represents a project resource. */ + public static final String parseProjectFromProjectName(String projectName) { + return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); + } + + /** Parses the project from the given fully-qualified path which represents a note resource. */ + public static final String parseProjectFromNoteName(String noteName) { + return NOTE_PATH_TEMPLATE.parse(noteName).get("project"); + } + + /** Parses the note from the given fully-qualified path which represents a note resource. */ + public static final String parseNoteFromNoteName(String noteName) { + return NOTE_PATH_TEMPLATE.parse(noteName).get("note"); + } + + /** + * Parses the project from the given fully-qualified path which represents a scan_config resource. + */ + public static final String parseProjectFromScanConfigName(String scanConfigName) { + return SCAN_CONFIG_PATH_TEMPLATE.parse(scanConfigName).get("project"); + } + + /** + * Parses the scan_config from the given fully-qualified path which represents a scan_config + * resource. + */ + public static final String parseScanConfigFromScanConfigName(String scanConfigName) { + return SCAN_CONFIG_PATH_TEMPLATE.parse(scanConfigName).get("scan_config"); + } + + /** Constructs an instance of ContainerAnalysisV1Beta1Client with default settings. */ + public static final ContainerAnalysisV1Beta1Client create() throws IOException { + return create(ContainerAnalysisV1Beta1Settings.newBuilder().build()); + } + + /** + * Constructs an instance of ContainerAnalysisV1Beta1Client, using the given settings. The + * channels are created based on the settings passed in, or defaults for any settings that are not + * set. + */ + public static final ContainerAnalysisV1Beta1Client create( + ContainerAnalysisV1Beta1Settings settings) throws IOException { + return new ContainerAnalysisV1Beta1Client(settings); + } + + /** + * Constructs an instance of ContainerAnalysisV1Beta1Client, using the given stub for making + * calls. This is for advanced usage - prefer to use ContainerAnalysisV1Beta1Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final ContainerAnalysisV1Beta1Client create(ContainerAnalysisV1Beta1Stub stub) { + return new ContainerAnalysisV1Beta1Client(stub); + } + + /** + * Constructs an instance of ContainerAnalysisV1Beta1Client, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Settings settings) + throws IOException { + this.settings = settings; + this.stub = ((ContainerAnalysisV1Beta1StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected ContainerAnalysisV1Beta1Client(ContainerAnalysisV1Beta1Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final ContainerAnalysisV1Beta1Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ContainerAnalysisV1Beta1Stub 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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   Policy response = containerAnalysisV1Beta1Client.setIamPolicy(formattedResource, policy);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being specified. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @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) { + NOTE_PATH_TEMPLATE.validate(resource, "setIamPolicy"); + 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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .setPolicy(policy)
+   *     .build();
+   *   Policy response = containerAnalysisV1Beta1Client.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Policy policy = Policy.newBuilder().build();
+   *   SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .setPolicy(policy)
+   *     .build();
+   *   ApiFuture<Policy> future = containerAnalysisV1Beta1Client.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Policy response = containerAnalysisV1Beta1Client.getIamPolicy(formattedResource);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy is being requested. `resource` is + * usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(String resource) { + NOTE_PATH_TEMPLATE.validate(resource, "getIamPolicy"); + 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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .build();
+   *   Policy response = containerAnalysisV1Beta1Client.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 + */ + private 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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .build();
+   *   ApiFuture<Policy> future = containerAnalysisV1Beta1Client.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsResponse response = containerAnalysisV1Beta1Client.testIamPermissions(formattedResource, permissions);
+   * }
+   * 
+ * + * @param resource REQUIRED: The resource for which the policy detail is being requested. + * `resource` is usually specified as a path. For example, a Project resource is specified as + * `projects/{project}`. + * @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) { + NOTE_PATH_TEMPLATE.validate(resource, "testIamPermissions"); + 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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   TestIamPermissionsResponse response = containerAnalysisV1Beta1Client.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 (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   List<String> permissions = new ArrayList<>();
+   *   TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
+   *     .setResource(formattedResource)
+   *     .addAllPermissions(permissions)
+   *     .build();
+   *   ApiFuture<TestIamPermissionsResponse> future = containerAnalysisV1Beta1Client.testIamPermissionsCallable().futureCall(request);
+   *   // Do something
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   ScanConfig response = containerAnalysisV1Beta1Client.getScanConfig(formattedName);
+   * }
+   * 
+ * + * @param name The name of the scan configuration in the form of + * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ScanConfig getScanConfig(String name) { + SCAN_CONFIG_PATH_TEMPLATE.validate(name, "getScanConfig"); + GetScanConfigRequest request = GetScanConfigRequest.newBuilder().setName(name).build(); + return getScanConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   GetScanConfigRequest request = GetScanConfigRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ScanConfig response = containerAnalysisV1Beta1Client.getScanConfig(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 + */ + private final ScanConfig getScanConfig(GetScanConfigRequest request) { + return getScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   GetScanConfigRequest request = GetScanConfigRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<ScanConfig> future = containerAnalysisV1Beta1Client.getScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   ScanConfig response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getScanConfigCallable() { + return stub.getScanConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists scan configurations for the specified project. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String filter = "";
+   *   for (ScanConfig element : containerAnalysisV1Beta1Client.listScanConfigs(formattedParent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The name of the project to list scan configurations for in the form of + * `projects/[PROJECT_ID]`. + * @param filter The filter expression. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListScanConfigsPagedResponse listScanConfigs(String parent, String filter) { + PROJECT_PATH_TEMPLATE.validate(parent, "listScanConfigs"); + ListScanConfigsRequest request = + ListScanConfigsRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listScanConfigs(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists scan configurations for the specified project. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (ScanConfig element : containerAnalysisV1Beta1Client.listScanConfigs(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest request) { + return listScanConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists scan configurations for the specified project. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListScanConfigsPagedResponse> future = containerAnalysisV1Beta1Client.listScanConfigsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ScanConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScanConfigsPagedCallable() { + return stub.listScanConfigsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists scan configurations for the specified project. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListScanConfigsResponse response = containerAnalysisV1Beta1Client.listScanConfigsCallable().call(request);
+   *     for (ScanConfig element : response.getScanConfigsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScanConfigsCallable() { + return stub.listScanConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   ScanConfig scanConfig = ScanConfig.newBuilder().build();
+   *   ScanConfig response = containerAnalysisV1Beta1Client.updateScanConfig(formattedName, scanConfig);
+   * }
+   * 
+ * + * @param name The name of the scan configuration in the form of + * `projects/[PROJECT_ID]/scanConfigs/[SCAN_CONFIG_ID]`. + * @param scanConfig The updated scan configuration. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ScanConfig updateScanConfig(String name, ScanConfig scanConfig) { + SCAN_CONFIG_PATH_TEMPLATE.validate(name, "updateScanConfig"); + UpdateScanConfigRequest request = + UpdateScanConfigRequest.newBuilder().setName(name).setScanConfig(scanConfig).build(); + return updateScanConfig(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   ScanConfig scanConfig = ScanConfig.newBuilder().build();
+   *   UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setScanConfig(scanConfig)
+   *     .build();
+   *   ScanConfig response = containerAnalysisV1Beta1Client.updateScanConfig(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 ScanConfig updateScanConfig(UpdateScanConfigRequest request) { + return updateScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified scan configuration. + * + *

Sample code: + * + *


+   * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+   *   String formattedName = ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]");
+   *   ScanConfig scanConfig = ScanConfig.newBuilder().build();
+   *   UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setScanConfig(scanConfig)
+   *     .build();
+   *   ApiFuture<ScanConfig> future = containerAnalysisV1Beta1Client.updateScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   ScanConfig response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateScanConfigCallable() { + return stub.updateScanConfigCallable(); + } + + @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); + } + + public static class ListScanConfigsPagedResponse + extends AbstractPagedListResponse< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig, ListScanConfigsPage, + ListScanConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListScanConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListScanConfigsPagedResponse apply(ListScanConfigsPage input) { + return new ListScanConfigsPagedResponse(input); + } + }); + } + + private ListScanConfigsPagedResponse(ListScanConfigsPage page) { + super(page, ListScanConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListScanConfigsPage + extends AbstractPage< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig, ListScanConfigsPage> { + + private ListScanConfigsPage( + PageContext context, + ListScanConfigsResponse response) { + super(context, response); + } + + private static ListScanConfigsPage createEmptyPage() { + return new ListScanConfigsPage(null, null); + } + + @Override + protected ListScanConfigsPage createPage( + PageContext context, + ListScanConfigsResponse response) { + return new ListScanConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListScanConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig, ListScanConfigsPage, + ListScanConfigsFixedSizeCollection> { + + private ListScanConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListScanConfigsFixedSizeCollection createEmptyCollection() { + return new ListScanConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListScanConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListScanConfigsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Settings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Settings.java new file mode 100644 index 000000000000..1842c441f1b9 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1Settings.java @@ -0,0 +1,247 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client.ListScanConfigsPagedResponse; + +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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.ContainerAnalysisV1Beta1StubSettings; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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 ContainerAnalysisV1Beta1Client}. + * + *

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: + * + *

+ * 
+ * ContainerAnalysisV1Beta1Settings.Builder containerAnalysisV1Beta1SettingsBuilder =
+ *     ContainerAnalysisV1Beta1Settings.newBuilder();
+ * containerAnalysisV1Beta1SettingsBuilder.setIamPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ContainerAnalysisV1Beta1Settings containerAnalysisV1Beta1Settings = containerAnalysisV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisV1Beta1Settings + extends ClientSettings { + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + /** Returns the object with the settings used for calls to getScanConfig. */ + public UnaryCallSettings getScanConfigSettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).getScanConfigSettings(); + } + + /** Returns the object with the settings used for calls to listScanConfigs. */ + public PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).listScanConfigsSettings(); + } + + /** Returns the object with the settings used for calls to updateScanConfig. */ + public UnaryCallSettings updateScanConfigSettings() { + return ((ContainerAnalysisV1Beta1StubSettings) getStubSettings()).updateScanConfigSettings(); + } + + public static final ContainerAnalysisV1Beta1Settings create( + ContainerAnalysisV1Beta1StubSettings stub) throws IOException { + return new ContainerAnalysisV1Beta1Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return ContainerAnalysisV1Beta1StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return ContainerAnalysisV1Beta1StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return ContainerAnalysisV1Beta1StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return ContainerAnalysisV1Beta1StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return ContainerAnalysisV1Beta1StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return ContainerAnalysisV1Beta1StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ContainerAnalysisV1Beta1StubSettings.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 ContainerAnalysisV1Beta1Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for ContainerAnalysisV1Beta1Settings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(ContainerAnalysisV1Beta1StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(ContainerAnalysisV1Beta1StubSettings.newBuilder()); + } + + protected Builder(ContainerAnalysisV1Beta1Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(ContainerAnalysisV1Beta1StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public ContainerAnalysisV1Beta1StubSettings.Builder getStubSettingsBuilder() { + return ((ContainerAnalysisV1Beta1StubSettings.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(); + } + + /** Returns the builder for the settings used for calls to getScanConfig. */ + public UnaryCallSettings.Builder getScanConfigSettings() { + return getStubSettingsBuilder().getScanConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listScanConfigs. */ + public PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return getStubSettingsBuilder().listScanConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to updateScanConfig. */ + public UnaryCallSettings.Builder + updateScanConfigSettings() { + return getStubSettingsBuilder().updateScanConfigSettings(); + } + + @Override + public ContainerAnalysisV1Beta1Settings build() throws IOException { + return new ContainerAnalysisV1Beta1Settings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java new file mode 100644 index 000000000000..c55919ba658b --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Client.java @@ -0,0 +1,1731 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.pathtemplate.PathTemplate; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.GrafeasV1Beta1Stub; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.GrafeasV1Beta1StubSettings; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: [Grafeas](grafeas.io) API. + * + *

Retrieves analysis results of Cloud components such as Docker container images. + * + *

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 (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+ *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+ *   Occurrence response = grafeasV1Beta1Client.getOccurrence(formattedName);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the grafeasV1Beta1Client 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 GrafeasV1Beta1Settings to + * create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * GrafeasV1Beta1Settings grafeasV1Beta1Settings =
+ *     GrafeasV1Beta1Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * GrafeasV1Beta1Client grafeasV1Beta1Client =
+ *     GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * GrafeasV1Beta1Settings grafeasV1Beta1Settings =
+ *     GrafeasV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * GrafeasV1Beta1Client grafeasV1Beta1Client =
+ *     GrafeasV1Beta1Client.create(grafeasV1Beta1Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GrafeasV1Beta1Client implements BackgroundResource { + private final GrafeasV1Beta1Settings settings; + private final GrafeasV1Beta1Stub stub; + + private static final PathTemplate PROJECT_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private static final PathTemplate NOTE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/notes/{note}"); + + private static final PathTemplate OCCURRENCE_PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/occurrences/{occurrence}"); + + /** Formats a string containing the fully-qualified path to represent a project resource. */ + public static final String formatProjectName(String project) { + return PROJECT_PATH_TEMPLATE.instantiate("project", project); + } + + /** Formats a string containing the fully-qualified path to represent a note resource. */ + public static final String formatNoteName(String project, String note) { + return NOTE_PATH_TEMPLATE.instantiate( + "project", project, + "note", note); + } + + /** Formats a string containing the fully-qualified path to represent a occurrence resource. */ + public static final String formatOccurrenceName(String project, String occurrence) { + return OCCURRENCE_PATH_TEMPLATE.instantiate( + "project", project, + "occurrence", occurrence); + } + + /** Parses the project from the given fully-qualified path which represents a project resource. */ + public static final String parseProjectFromProjectName(String projectName) { + return PROJECT_PATH_TEMPLATE.parse(projectName).get("project"); + } + + /** Parses the project from the given fully-qualified path which represents a note resource. */ + public static final String parseProjectFromNoteName(String noteName) { + return NOTE_PATH_TEMPLATE.parse(noteName).get("project"); + } + + /** Parses the note from the given fully-qualified path which represents a note resource. */ + public static final String parseNoteFromNoteName(String noteName) { + return NOTE_PATH_TEMPLATE.parse(noteName).get("note"); + } + + /** + * Parses the project from the given fully-qualified path which represents a occurrence resource. + */ + public static final String parseProjectFromOccurrenceName(String occurrenceName) { + return OCCURRENCE_PATH_TEMPLATE.parse(occurrenceName).get("project"); + } + + /** + * Parses the occurrence from the given fully-qualified path which represents a occurrence + * resource. + */ + public static final String parseOccurrenceFromOccurrenceName(String occurrenceName) { + return OCCURRENCE_PATH_TEMPLATE.parse(occurrenceName).get("occurrence"); + } + + /** Constructs an instance of GrafeasV1Beta1Client with default settings. */ + public static final GrafeasV1Beta1Client create() throws IOException { + return create(GrafeasV1Beta1Settings.newBuilder().build()); + } + + /** + * Constructs an instance of GrafeasV1Beta1Client, 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 GrafeasV1Beta1Client create(GrafeasV1Beta1Settings settings) + throws IOException { + return new GrafeasV1Beta1Client(settings); + } + + /** + * Constructs an instance of GrafeasV1Beta1Client, using the given stub for making calls. This is + * for advanced usage - prefer to use GrafeasV1Beta1Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final GrafeasV1Beta1Client create(GrafeasV1Beta1Stub stub) { + return new GrafeasV1Beta1Client(stub); + } + + /** + * Constructs an instance of GrafeasV1Beta1Client, 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 GrafeasV1Beta1Client(GrafeasV1Beta1Settings settings) throws IOException { + this.settings = settings; + this.stub = ((GrafeasV1Beta1StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected GrafeasV1Beta1Client(GrafeasV1Beta1Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final GrafeasV1Beta1Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GrafeasV1Beta1Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   Occurrence response = grafeasV1Beta1Client.getOccurrence(formattedName);
+   * }
+   * 
+ * + * @param name The name of the occurrence in the form of + * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Occurrence getOccurrence(String name) { + OCCURRENCE_PATH_TEMPLATE.validate(name, "getOccurrence"); + GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder().setName(name).build(); + return getOccurrence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Occurrence response = grafeasV1Beta1Client.getOccurrence(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 + */ + private final Occurrence getOccurrence(GetOccurrenceRequest request) { + return getOccurrenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   GetOccurrenceRequest request = GetOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Occurrence> future = grafeasV1Beta1Client.getOccurrenceCallable().futureCall(request);
+   *   // Do something
+   *   Occurrence response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getOccurrenceCallable() { + return stub.getOccurrenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String filter = "";
+   *   for (Occurrence element : grafeasV1Beta1Client.listOccurrences(formattedParent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The name of the project to list occurrences for in the form of + * `projects/[PROJECT_ID]`. + * @param filter The filter expression. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListOccurrencesPagedResponse listOccurrences(String parent, String filter) { + PROJECT_PATH_TEMPLATE.validate(parent, "listOccurrences"); + ListOccurrencesRequest request = + ListOccurrencesRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listOccurrences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Occurrence element : grafeasV1Beta1Client.listOccurrences(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListOccurrencesPagedResponse listOccurrences(ListOccurrencesRequest request) { + return listOccurrencesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListOccurrencesPagedResponse> future = grafeasV1Beta1Client.listOccurrencesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Occurrence element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listOccurrencesPagedCallable() { + return stub.listOccurrencesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListOccurrencesRequest request = ListOccurrencesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListOccurrencesResponse response = grafeasV1Beta1Client.listOccurrencesCallable().call(request);
+   *     for (Occurrence element : response.getOccurrencesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listOccurrencesCallable() { + return stub.listOccurrencesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified occurrence. For example, use this method to delete an occurrence when the + * occurrence is no longer applicable for the given resource. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   grafeasV1Beta1Client.deleteOccurrence(formattedName);
+   * }
+   * 
+ * + * @param name The name of the occurrence in the form of + * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteOccurrence(String name) { + OCCURRENCE_PATH_TEMPLATE.validate(name, "deleteOccurrence"); + DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder().setName(name).build(); + deleteOccurrence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified occurrence. For example, use this method to delete an occurrence when the + * occurrence is no longer applicable for the given resource. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   grafeasV1Beta1Client.deleteOccurrence(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 + */ + private final void deleteOccurrence(DeleteOccurrenceRequest request) { + deleteOccurrenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified occurrence. For example, use this method to delete an occurrence when the + * occurrence is no longer applicable for the given resource. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   DeleteOccurrenceRequest request = DeleteOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = grafeasV1Beta1Client.deleteOccurrenceCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteOccurrenceCallable() { + return stub.deleteOccurrenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   Occurrence response = grafeasV1Beta1Client.createOccurrence(formattedParent, occurrence);
+   * }
+   * 
+ * + * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the + * occurrence is to be created. + * @param occurrence The occurrence to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Occurrence createOccurrence(String parent, Occurrence occurrence) { + PROJECT_PATH_TEMPLATE.validate(parent, "createOccurrence"); + CreateOccurrenceRequest request = + CreateOccurrenceRequest.newBuilder().setParent(parent).setOccurrence(occurrence).build(); + return createOccurrence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   CreateOccurrenceRequest request = CreateOccurrenceRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setOccurrence(occurrence)
+   *     .build();
+   *   Occurrence response = grafeasV1Beta1Client.createOccurrence(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 Occurrence createOccurrence(CreateOccurrenceRequest request) { + return createOccurrenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   CreateOccurrenceRequest request = CreateOccurrenceRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setOccurrence(occurrence)
+   *     .build();
+   *   ApiFuture<Occurrence> future = grafeasV1Beta1Client.createOccurrenceCallable().futureCall(request);
+   *   // Do something
+   *   Occurrence response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createOccurrenceCallable() { + return stub.createOccurrenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new occurrences in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   List<Occurrence> occurrences = new ArrayList<>();
+   *   BatchCreateOccurrencesResponse response = grafeasV1Beta1Client.batchCreateOccurrences(formattedParent, occurrences);
+   * }
+   * 
+ * + * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the + * occurrences are to be created. + * @param occurrences The occurrences to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchCreateOccurrencesResponse batchCreateOccurrences( + String parent, List occurrences) { + PROJECT_PATH_TEMPLATE.validate(parent, "batchCreateOccurrences"); + BatchCreateOccurrencesRequest request = + BatchCreateOccurrencesRequest.newBuilder() + .setParent(parent) + .addAllOccurrences(occurrences) + .build(); + return batchCreateOccurrences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new occurrences in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   List<Occurrence> occurrences = new ArrayList<>();
+   *   BatchCreateOccurrencesRequest request = BatchCreateOccurrencesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .addAllOccurrences(occurrences)
+   *     .build();
+   *   BatchCreateOccurrencesResponse response = grafeasV1Beta1Client.batchCreateOccurrences(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 BatchCreateOccurrencesResponse batchCreateOccurrences( + BatchCreateOccurrencesRequest request) { + return batchCreateOccurrencesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new occurrences in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   List<Occurrence> occurrences = new ArrayList<>();
+   *   BatchCreateOccurrencesRequest request = BatchCreateOccurrencesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .addAllOccurrences(occurrences)
+   *     .build();
+   *   ApiFuture<BatchCreateOccurrencesResponse> future = grafeasV1Beta1Client.batchCreateOccurrencesCallable().futureCall(request);
+   *   // Do something
+   *   BatchCreateOccurrencesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchCreateOccurrencesCallable() { + return stub.batchCreateOccurrencesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Occurrence response = grafeasV1Beta1Client.updateOccurrence(formattedName, occurrence, updateMask);
+   * }
+   * 
+ * + * @param name The name of the occurrence in the form of + * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * @param occurrence The updated occurrence. + * @param updateMask The fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Occurrence updateOccurrence( + String name, Occurrence occurrence, FieldMask updateMask) { + OCCURRENCE_PATH_TEMPLATE.validate(name, "updateOccurrence"); + UpdateOccurrenceRequest request = + UpdateOccurrenceRequest.newBuilder() + .setName(name) + .setOccurrence(occurrence) + .setUpdateMask(updateMask) + .build(); + return updateOccurrence(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setOccurrence(occurrence)
+   *     .build();
+   *   Occurrence response = grafeasV1Beta1Client.updateOccurrence(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 Occurrence updateOccurrence(UpdateOccurrenceRequest request) { + return updateOccurrenceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified occurrence. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   Occurrence occurrence = Occurrence.newBuilder().build();
+   *   UpdateOccurrenceRequest request = UpdateOccurrenceRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setOccurrence(occurrence)
+   *     .build();
+   *   ApiFuture<Occurrence> future = grafeasV1Beta1Client.updateOccurrenceCallable().futureCall(request);
+   *   // Do something
+   *   Occurrence response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateOccurrenceCallable() { + return stub.updateOccurrenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the note attached to the specified occurrence. Consumer projects can use this method to + * get a note that belongs to a provider project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   Note response = grafeasV1Beta1Client.getOccurrenceNote(formattedName);
+   * }
+   * 
+ * + * @param name The name of the occurrence in the form of + * `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Note getOccurrenceNote(String name) { + OCCURRENCE_PATH_TEMPLATE.validate(name, "getOccurrenceNote"); + GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder().setName(name).build(); + return getOccurrenceNote(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the note attached to the specified occurrence. Consumer projects can use this method to + * get a note that belongs to a provider project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Note response = grafeasV1Beta1Client.getOccurrenceNote(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 + */ + private final Note getOccurrenceNote(GetOccurrenceNoteRequest request) { + return getOccurrenceNoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the note attached to the specified occurrence. Consumer projects can use this method to + * get a note that belongs to a provider project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+   *   GetOccurrenceNoteRequest request = GetOccurrenceNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Note> future = grafeasV1Beta1Client.getOccurrenceNoteCallable().futureCall(request);
+   *   // Do something
+   *   Note response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getOccurrenceNoteCallable() { + return stub.getOccurrenceNoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Note response = grafeasV1Beta1Client.getNote(formattedName);
+   * }
+   * 
+ * + * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Note getNote(String name) { + NOTE_PATH_TEMPLATE.validate(name, "getNote"); + GetNoteRequest request = GetNoteRequest.newBuilder().setName(name).build(); + return getNote(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   GetNoteRequest request = GetNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   Note response = grafeasV1Beta1Client.getNote(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 + */ + private final Note getNote(GetNoteRequest request) { + return getNoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   GetNoteRequest request = GetNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Note> future = grafeasV1Beta1Client.getNoteCallable().futureCall(request);
+   *   // Do something
+   *   Note response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getNoteCallable() { + return stub.getNoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists notes for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String filter = "";
+   *   for (Note element : grafeasV1Beta1Client.listNotes(formattedParent, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param parent The name of the project to list notes for in the form of `projects/[PROJECT_ID]`. + * @param filter The filter expression. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNotesPagedResponse listNotes(String parent, String filter) { + PROJECT_PATH_TEMPLATE.validate(parent, "listNotes"); + ListNotesRequest request = + ListNotesRequest.newBuilder().setParent(parent).setFilter(filter).build(); + return listNotes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists notes for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListNotesRequest request = ListNotesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   for (Note element : grafeasV1Beta1Client.listNotes(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListNotesPagedResponse listNotes(ListNotesRequest request) { + return listNotesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists notes for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListNotesRequest request = ListNotesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<ListNotesPagedResponse> future = grafeasV1Beta1Client.listNotesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Note element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listNotesPagedCallable() { + return stub.listNotesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists notes for the specified project. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   ListNotesRequest request = ListNotesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   while (true) {
+   *     ListNotesResponse response = grafeasV1Beta1Client.listNotesCallable().call(request);
+   *     for (Note element : response.getNotesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listNotesCallable() { + return stub.listNotesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   grafeasV1Beta1Client.deleteNote(formattedName);
+   * }
+   * 
+ * + * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteNote(String name) { + NOTE_PATH_TEMPLATE.validate(name, "deleteNote"); + DeleteNoteRequest request = DeleteNoteRequest.newBuilder().setName(name).build(); + deleteNote(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   DeleteNoteRequest request = DeleteNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   grafeasV1Beta1Client.deleteNote(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 + */ + private final void deleteNote(DeleteNoteRequest request) { + deleteNoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   DeleteNoteRequest request = DeleteNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<Void> future = grafeasV1Beta1Client.deleteNoteCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteNoteCallable() { + return stub.deleteNoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String noteId = "";
+   *   Note note = Note.newBuilder().build();
+   *   Note response = grafeasV1Beta1Client.createNote(formattedParent, noteId, note);
+   * }
+   * 
+ * + * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the + * note is to be created. + * @param noteId The ID to use for this note. + * @param note The note to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Note createNote(String parent, String noteId, Note note) { + PROJECT_PATH_TEMPLATE.validate(parent, "createNote"); + CreateNoteRequest request = + CreateNoteRequest.newBuilder().setParent(parent).setNoteId(noteId).setNote(note).build(); + return createNote(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String noteId = "";
+   *   Note note = Note.newBuilder().build();
+   *   CreateNoteRequest request = CreateNoteRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setNoteId(noteId)
+   *     .setNote(note)
+   *     .build();
+   *   Note response = grafeasV1Beta1Client.createNote(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 Note createNote(CreateNoteRequest request) { + return createNoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   String noteId = "";
+   *   Note note = Note.newBuilder().build();
+   *   CreateNoteRequest request = CreateNoteRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .setNoteId(noteId)
+   *     .setNote(note)
+   *     .build();
+   *   ApiFuture<Note> future = grafeasV1Beta1Client.createNoteCallable().futureCall(request);
+   *   // Do something
+   *   Note response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createNoteCallable() { + return stub.createNoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new notes in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Map<String, Note> notes = new HashMap<>();
+   *   BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(formattedParent, notes);
+   * }
+   * 
+ * + * @param parent The name of the project in the form of `projects/[PROJECT_ID]`, under which the + * notes are to be created. + * @param notes The notes to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final BatchCreateNotesResponse batchCreateNotes(String parent, Map notes) { + PROJECT_PATH_TEMPLATE.validate(parent, "batchCreateNotes"); + BatchCreateNotesRequest request = + BatchCreateNotesRequest.newBuilder().setParent(parent).putAllNotes(notes).build(); + return batchCreateNotes(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new notes in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Map<String, Note> notes = new HashMap<>();
+   *   BatchCreateNotesRequest request = BatchCreateNotesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .putAllNotes(notes)
+   *     .build();
+   *   BatchCreateNotesResponse response = grafeasV1Beta1Client.batchCreateNotes(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 BatchCreateNotesResponse batchCreateNotes(BatchCreateNotesRequest request) { + return batchCreateNotesCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates new notes in batch. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   Map<String, Note> notes = new HashMap<>();
+   *   BatchCreateNotesRequest request = BatchCreateNotesRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .putAllNotes(notes)
+   *     .build();
+   *   ApiFuture<BatchCreateNotesResponse> future = grafeasV1Beta1Client.batchCreateNotesCallable().futureCall(request);
+   *   // Do something
+   *   BatchCreateNotesResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + batchCreateNotesCallable() { + return stub.batchCreateNotesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Note note = Note.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Note response = grafeasV1Beta1Client.updateNote(formattedName, note, updateMask);
+   * }
+   * 
+ * + * @param name The name of the note in the form of `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * @param note The updated note. + * @param updateMask The fields to update. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Note updateNote(String name, Note note, FieldMask updateMask) { + NOTE_PATH_TEMPLATE.validate(name, "updateNote"); + UpdateNoteRequest request = + UpdateNoteRequest.newBuilder() + .setName(name) + .setNote(note) + .setUpdateMask(updateMask) + .build(); + return updateNote(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Note note = Note.newBuilder().build();
+   *   UpdateNoteRequest request = UpdateNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setNote(note)
+   *     .build();
+   *   Note response = grafeasV1Beta1Client.updateNote(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 Note updateNote(UpdateNoteRequest request) { + return updateNoteCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   Note note = Note.newBuilder().build();
+   *   UpdateNoteRequest request = UpdateNoteRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .setNote(note)
+   *     .build();
+   *   ApiFuture<Note> future = grafeasV1Beta1Client.updateNoteCallable().futureCall(request);
+   *   // Do something
+   *   Note response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateNoteCallable() { + return stub.updateNoteCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences referencing the specified note. Provider projects can use this method to get + * all occurrences across consumer projects referencing the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   String filter = "";
+   *   for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(formattedName, filter).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param name The name of the note to list occurrences for in the form of + * `projects/[PROVIDER_ID]/notes/[NOTE_ID]`. + * @param filter The filter expression. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListNoteOccurrencesPagedResponse listNoteOccurrences(String name, String filter) { + NOTE_PATH_TEMPLATE.validate(name, "listNoteOccurrences"); + ListNoteOccurrencesRequest request = + ListNoteOccurrencesRequest.newBuilder().setName(name).setFilter(filter).build(); + return listNoteOccurrences(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences referencing the specified note. Provider projects can use this method to get + * all occurrences across consumer projects referencing the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   for (Occurrence element : grafeasV1Beta1Client.listNoteOccurrences(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListNoteOccurrencesPagedResponse listNoteOccurrences( + ListNoteOccurrencesRequest request) { + return listNoteOccurrencesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences referencing the specified note. Provider projects can use this method to get + * all occurrences across consumer projects referencing the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   ApiFuture<ListNoteOccurrencesPagedResponse> future = grafeasV1Beta1Client.listNoteOccurrencesPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Occurrence element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listNoteOccurrencesPagedCallable() { + return stub.listNoteOccurrencesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists occurrences referencing the specified note. Provider projects can use this method to get + * all occurrences across consumer projects referencing the specified note. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+   *   ListNoteOccurrencesRequest request = ListNoteOccurrencesRequest.newBuilder()
+   *     .setName(formattedName)
+   *     .build();
+   *   while (true) {
+   *     ListNoteOccurrencesResponse response = grafeasV1Beta1Client.listNoteOccurrencesCallable().call(request);
+   *     for (Occurrence element : response.getOccurrencesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listNoteOccurrencesCallable() { + return stub.listNoteOccurrencesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a summary of the number and severity of occurrences. + * + *

Sample code: + * + *


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

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   VulnerabilityOccurrencesSummary response = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummary(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 VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary( + GetVulnerabilityOccurrencesSummaryRequest request) { + return getVulnerabilityOccurrencesSummaryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a summary of the number and severity of occurrences. + * + *

Sample code: + * + *


+   * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+   *   String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]");
+   *   GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
+   *     .setParent(formattedParent)
+   *     .build();
+   *   ApiFuture<VulnerabilityOccurrencesSummary> future = grafeasV1Beta1Client.getVulnerabilityOccurrencesSummaryCallable().futureCall(request);
+   *   // Do something
+   *   VulnerabilityOccurrencesSummary response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummaryCallable() { + return stub.getVulnerabilityOccurrencesSummaryCallable(); + } + + @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); + } + + public static class ListOccurrencesPagedResponse + extends AbstractPagedListResponse< + ListOccurrencesRequest, ListOccurrencesResponse, Occurrence, ListOccurrencesPage, + ListOccurrencesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListOccurrencesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListOccurrencesPagedResponse apply(ListOccurrencesPage input) { + return new ListOccurrencesPagedResponse(input); + } + }); + } + + private ListOccurrencesPagedResponse(ListOccurrencesPage page) { + super(page, ListOccurrencesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListOccurrencesPage + extends AbstractPage< + ListOccurrencesRequest, ListOccurrencesResponse, Occurrence, ListOccurrencesPage> { + + private ListOccurrencesPage( + PageContext context, + ListOccurrencesResponse response) { + super(context, response); + } + + private static ListOccurrencesPage createEmptyPage() { + return new ListOccurrencesPage(null, null); + } + + @Override + protected ListOccurrencesPage createPage( + PageContext context, + ListOccurrencesResponse response) { + return new ListOccurrencesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListOccurrencesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListOccurrencesRequest, ListOccurrencesResponse, Occurrence, ListOccurrencesPage, + ListOccurrencesFixedSizeCollection> { + + private ListOccurrencesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListOccurrencesFixedSizeCollection createEmptyCollection() { + return new ListOccurrencesFixedSizeCollection(null, 0); + } + + @Override + protected ListOccurrencesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListOccurrencesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNotesPagedResponse + extends AbstractPagedListResponse< + ListNotesRequest, ListNotesResponse, Note, ListNotesPage, ListNotesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNotesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNotesPagedResponse apply(ListNotesPage input) { + return new ListNotesPagedResponse(input); + } + }); + } + + private ListNotesPagedResponse(ListNotesPage page) { + super(page, ListNotesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNotesPage + extends AbstractPage { + + private ListNotesPage( + PageContext context, + ListNotesResponse response) { + super(context, response); + } + + private static ListNotesPage createEmptyPage() { + return new ListNotesPage(null, null); + } + + @Override + protected ListNotesPage createPage( + PageContext context, + ListNotesResponse response) { + return new ListNotesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNotesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNotesRequest, ListNotesResponse, Note, ListNotesPage, ListNotesFixedSizeCollection> { + + private ListNotesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNotesFixedSizeCollection createEmptyCollection() { + return new ListNotesFixedSizeCollection(null, 0); + } + + @Override + protected ListNotesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNotesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListNoteOccurrencesPagedResponse + extends AbstractPagedListResponse< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, Occurrence, + ListNoteOccurrencesPage, ListNoteOccurrencesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListNoteOccurrencesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListNoteOccurrencesPagedResponse apply(ListNoteOccurrencesPage input) { + return new ListNoteOccurrencesPagedResponse(input); + } + }); + } + + private ListNoteOccurrencesPagedResponse(ListNoteOccurrencesPage page) { + super(page, ListNoteOccurrencesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListNoteOccurrencesPage + extends AbstractPage< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, Occurrence, + ListNoteOccurrencesPage> { + + private ListNoteOccurrencesPage( + PageContext context, + ListNoteOccurrencesResponse response) { + super(context, response); + } + + private static ListNoteOccurrencesPage createEmptyPage() { + return new ListNoteOccurrencesPage(null, null); + } + + @Override + protected ListNoteOccurrencesPage createPage( + PageContext context, + ListNoteOccurrencesResponse response) { + return new ListNoteOccurrencesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListNoteOccurrencesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, Occurrence, + ListNoteOccurrencesPage, ListNoteOccurrencesFixedSizeCollection> { + + private ListNoteOccurrencesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListNoteOccurrencesFixedSizeCollection createEmptyCollection() { + return new ListNoteOccurrencesFixedSizeCollection(null, 0); + } + + @Override + protected ListNoteOccurrencesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListNoteOccurrencesFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Settings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Settings.java new file mode 100644 index 000000000000..65776ee6361a --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1Settings.java @@ -0,0 +1,368 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNotesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListOccurrencesPagedResponse; + +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.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.devtools.containeranalysis.v1beta1.stub.GrafeasV1Beta1StubSettings; +import com.google.protobuf.Empty; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +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 GrafeasV1Beta1Client}. + * + *

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 getOccurrence to 30 seconds: + * + *

+ * 
+ * GrafeasV1Beta1Settings.Builder grafeasV1Beta1SettingsBuilder =
+ *     GrafeasV1Beta1Settings.newBuilder();
+ * grafeasV1Beta1SettingsBuilder.getOccurrenceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GrafeasV1Beta1Settings grafeasV1Beta1Settings = grafeasV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GrafeasV1Beta1Settings extends ClientSettings { + /** Returns the object with the settings used for calls to getOccurrence. */ + public UnaryCallSettings getOccurrenceSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).getOccurrenceSettings(); + } + + /** Returns the object with the settings used for calls to listOccurrences. */ + public PagedCallSettings< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).listOccurrencesSettings(); + } + + /** Returns the object with the settings used for calls to deleteOccurrence. */ + public UnaryCallSettings deleteOccurrenceSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).deleteOccurrenceSettings(); + } + + /** Returns the object with the settings used for calls to createOccurrence. */ + public UnaryCallSettings createOccurrenceSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).createOccurrenceSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateOccurrences. */ + public UnaryCallSettings + batchCreateOccurrencesSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).batchCreateOccurrencesSettings(); + } + + /** Returns the object with the settings used for calls to updateOccurrence. */ + public UnaryCallSettings updateOccurrenceSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).updateOccurrenceSettings(); + } + + /** Returns the object with the settings used for calls to getOccurrenceNote. */ + public UnaryCallSettings getOccurrenceNoteSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).getOccurrenceNoteSettings(); + } + + /** Returns the object with the settings used for calls to getNote. */ + public UnaryCallSettings getNoteSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).getNoteSettings(); + } + + /** Returns the object with the settings used for calls to listNotes. */ + public PagedCallSettings + listNotesSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).listNotesSettings(); + } + + /** Returns the object with the settings used for calls to deleteNote. */ + public UnaryCallSettings deleteNoteSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).deleteNoteSettings(); + } + + /** Returns the object with the settings used for calls to createNote. */ + public UnaryCallSettings createNoteSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).createNoteSettings(); + } + + /** Returns the object with the settings used for calls to batchCreateNotes. */ + public UnaryCallSettings + batchCreateNotesSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).batchCreateNotesSettings(); + } + + /** Returns the object with the settings used for calls to updateNote. */ + public UnaryCallSettings updateNoteSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).updateNoteSettings(); + } + + /** Returns the object with the settings used for calls to listNoteOccurrences. */ + public PagedCallSettings< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()).listNoteOccurrencesSettings(); + } + + /** Returns the object with the settings used for calls to getVulnerabilityOccurrencesSummary. */ + public UnaryCallSettings< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings() { + return ((GrafeasV1Beta1StubSettings) getStubSettings()) + .getVulnerabilityOccurrencesSummarySettings(); + } + + public static final GrafeasV1Beta1Settings create(GrafeasV1Beta1StubSettings stub) + throws IOException { + return new GrafeasV1Beta1Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return GrafeasV1Beta1StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return GrafeasV1Beta1StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return GrafeasV1Beta1StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GrafeasV1Beta1StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return GrafeasV1Beta1StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return GrafeasV1Beta1StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return GrafeasV1Beta1StubSettings.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 GrafeasV1Beta1Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for GrafeasV1Beta1Settings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(GrafeasV1Beta1StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(GrafeasV1Beta1StubSettings.newBuilder()); + } + + protected Builder(GrafeasV1Beta1Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(GrafeasV1Beta1StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public GrafeasV1Beta1StubSettings.Builder getStubSettingsBuilder() { + return ((GrafeasV1Beta1StubSettings.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 getOccurrence. */ + public UnaryCallSettings.Builder getOccurrenceSettings() { + return getStubSettingsBuilder().getOccurrenceSettings(); + } + + /** Returns the builder for the settings used for calls to listOccurrences. */ + public PagedCallSettings.Builder< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings() { + return getStubSettingsBuilder().listOccurrencesSettings(); + } + + /** Returns the builder for the settings used for calls to deleteOccurrence. */ + public UnaryCallSettings.Builder deleteOccurrenceSettings() { + return getStubSettingsBuilder().deleteOccurrenceSettings(); + } + + /** Returns the builder for the settings used for calls to createOccurrence. */ + public UnaryCallSettings.Builder + createOccurrenceSettings() { + return getStubSettingsBuilder().createOccurrenceSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateOccurrences. */ + public UnaryCallSettings.Builder + batchCreateOccurrencesSettings() { + return getStubSettingsBuilder().batchCreateOccurrencesSettings(); + } + + /** Returns the builder for the settings used for calls to updateOccurrence. */ + public UnaryCallSettings.Builder + updateOccurrenceSettings() { + return getStubSettingsBuilder().updateOccurrenceSettings(); + } + + /** Returns the builder for the settings used for calls to getOccurrenceNote. */ + public UnaryCallSettings.Builder getOccurrenceNoteSettings() { + return getStubSettingsBuilder().getOccurrenceNoteSettings(); + } + + /** Returns the builder for the settings used for calls to getNote. */ + public UnaryCallSettings.Builder getNoteSettings() { + return getStubSettingsBuilder().getNoteSettings(); + } + + /** Returns the builder for the settings used for calls to listNotes. */ + public PagedCallSettings.Builder + listNotesSettings() { + return getStubSettingsBuilder().listNotesSettings(); + } + + /** Returns the builder for the settings used for calls to deleteNote. */ + public UnaryCallSettings.Builder deleteNoteSettings() { + return getStubSettingsBuilder().deleteNoteSettings(); + } + + /** Returns the builder for the settings used for calls to createNote. */ + public UnaryCallSettings.Builder createNoteSettings() { + return getStubSettingsBuilder().createNoteSettings(); + } + + /** Returns the builder for the settings used for calls to batchCreateNotes. */ + public UnaryCallSettings.Builder + batchCreateNotesSettings() { + return getStubSettingsBuilder().batchCreateNotesSettings(); + } + + /** Returns the builder for the settings used for calls to updateNote. */ + public UnaryCallSettings.Builder updateNoteSettings() { + return getStubSettingsBuilder().updateNoteSettings(); + } + + /** Returns the builder for the settings used for calls to listNoteOccurrences. */ + public PagedCallSettings.Builder< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, + ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings() { + return getStubSettingsBuilder().listNoteOccurrencesSettings(); + } + + /** + * Returns the builder for the settings used for calls to getVulnerabilityOccurrencesSummary. + */ + public UnaryCallSettings.Builder< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings() { + return getStubSettingsBuilder().getVulnerabilityOccurrencesSummarySettings(); + } + + @Override + public GrafeasV1Beta1Settings build() throws IOException { + return new GrafeasV1Beta1Settings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/package-info.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/package-info.java new file mode 100644 index 000000000000..4ac289a01a7e --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/package-info.java @@ -0,0 +1,74 @@ +/* + * 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 + * + * 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. + * + *

============================== ContainerAnalysisV1Beta1Client ============================== + * + *

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 ContainerAnalysisV1Beta1Client: + * + *

+ * 
+ * try (ContainerAnalysisV1Beta1Client containerAnalysisV1Beta1Client = ContainerAnalysisV1Beta1Client.create()) {
+ *   String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]");
+ *   Policy policy = Policy.newBuilder().build();
+ *   Policy response = containerAnalysisV1Beta1Client.setIamPolicy(formattedResource, policy);
+ * }
+ * 
+ * 
+ * + * ==================== GrafeasV1Beta1Client ==================== + * + *

Service Description: [Grafeas](grafeas.io) API. + * + *

Retrieves analysis results of Cloud components such as Docker container images. + * + *

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 GrafeasV1Beta1Client: + * + *

+ * 
+ * try (GrafeasV1Beta1Client grafeasV1Beta1Client = GrafeasV1Beta1Client.create()) {
+ *   String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]");
+ *   Occurrence response = grafeasV1Beta1Client.getOccurrence(formattedName);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.devtools.containeranalysis.v1beta1; diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1Stub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1Stub.java new file mode 100644 index 000000000000..81b7fc6c983a --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1Stub.java @@ -0,0 +1,77 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client.ListScanConfigsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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 ContainerAnalysisV1Beta1Stub 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()"); + } + + public UnaryCallable getScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getScanConfigCallable()"); + } + + public UnaryCallable + listScanConfigsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listScanConfigsPagedCallable()"); + } + + public UnaryCallable listScanConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listScanConfigsCallable()"); + } + + public UnaryCallable updateScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateScanConfigCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1StubSettings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1StubSettings.java new file mode 100644 index 000000000000..ace17ac7200c --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/ContainerAnalysisV1Beta1StubSettings.java @@ -0,0 +1,469 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client.ListScanConfigsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +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.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +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.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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 ContainerAnalysisV1Beta1Stub}. + * + *

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: + * + *

+ * 
+ * ContainerAnalysisV1Beta1StubSettings.Builder containerAnalysisV1Beta1SettingsBuilder =
+ *     ContainerAnalysisV1Beta1StubSettings.newBuilder();
+ * containerAnalysisV1Beta1SettingsBuilder.setIamPolicySettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * ContainerAnalysisV1Beta1StubSettings containerAnalysisV1Beta1Settings = containerAnalysisV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class ContainerAnalysisV1Beta1StubSettings + 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; + private final UnaryCallSettings getScanConfigSettings; + private final PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings; + private final UnaryCallSettings updateScanConfigSettings; + + /** 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; + } + + /** Returns the object with the settings used for calls to getScanConfig. */ + public UnaryCallSettings getScanConfigSettings() { + return getScanConfigSettings; + } + + /** Returns the object with the settings used for calls to listScanConfigs. */ + public PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return listScanConfigsSettings; + } + + /** Returns the object with the settings used for calls to updateScanConfig. */ + public UnaryCallSettings updateScanConfigSettings() { + return updateScanConfigSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public ContainerAnalysisV1Beta1Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcContainerAnalysisV1Beta1Stub.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(ContainerAnalysisV1Beta1StubSettings.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 ContainerAnalysisV1Beta1StubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + getScanConfigSettings = settingsBuilder.getScanConfigSettings().build(); + listScanConfigsSettings = settingsBuilder.listScanConfigsSettings().build(); + updateScanConfigSettings = settingsBuilder.updateScanConfigSettings().build(); + } + + private static final PagedListDescriptor< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig> + LIST_SCAN_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListScanConfigsRequest injectToken( + ListScanConfigsRequest payload, String token) { + return ListScanConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListScanConfigsRequest injectPageSize( + ListScanConfigsRequest payload, int pageSize) { + return ListScanConfigsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListScanConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListScanConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListScanConfigsResponse payload) { + return payload.getScanConfigsList(); + } + }; + + private static final PagedListResponseFactory< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + LIST_SCAN_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListScanConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SCAN_CONFIGS_PAGE_STR_DESC, request, context); + return ListScanConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for ContainerAnalysisV1Beta1StubSettings. */ + 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 final UnaryCallSettings.Builder getScanConfigSettings; + private final PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings; + private final UnaryCallSettings.Builder + updateScanConfigSettings; + + 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(); + + getScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listScanConfigsSettings = PagedCallSettings.newBuilder(LIST_SCAN_CONFIGS_PAGE_STR_FACT); + + updateScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings, + getScanConfigSettings, + listScanConfigsSettings, + updateScanConfigSettings); + + 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")); + + builder + .getScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listScanConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(ContainerAnalysisV1Beta1StubSettings settings) { + super(settings); + + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + getScanConfigSettings = settings.getScanConfigSettings.toBuilder(); + listScanConfigsSettings = settings.listScanConfigsSettings.toBuilder(); + updateScanConfigSettings = settings.updateScanConfigSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings, + getScanConfigSettings, + listScanConfigsSettings, + updateScanConfigSettings); + } + + // 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; + } + + /** Returns the builder for the settings used for calls to getScanConfig. */ + public UnaryCallSettings.Builder getScanConfigSettings() { + return getScanConfigSettings; + } + + /** Returns the builder for the settings used for calls to listScanConfigs. */ + public PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return listScanConfigsSettings; + } + + /** Returns the builder for the settings used for calls to updateScanConfig. */ + public UnaryCallSettings.Builder + updateScanConfigSettings() { + return updateScanConfigSettings; + } + + @Override + public ContainerAnalysisV1Beta1StubSettings build() throws IOException { + return new ContainerAnalysisV1Beta1StubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1Stub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1Stub.java new file mode 100644 index 000000000000..9d823cf9461f --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1Stub.java @@ -0,0 +1,142 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNotesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListOccurrencesPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +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 GrafeasV1Beta1Stub implements BackgroundResource { + + public UnaryCallable getOccurrenceCallable() { + throw new UnsupportedOperationException("Not implemented: getOccurrenceCallable()"); + } + + public UnaryCallable + listOccurrencesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listOccurrencesPagedCallable()"); + } + + public UnaryCallable listOccurrencesCallable() { + throw new UnsupportedOperationException("Not implemented: listOccurrencesCallable()"); + } + + public UnaryCallable deleteOccurrenceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteOccurrenceCallable()"); + } + + public UnaryCallable createOccurrenceCallable() { + throw new UnsupportedOperationException("Not implemented: createOccurrenceCallable()"); + } + + public UnaryCallable + batchCreateOccurrencesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateOccurrencesCallable()"); + } + + public UnaryCallable updateOccurrenceCallable() { + throw new UnsupportedOperationException("Not implemented: updateOccurrenceCallable()"); + } + + public UnaryCallable getOccurrenceNoteCallable() { + throw new UnsupportedOperationException("Not implemented: getOccurrenceNoteCallable()"); + } + + public UnaryCallable getNoteCallable() { + throw new UnsupportedOperationException("Not implemented: getNoteCallable()"); + } + + public UnaryCallable listNotesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNotesPagedCallable()"); + } + + public UnaryCallable listNotesCallable() { + throw new UnsupportedOperationException("Not implemented: listNotesCallable()"); + } + + public UnaryCallable deleteNoteCallable() { + throw new UnsupportedOperationException("Not implemented: deleteNoteCallable()"); + } + + public UnaryCallable createNoteCallable() { + throw new UnsupportedOperationException("Not implemented: createNoteCallable()"); + } + + public UnaryCallable + batchCreateNotesCallable() { + throw new UnsupportedOperationException("Not implemented: batchCreateNotesCallable()"); + } + + public UnaryCallable updateNoteCallable() { + throw new UnsupportedOperationException("Not implemented: updateNoteCallable()"); + } + + public UnaryCallable + listNoteOccurrencesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listNoteOccurrencesPagedCallable()"); + } + + public UnaryCallable + listNoteOccurrencesCallable() { + throw new UnsupportedOperationException("Not implemented: listNoteOccurrencesCallable()"); + } + + public UnaryCallable + getVulnerabilityOccurrencesSummaryCallable() { + throw new UnsupportedOperationException( + "Not implemented: getVulnerabilityOccurrencesSummaryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1StubSettings.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1StubSettings.java new file mode 100644 index 000000000000..419ecfe0d5ed --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrafeasV1Beta1StubSettings.java @@ -0,0 +1,836 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNotesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListOccurrencesPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +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.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +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.api.gax.rpc.UnaryCallable; +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.protobuf.Empty; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +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 GrafeasV1Beta1Stub}. + * + *

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 getOccurrence to 30 seconds: + * + *

+ * 
+ * GrafeasV1Beta1StubSettings.Builder grafeasV1Beta1SettingsBuilder =
+ *     GrafeasV1Beta1StubSettings.newBuilder();
+ * grafeasV1Beta1SettingsBuilder.getOccurrenceSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * GrafeasV1Beta1StubSettings grafeasV1Beta1Settings = grafeasV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class GrafeasV1Beta1StubSettings 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 getOccurrenceSettings; + private final PagedCallSettings< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings; + private final UnaryCallSettings deleteOccurrenceSettings; + private final UnaryCallSettings createOccurrenceSettings; + private final UnaryCallSettings + batchCreateOccurrencesSettings; + private final UnaryCallSettings updateOccurrenceSettings; + private final UnaryCallSettings getOccurrenceNoteSettings; + private final UnaryCallSettings getNoteSettings; + private final PagedCallSettings + listNotesSettings; + private final UnaryCallSettings deleteNoteSettings; + private final UnaryCallSettings createNoteSettings; + private final UnaryCallSettings + batchCreateNotesSettings; + private final UnaryCallSettings updateNoteSettings; + private final PagedCallSettings< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings; + private final UnaryCallSettings< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings; + + /** Returns the object with the settings used for calls to getOccurrence. */ + public UnaryCallSettings getOccurrenceSettings() { + return getOccurrenceSettings; + } + + /** Returns the object with the settings used for calls to listOccurrences. */ + public PagedCallSettings< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings() { + return listOccurrencesSettings; + } + + /** Returns the object with the settings used for calls to deleteOccurrence. */ + public UnaryCallSettings deleteOccurrenceSettings() { + return deleteOccurrenceSettings; + } + + /** Returns the object with the settings used for calls to createOccurrence. */ + public UnaryCallSettings createOccurrenceSettings() { + return createOccurrenceSettings; + } + + /** Returns the object with the settings used for calls to batchCreateOccurrences. */ + public UnaryCallSettings + batchCreateOccurrencesSettings() { + return batchCreateOccurrencesSettings; + } + + /** Returns the object with the settings used for calls to updateOccurrence. */ + public UnaryCallSettings updateOccurrenceSettings() { + return updateOccurrenceSettings; + } + + /** Returns the object with the settings used for calls to getOccurrenceNote. */ + public UnaryCallSettings getOccurrenceNoteSettings() { + return getOccurrenceNoteSettings; + } + + /** Returns the object with the settings used for calls to getNote. */ + public UnaryCallSettings getNoteSettings() { + return getNoteSettings; + } + + /** Returns the object with the settings used for calls to listNotes. */ + public PagedCallSettings + listNotesSettings() { + return listNotesSettings; + } + + /** Returns the object with the settings used for calls to deleteNote. */ + public UnaryCallSettings deleteNoteSettings() { + return deleteNoteSettings; + } + + /** Returns the object with the settings used for calls to createNote. */ + public UnaryCallSettings createNoteSettings() { + return createNoteSettings; + } + + /** Returns the object with the settings used for calls to batchCreateNotes. */ + public UnaryCallSettings + batchCreateNotesSettings() { + return batchCreateNotesSettings; + } + + /** Returns the object with the settings used for calls to updateNote. */ + public UnaryCallSettings updateNoteSettings() { + return updateNoteSettings; + } + + /** Returns the object with the settings used for calls to listNoteOccurrences. */ + public PagedCallSettings< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings() { + return listNoteOccurrencesSettings; + } + + /** Returns the object with the settings used for calls to getVulnerabilityOccurrencesSummary. */ + public UnaryCallSettings< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings() { + return getVulnerabilityOccurrencesSummarySettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public GrafeasV1Beta1Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcGrafeasV1Beta1Stub.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(GrafeasV1Beta1StubSettings.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 GrafeasV1Beta1StubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getOccurrenceSettings = settingsBuilder.getOccurrenceSettings().build(); + listOccurrencesSettings = settingsBuilder.listOccurrencesSettings().build(); + deleteOccurrenceSettings = settingsBuilder.deleteOccurrenceSettings().build(); + createOccurrenceSettings = settingsBuilder.createOccurrenceSettings().build(); + batchCreateOccurrencesSettings = settingsBuilder.batchCreateOccurrencesSettings().build(); + updateOccurrenceSettings = settingsBuilder.updateOccurrenceSettings().build(); + getOccurrenceNoteSettings = settingsBuilder.getOccurrenceNoteSettings().build(); + getNoteSettings = settingsBuilder.getNoteSettings().build(); + listNotesSettings = settingsBuilder.listNotesSettings().build(); + deleteNoteSettings = settingsBuilder.deleteNoteSettings().build(); + createNoteSettings = settingsBuilder.createNoteSettings().build(); + batchCreateNotesSettings = settingsBuilder.batchCreateNotesSettings().build(); + updateNoteSettings = settingsBuilder.updateNoteSettings().build(); + listNoteOccurrencesSettings = settingsBuilder.listNoteOccurrencesSettings().build(); + getVulnerabilityOccurrencesSummarySettings = + settingsBuilder.getVulnerabilityOccurrencesSummarySettings().build(); + } + + private static final PagedListDescriptor< + ListOccurrencesRequest, ListOccurrencesResponse, Occurrence> + LIST_OCCURRENCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListOccurrencesRequest injectToken( + ListOccurrencesRequest payload, String token) { + return ListOccurrencesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListOccurrencesRequest injectPageSize( + ListOccurrencesRequest payload, int pageSize) { + return ListOccurrencesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListOccurrencesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListOccurrencesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListOccurrencesResponse payload) { + return payload.getOccurrencesList(); + } + }; + + private static final PagedListDescriptor + LIST_NOTES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNotesRequest injectToken(ListNotesRequest payload, String token) { + return ListNotesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNotesRequest injectPageSize(ListNotesRequest payload, int pageSize) { + return ListNotesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNotesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNotesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListNotesResponse payload) { + return payload.getNotesList(); + } + }; + + private static final PagedListDescriptor< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, Occurrence> + LIST_NOTE_OCCURRENCES_PAGE_STR_DESC = + new PagedListDescriptor< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, Occurrence>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListNoteOccurrencesRequest injectToken( + ListNoteOccurrencesRequest payload, String token) { + return ListNoteOccurrencesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListNoteOccurrencesRequest injectPageSize( + ListNoteOccurrencesRequest payload, int pageSize) { + return ListNoteOccurrencesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListNoteOccurrencesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListNoteOccurrencesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListNoteOccurrencesResponse payload) { + return payload.getOccurrencesList(); + } + }; + + private static final PagedListResponseFactory< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + LIST_OCCURRENCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListOccurrencesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_OCCURRENCES_PAGE_STR_DESC, request, context); + return ListOccurrencesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNotesRequest, ListNotesResponse, ListNotesPagedResponse> + LIST_NOTES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNotesRequest, ListNotesResponse, ListNotesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNotesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_NOTES_PAGE_STR_DESC, request, context); + return ListNotesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, ListNoteOccurrencesPagedResponse> + LIST_NOTE_OCCURRENCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, + ListNoteOccurrencesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListNoteOccurrencesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext + pageContext = + PageContext.create( + callable, LIST_NOTE_OCCURRENCES_PAGE_STR_DESC, request, context); + return ListNoteOccurrencesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for GrafeasV1Beta1StubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder getOccurrenceSettings; + private final PagedCallSettings.Builder< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings; + private final UnaryCallSettings.Builder + deleteOccurrenceSettings; + private final UnaryCallSettings.Builder + createOccurrenceSettings; + private final UnaryCallSettings.Builder< + BatchCreateOccurrencesRequest, BatchCreateOccurrencesResponse> + batchCreateOccurrencesSettings; + private final UnaryCallSettings.Builder + updateOccurrenceSettings; + private final UnaryCallSettings.Builder + getOccurrenceNoteSettings; + private final UnaryCallSettings.Builder getNoteSettings; + private final PagedCallSettings.Builder< + ListNotesRequest, ListNotesResponse, ListNotesPagedResponse> + listNotesSettings; + private final UnaryCallSettings.Builder deleteNoteSettings; + private final UnaryCallSettings.Builder createNoteSettings; + private final UnaryCallSettings.Builder + batchCreateNotesSettings; + private final UnaryCallSettings.Builder updateNoteSettings; + private final PagedCallSettings.Builder< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, + ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings; + private final UnaryCallSettings.Builder< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings; + + 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); + + getOccurrenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listOccurrencesSettings = PagedCallSettings.newBuilder(LIST_OCCURRENCES_PAGE_STR_FACT); + + deleteOccurrenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createOccurrenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchCreateOccurrencesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateOccurrenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getOccurrenceNoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getNoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNotesSettings = PagedCallSettings.newBuilder(LIST_NOTES_PAGE_STR_FACT); + + deleteNoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + createNoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + batchCreateNotesSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateNoteSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listNoteOccurrencesSettings = + PagedCallSettings.newBuilder(LIST_NOTE_OCCURRENCES_PAGE_STR_FACT); + + getVulnerabilityOccurrencesSummarySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOccurrenceSettings, + listOccurrencesSettings, + deleteOccurrenceSettings, + createOccurrenceSettings, + batchCreateOccurrencesSettings, + updateOccurrenceSettings, + getOccurrenceNoteSettings, + getNoteSettings, + listNotesSettings, + deleteNoteSettings, + createNoteSettings, + batchCreateNotesSettings, + updateNoteSettings, + listNoteOccurrencesSettings, + getVulnerabilityOccurrencesSummarySettings); + + 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 + .getOccurrenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listOccurrencesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteOccurrenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createOccurrenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .batchCreateOccurrencesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateOccurrenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getOccurrenceNoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getNoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNotesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteNoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .createNoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .batchCreateNotesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateNoteSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listNoteOccurrencesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getVulnerabilityOccurrencesSummarySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(GrafeasV1Beta1StubSettings settings) { + super(settings); + + getOccurrenceSettings = settings.getOccurrenceSettings.toBuilder(); + listOccurrencesSettings = settings.listOccurrencesSettings.toBuilder(); + deleteOccurrenceSettings = settings.deleteOccurrenceSettings.toBuilder(); + createOccurrenceSettings = settings.createOccurrenceSettings.toBuilder(); + batchCreateOccurrencesSettings = settings.batchCreateOccurrencesSettings.toBuilder(); + updateOccurrenceSettings = settings.updateOccurrenceSettings.toBuilder(); + getOccurrenceNoteSettings = settings.getOccurrenceNoteSettings.toBuilder(); + getNoteSettings = settings.getNoteSettings.toBuilder(); + listNotesSettings = settings.listNotesSettings.toBuilder(); + deleteNoteSettings = settings.deleteNoteSettings.toBuilder(); + createNoteSettings = settings.createNoteSettings.toBuilder(); + batchCreateNotesSettings = settings.batchCreateNotesSettings.toBuilder(); + updateNoteSettings = settings.updateNoteSettings.toBuilder(); + listNoteOccurrencesSettings = settings.listNoteOccurrencesSettings.toBuilder(); + getVulnerabilityOccurrencesSummarySettings = + settings.getVulnerabilityOccurrencesSummarySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getOccurrenceSettings, + listOccurrencesSettings, + deleteOccurrenceSettings, + createOccurrenceSettings, + batchCreateOccurrencesSettings, + updateOccurrenceSettings, + getOccurrenceNoteSettings, + getNoteSettings, + listNotesSettings, + deleteNoteSettings, + createNoteSettings, + batchCreateNotesSettings, + updateNoteSettings, + listNoteOccurrencesSettings, + getVulnerabilityOccurrencesSummarySettings); + } + + // 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 getOccurrence. */ + public UnaryCallSettings.Builder getOccurrenceSettings() { + return getOccurrenceSettings; + } + + /** Returns the builder for the settings used for calls to listOccurrences. */ + public PagedCallSettings.Builder< + ListOccurrencesRequest, ListOccurrencesResponse, ListOccurrencesPagedResponse> + listOccurrencesSettings() { + return listOccurrencesSettings; + } + + /** Returns the builder for the settings used for calls to deleteOccurrence. */ + public UnaryCallSettings.Builder deleteOccurrenceSettings() { + return deleteOccurrenceSettings; + } + + /** Returns the builder for the settings used for calls to createOccurrence. */ + public UnaryCallSettings.Builder + createOccurrenceSettings() { + return createOccurrenceSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateOccurrences. */ + public UnaryCallSettings.Builder + batchCreateOccurrencesSettings() { + return batchCreateOccurrencesSettings; + } + + /** Returns the builder for the settings used for calls to updateOccurrence. */ + public UnaryCallSettings.Builder + updateOccurrenceSettings() { + return updateOccurrenceSettings; + } + + /** Returns the builder for the settings used for calls to getOccurrenceNote. */ + public UnaryCallSettings.Builder getOccurrenceNoteSettings() { + return getOccurrenceNoteSettings; + } + + /** Returns the builder for the settings used for calls to getNote. */ + public UnaryCallSettings.Builder getNoteSettings() { + return getNoteSettings; + } + + /** Returns the builder for the settings used for calls to listNotes. */ + public PagedCallSettings.Builder + listNotesSettings() { + return listNotesSettings; + } + + /** Returns the builder for the settings used for calls to deleteNote. */ + public UnaryCallSettings.Builder deleteNoteSettings() { + return deleteNoteSettings; + } + + /** Returns the builder for the settings used for calls to createNote. */ + public UnaryCallSettings.Builder createNoteSettings() { + return createNoteSettings; + } + + /** Returns the builder for the settings used for calls to batchCreateNotes. */ + public UnaryCallSettings.Builder + batchCreateNotesSettings() { + return batchCreateNotesSettings; + } + + /** Returns the builder for the settings used for calls to updateNote. */ + public UnaryCallSettings.Builder updateNoteSettings() { + return updateNoteSettings; + } + + /** Returns the builder for the settings used for calls to listNoteOccurrences. */ + public PagedCallSettings.Builder< + ListNoteOccurrencesRequest, ListNoteOccurrencesResponse, + ListNoteOccurrencesPagedResponse> + listNoteOccurrencesSettings() { + return listNoteOccurrencesSettings; + } + + /** + * Returns the builder for the settings used for calls to getVulnerabilityOccurrencesSummary. + */ + public UnaryCallSettings.Builder< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummarySettings() { + return getVulnerabilityOccurrencesSummarySettings; + } + + @Override + public GrafeasV1Beta1StubSettings build() throws IOException { + return new GrafeasV1Beta1StubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcContainerAnalysisV1Beta1CallableFactory.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcContainerAnalysisV1Beta1CallableFactory.java new file mode 100644 index 000000000000..fee289907adc --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcContainerAnalysisV1Beta1CallableFactory.java @@ -0,0 +1,116 @@ +/* + * 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 + * + * 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.v1beta1.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.Operation; +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 GrpcContainerAnalysisV1Beta1CallableFactory 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/v1beta1/stub/GrpcContainerAnalysisV1Beta1Stub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcContainerAnalysisV1Beta1Stub.java new file mode 100644 index 000000000000..fe6680cc6d4d --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcContainerAnalysisV1Beta1Stub.java @@ -0,0 +1,280 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client.ListScanConfigsPagedResponse; + +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.UnaryCallable; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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.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 GrpcContainerAnalysisV1Beta1Stub extends ContainerAnalysisV1Beta1Stub { + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1/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.v1beta1.ContainerAnalysisV1Beta1/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.v1beta1.ContainerAnalysisV1Beta1/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1/GetScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listScanConfigsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1/ListScanConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListScanConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListScanConfigsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1/UpdateScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + private final UnaryCallable getScanConfigCallable; + private final UnaryCallable + listScanConfigsCallable; + private final UnaryCallable + listScanConfigsPagedCallable; + private final UnaryCallable updateScanConfigCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcContainerAnalysisV1Beta1Stub create( + ContainerAnalysisV1Beta1StubSettings settings) throws IOException { + return new GrpcContainerAnalysisV1Beta1Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcContainerAnalysisV1Beta1Stub create(ClientContext clientContext) + throws IOException { + return new GrpcContainerAnalysisV1Beta1Stub( + ContainerAnalysisV1Beta1StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcContainerAnalysisV1Beta1Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcContainerAnalysisV1Beta1Stub( + ContainerAnalysisV1Beta1StubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcContainerAnalysisV1Beta1Stub, 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 GrpcContainerAnalysisV1Beta1Stub( + ContainerAnalysisV1Beta1StubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcContainerAnalysisV1Beta1CallableFactory()); + } + + /** + * Constructs an instance of GrpcContainerAnalysisV1Beta1Stub, 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 GrpcContainerAnalysisV1Beta1Stub( + ContainerAnalysisV1Beta1StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .build(); + GrpcCallSettings getScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getScanConfigMethodDescriptor) + .build(); + GrpcCallSettings + listScanConfigsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listScanConfigsMethodDescriptor) + .build(); + GrpcCallSettings updateScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateScanConfigMethodDescriptor) + .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); + this.getScanConfigCallable = + callableFactory.createUnaryCallable( + getScanConfigTransportSettings, settings.getScanConfigSettings(), clientContext); + this.listScanConfigsCallable = + callableFactory.createUnaryCallable( + listScanConfigsTransportSettings, settings.listScanConfigsSettings(), clientContext); + this.listScanConfigsPagedCallable = + callableFactory.createPagedCallable( + listScanConfigsTransportSettings, settings.listScanConfigsSettings(), clientContext); + this.updateScanConfigCallable = + callableFactory.createUnaryCallable( + updateScanConfigTransportSettings, settings.updateScanConfigSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + public UnaryCallable getScanConfigCallable() { + return getScanConfigCallable; + } + + public UnaryCallable + listScanConfigsPagedCallable() { + return listScanConfigsPagedCallable; + } + + public UnaryCallable listScanConfigsCallable() { + return listScanConfigsCallable; + } + + public UnaryCallable updateScanConfigCallable() { + return updateScanConfigCallable; + } + + @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/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcGrafeasV1Beta1CallableFactory.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcGrafeasV1Beta1CallableFactory.java new file mode 100644 index 000000000000..646b218000b9 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcGrafeasV1Beta1CallableFactory.java @@ -0,0 +1,116 @@ +/* + * 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 + * + * 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.v1beta1.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.Operation; +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 GrpcGrafeasV1Beta1CallableFactory 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/v1beta1/stub/GrpcGrafeasV1Beta1Stub.java b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcGrafeasV1Beta1Stub.java new file mode 100644 index 000000000000..863d5373f476 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/main/java/com/google/cloud/devtools/containeranalysis/v1beta1/stub/GrpcGrafeasV1Beta1Stub.java @@ -0,0 +1,522 @@ +/* + * 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 + * + * 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.v1beta1.stub; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNotesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListOccurrencesPagedResponse; + +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.UnaryCallable; +import com.google.protobuf.Empty; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +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 GrpcGrafeasV1Beta1Stub extends GrafeasV1Beta1Stub { + + private static final MethodDescriptor + getOccurrenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/GetOccurrence") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Occurrence.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listOccurrencesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/ListOccurrences") + .setRequestMarshaller( + ProtoUtils.marshaller(ListOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListOccurrencesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteOccurrenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/DeleteOccurrence") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + createOccurrenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/CreateOccurrence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Occurrence.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + BatchCreateOccurrencesRequest, BatchCreateOccurrencesResponse> + batchCreateOccurrencesMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/BatchCreateOccurrences") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchCreateOccurrencesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateOccurrenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/UpdateOccurrence") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateOccurrenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Occurrence.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getOccurrenceNoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/GetOccurrenceNote") + .setRequestMarshaller( + ProtoUtils.marshaller(GetOccurrenceNoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Note.getDefaultInstance())) + .build(); + private static final MethodDescriptor getNoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/GetNote") + .setRequestMarshaller(ProtoUtils.marshaller(GetNoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Note.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listNotesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/ListNotes") + .setRequestMarshaller(ProtoUtils.marshaller(ListNotesRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListNotesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteNoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/DeleteNote") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteNoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor createNoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/CreateNote") + .setRequestMarshaller(ProtoUtils.marshaller(CreateNoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Note.getDefaultInstance())) + .build(); + private static final MethodDescriptor + batchCreateNotesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/BatchCreateNotes") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchCreateNotesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchCreateNotesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateNoteMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/UpdateNote") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateNoteRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Note.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listNoteOccurrencesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("grafeas.v1beta1.GrafeasV1Beta1/ListNoteOccurrences") + .setRequestMarshaller( + ProtoUtils.marshaller(ListNoteOccurrencesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListNoteOccurrencesResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummaryMethodDescriptor = + MethodDescriptor + . + newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "grafeas.v1beta1.GrafeasV1Beta1/GetVulnerabilityOccurrencesSummary") + .setRequestMarshaller( + ProtoUtils.marshaller( + GetVulnerabilityOccurrencesSummaryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(VulnerabilityOccurrencesSummary.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable getOccurrenceCallable; + private final UnaryCallable + listOccurrencesCallable; + private final UnaryCallable + listOccurrencesPagedCallable; + private final UnaryCallable deleteOccurrenceCallable; + private final UnaryCallable createOccurrenceCallable; + private final UnaryCallable + batchCreateOccurrencesCallable; + private final UnaryCallable updateOccurrenceCallable; + private final UnaryCallable getOccurrenceNoteCallable; + private final UnaryCallable getNoteCallable; + private final UnaryCallable listNotesCallable; + private final UnaryCallable listNotesPagedCallable; + private final UnaryCallable deleteNoteCallable; + private final UnaryCallable createNoteCallable; + private final UnaryCallable + batchCreateNotesCallable; + private final UnaryCallable updateNoteCallable; + private final UnaryCallable + listNoteOccurrencesCallable; + private final UnaryCallable + listNoteOccurrencesPagedCallable; + private final UnaryCallable< + GetVulnerabilityOccurrencesSummaryRequest, VulnerabilityOccurrencesSummary> + getVulnerabilityOccurrencesSummaryCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcGrafeasV1Beta1Stub create(GrafeasV1Beta1StubSettings settings) + throws IOException { + return new GrpcGrafeasV1Beta1Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcGrafeasV1Beta1Stub create(ClientContext clientContext) + throws IOException { + return new GrpcGrafeasV1Beta1Stub( + GrafeasV1Beta1StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcGrafeasV1Beta1Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcGrafeasV1Beta1Stub( + GrafeasV1Beta1StubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcGrafeasV1Beta1Stub, 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 GrpcGrafeasV1Beta1Stub(GrafeasV1Beta1StubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcGrafeasV1Beta1CallableFactory()); + } + + /** + * Constructs an instance of GrpcGrafeasV1Beta1Stub, 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 GrpcGrafeasV1Beta1Stub( + GrafeasV1Beta1StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings getOccurrenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOccurrenceMethodDescriptor) + .build(); + GrpcCallSettings + listOccurrencesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listOccurrencesMethodDescriptor) + .build(); + GrpcCallSettings deleteOccurrenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteOccurrenceMethodDescriptor) + .build(); + GrpcCallSettings createOccurrenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createOccurrenceMethodDescriptor) + .build(); + GrpcCallSettings + batchCreateOccurrencesTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(batchCreateOccurrencesMethodDescriptor) + .build(); + GrpcCallSettings updateOccurrenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateOccurrenceMethodDescriptor) + .build(); + GrpcCallSettings getOccurrenceNoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getOccurrenceNoteMethodDescriptor) + .build(); + GrpcCallSettings getNoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getNoteMethodDescriptor) + .build(); + GrpcCallSettings listNotesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listNotesMethodDescriptor) + .build(); + GrpcCallSettings deleteNoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteNoteMethodDescriptor) + .build(); + GrpcCallSettings createNoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createNoteMethodDescriptor) + .build(); + GrpcCallSettings + batchCreateNotesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(batchCreateNotesMethodDescriptor) + .build(); + GrpcCallSettings updateNoteTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateNoteMethodDescriptor) + .build(); + GrpcCallSettings + listNoteOccurrencesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listNoteOccurrencesMethodDescriptor) + .build(); + GrpcCallSettings + getVulnerabilityOccurrencesSummaryTransportSettings = + GrpcCallSettings + . + newBuilder() + .setMethodDescriptor(getVulnerabilityOccurrencesSummaryMethodDescriptor) + .build(); + + this.getOccurrenceCallable = + callableFactory.createUnaryCallable( + getOccurrenceTransportSettings, settings.getOccurrenceSettings(), clientContext); + this.listOccurrencesCallable = + callableFactory.createUnaryCallable( + listOccurrencesTransportSettings, settings.listOccurrencesSettings(), clientContext); + this.listOccurrencesPagedCallable = + callableFactory.createPagedCallable( + listOccurrencesTransportSettings, settings.listOccurrencesSettings(), clientContext); + this.deleteOccurrenceCallable = + callableFactory.createUnaryCallable( + deleteOccurrenceTransportSettings, settings.deleteOccurrenceSettings(), clientContext); + this.createOccurrenceCallable = + callableFactory.createUnaryCallable( + createOccurrenceTransportSettings, settings.createOccurrenceSettings(), clientContext); + this.batchCreateOccurrencesCallable = + callableFactory.createUnaryCallable( + batchCreateOccurrencesTransportSettings, + settings.batchCreateOccurrencesSettings(), + clientContext); + this.updateOccurrenceCallable = + callableFactory.createUnaryCallable( + updateOccurrenceTransportSettings, settings.updateOccurrenceSettings(), clientContext); + this.getOccurrenceNoteCallable = + callableFactory.createUnaryCallable( + getOccurrenceNoteTransportSettings, + settings.getOccurrenceNoteSettings(), + clientContext); + this.getNoteCallable = + callableFactory.createUnaryCallable( + getNoteTransportSettings, settings.getNoteSettings(), clientContext); + this.listNotesCallable = + callableFactory.createUnaryCallable( + listNotesTransportSettings, settings.listNotesSettings(), clientContext); + this.listNotesPagedCallable = + callableFactory.createPagedCallable( + listNotesTransportSettings, settings.listNotesSettings(), clientContext); + this.deleteNoteCallable = + callableFactory.createUnaryCallable( + deleteNoteTransportSettings, settings.deleteNoteSettings(), clientContext); + this.createNoteCallable = + callableFactory.createUnaryCallable( + createNoteTransportSettings, settings.createNoteSettings(), clientContext); + this.batchCreateNotesCallable = + callableFactory.createUnaryCallable( + batchCreateNotesTransportSettings, settings.batchCreateNotesSettings(), clientContext); + this.updateNoteCallable = + callableFactory.createUnaryCallable( + updateNoteTransportSettings, settings.updateNoteSettings(), clientContext); + this.listNoteOccurrencesCallable = + callableFactory.createUnaryCallable( + listNoteOccurrencesTransportSettings, + settings.listNoteOccurrencesSettings(), + clientContext); + this.listNoteOccurrencesPagedCallable = + callableFactory.createPagedCallable( + listNoteOccurrencesTransportSettings, + settings.listNoteOccurrencesSettings(), + clientContext); + this.getVulnerabilityOccurrencesSummaryCallable = + callableFactory.createUnaryCallable( + getVulnerabilityOccurrencesSummaryTransportSettings, + settings.getVulnerabilityOccurrencesSummarySettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable getOccurrenceCallable() { + return getOccurrenceCallable; + } + + public UnaryCallable + listOccurrencesPagedCallable() { + return listOccurrencesPagedCallable; + } + + public UnaryCallable listOccurrencesCallable() { + return listOccurrencesCallable; + } + + public UnaryCallable deleteOccurrenceCallable() { + return deleteOccurrenceCallable; + } + + public UnaryCallable createOccurrenceCallable() { + return createOccurrenceCallable; + } + + public UnaryCallable + batchCreateOccurrencesCallable() { + return batchCreateOccurrencesCallable; + } + + public UnaryCallable updateOccurrenceCallable() { + return updateOccurrenceCallable; + } + + public UnaryCallable getOccurrenceNoteCallable() { + return getOccurrenceNoteCallable; + } + + public UnaryCallable getNoteCallable() { + return getNoteCallable; + } + + public UnaryCallable listNotesPagedCallable() { + return listNotesPagedCallable; + } + + public UnaryCallable listNotesCallable() { + return listNotesCallable; + } + + public UnaryCallable deleteNoteCallable() { + return deleteNoteCallable; + } + + public UnaryCallable createNoteCallable() { + return createNoteCallable; + } + + public UnaryCallable + batchCreateNotesCallable() { + return batchCreateNotesCallable; + } + + public UnaryCallable updateNoteCallable() { + return updateNoteCallable; + } + + public UnaryCallable + listNoteOccurrencesPagedCallable() { + return listNoteOccurrencesPagedCallable; + } + + public UnaryCallable + listNoteOccurrencesCallable() { + return listNoteOccurrencesCallable; + } + + public UnaryCallable + getVulnerabilityOccurrencesSummaryCallable() { + return getVulnerabilityOccurrencesSummaryCallable; + } + + @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/v1beta1/ContainerAnalysisV1Beta1ClientTest.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1ClientTest.java new file mode 100644 index 000000000000..d681b1406768 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/ContainerAnalysisV1Beta1ClientTest.java @@ -0,0 +1,372 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Client.ListScanConfigsPagedResponse; + +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.common.collect.Lists; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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.ByteString; +import com.google.protobuf.GeneratedMessageV3; +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 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 ContainerAnalysisV1Beta1ClientTest { + private static MockContainerAnalysisV1Beta1 mockContainerAnalysisV1Beta1; + private static MockGrafeasV1Beta1 mockGrafeasV1Beta1; + private static MockServiceHelper serviceHelper; + private ContainerAnalysisV1Beta1Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockContainerAnalysisV1Beta1 = new MockContainerAnalysisV1Beta1(); + mockGrafeasV1Beta1 = new MockGrafeasV1Beta1(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList(mockContainerAnalysisV1Beta1, mockGrafeasV1Beta1)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + ContainerAnalysisV1Beta1Settings settings = + ContainerAnalysisV1Beta1Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = ContainerAnalysisV1Beta1Client.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(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + Policy policy = Policy.newBuilder().build(); + + Policy actualResponse = client.setIamPolicy(formattedResource, policy); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = (SetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedResource, 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); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedResource = + ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + Policy policy = Policy.newBuilder().build(); + + client.setIamPolicy(formattedResource, 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(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + Policy actualResponse = client.getIamPolicy(formattedResource); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = (GetIamPolicyRequest) actualRequests.get(0); + + Assert.assertEquals(formattedResource, 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); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedResource = + ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + client.getIamPolicy(formattedResource); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void testIamPermissionsTest() { + TestIamPermissionsResponse expectedResponse = TestIamPermissionsResponse.newBuilder().build(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedResource = ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + List permissions = new ArrayList<>(); + + TestIamPermissionsResponse actualResponse = + client.testIamPermissions(formattedResource, permissions); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = (TestIamPermissionsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedResource, 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); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedResource = + ContainerAnalysisV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + List permissions = new ArrayList<>(); + + client.testIamPermissions(formattedResource, permissions); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getScanConfigTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + boolean enabled = false; + ScanConfig expectedResponse = + ScanConfig.newBuilder() + .setName(name2) + .setDescription(description) + .setEnabled(enabled) + .build(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedName = + ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]"); + + ScanConfig actualResponse = client.getScanConfig(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetScanConfigRequest actualRequest = (GetScanConfigRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedName = + ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]"); + + client.getScanConfig(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listScanConfigsTest() { + String nextPageToken = ""; + ScanConfig scanConfigsElement = ScanConfig.newBuilder().build(); + List scanConfigs = Arrays.asList(scanConfigsElement); + ListScanConfigsResponse expectedResponse = + ListScanConfigsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllScanConfigs(scanConfigs) + .build(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + ListScanConfigsPagedResponse pagedListResponse = + client.listScanConfigs(formattedParent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getScanConfigsList().get(0), resources.get(0)); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListScanConfigsRequest actualRequest = (ListScanConfigsRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listScanConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedParent = ContainerAnalysisV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + client.listScanConfigs(formattedParent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateScanConfigTest() { + String name2 = "name2-1052831874"; + String description = "description-1724546052"; + boolean enabled = false; + ScanConfig expectedResponse = + ScanConfig.newBuilder() + .setName(name2) + .setDescription(description) + .setEnabled(enabled) + .build(); + mockContainerAnalysisV1Beta1.addResponse(expectedResponse); + + String formattedName = + ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]"); + ScanConfig scanConfig = ScanConfig.newBuilder().build(); + + ScanConfig actualResponse = client.updateScanConfig(formattedName, scanConfig); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockContainerAnalysisV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateScanConfigRequest actualRequest = (UpdateScanConfigRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(scanConfig, actualRequest.getScanConfig()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockContainerAnalysisV1Beta1.addException(exception); + + try { + String formattedName = + ContainerAnalysisV1Beta1Client.formatScanConfigName("[PROJECT]", "[SCAN_CONFIG]"); + ScanConfig scanConfig = ScanConfig.newBuilder().build(); + + client.updateScanConfig(formattedName, scanConfig); + 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/v1beta1/GrafeasV1Beta1ClientTest.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1ClientTest.java new file mode 100644 index 000000000000..05dd175b5266 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/GrafeasV1Beta1ClientTest.java @@ -0,0 +1,809 @@ +/* + * 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 + * + * 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.v1beta1; + +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNoteOccurrencesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListNotesPagedResponse; +import static com.google.cloud.devtools.containeranalysis.v1beta1.GrafeasV1Beta1Client.ListOccurrencesPagedResponse; + +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.common.collect.Lists; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.GeneratedMessageV3; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +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 GrafeasV1Beta1ClientTest { + private static MockContainerAnalysisV1Beta1 mockContainerAnalysisV1Beta1; + private static MockGrafeasV1Beta1 mockGrafeasV1Beta1; + private static MockServiceHelper serviceHelper; + private GrafeasV1Beta1Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockContainerAnalysisV1Beta1 = new MockContainerAnalysisV1Beta1(); + mockGrafeasV1Beta1 = new MockGrafeasV1Beta1(); + serviceHelper = + new MockServiceHelper( + "in-process-1", + Arrays.asList(mockContainerAnalysisV1Beta1, mockGrafeasV1Beta1)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + GrafeasV1Beta1Settings settings = + GrafeasV1Beta1Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = GrafeasV1Beta1Client.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void getOccurrenceTest() { + String name2 = "name2-1052831874"; + String noteName = "noteName1780787896"; + String remediation = "remediation779381797"; + Occurrence expectedResponse = + Occurrence.newBuilder() + .setName(name2) + .setNoteName(noteName) + .setRemediation(remediation) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + Occurrence actualResponse = client.getOccurrence(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOccurrenceRequest actualRequest = (GetOccurrenceRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getOccurrenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + client.getOccurrence(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listOccurrencesTest() { + String nextPageToken = ""; + Occurrence occurrencesElement = Occurrence.newBuilder().build(); + List occurrences = Arrays.asList(occurrencesElement); + ListOccurrencesResponse expectedResponse = + ListOccurrencesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllOccurrences(occurrences) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + ListOccurrencesPagedResponse pagedListResponse = + client.listOccurrences(formattedParent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOccurrencesList().get(0), resources.get(0)); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListOccurrencesRequest actualRequest = (ListOccurrencesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listOccurrencesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + client.listOccurrences(formattedParent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteOccurrenceTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + client.deleteOccurrence(formattedName); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteOccurrenceRequest actualRequest = (DeleteOccurrenceRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteOccurrenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + client.deleteOccurrence(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createOccurrenceTest() { + String name = "name3373707"; + String noteName = "noteName1780787896"; + String remediation = "remediation779381797"; + Occurrence expectedResponse = + Occurrence.newBuilder() + .setName(name) + .setNoteName(noteName) + .setRemediation(remediation) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + Occurrence occurrence = Occurrence.newBuilder().build(); + + Occurrence actualResponse = client.createOccurrence(formattedParent, occurrence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateOccurrenceRequest actualRequest = (CreateOccurrenceRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(occurrence, actualRequest.getOccurrence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createOccurrenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + Occurrence occurrence = Occurrence.newBuilder().build(); + + client.createOccurrence(formattedParent, occurrence); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void batchCreateOccurrencesTest() { + BatchCreateOccurrencesResponse expectedResponse = + BatchCreateOccurrencesResponse.newBuilder().build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + List occurrences = new ArrayList<>(); + + BatchCreateOccurrencesResponse actualResponse = + client.batchCreateOccurrences(formattedParent, occurrences); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateOccurrencesRequest actualRequest = + (BatchCreateOccurrencesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(occurrences, actualRequest.getOccurrencesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchCreateOccurrencesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + List occurrences = new ArrayList<>(); + + client.batchCreateOccurrences(formattedParent, occurrences); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateOccurrenceTest() { + String name2 = "name2-1052831874"; + String noteName = "noteName1780787896"; + String remediation = "remediation779381797"; + Occurrence expectedResponse = + Occurrence.newBuilder() + .setName(name2) + .setNoteName(noteName) + .setRemediation(remediation) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + Occurrence occurrence = Occurrence.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Occurrence actualResponse = client.updateOccurrence(formattedName, occurrence, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateOccurrenceRequest actualRequest = (UpdateOccurrenceRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(occurrence, actualRequest.getOccurrence()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateOccurrenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + Occurrence occurrence = Occurrence.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateOccurrence(formattedName, occurrence, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getOccurrenceNoteTest() { + String name2 = "name2-1052831874"; + String shortDescription = "shortDescription-235369287"; + String longDescription = "longDescription-1747792199"; + Note expectedResponse = + Note.newBuilder() + .setName(name2) + .setShortDescription(shortDescription) + .setLongDescription(longDescription) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + Note actualResponse = client.getOccurrenceNote(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetOccurrenceNoteRequest actualRequest = (GetOccurrenceNoteRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getOccurrenceNoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatOccurrenceName("[PROJECT]", "[OCCURRENCE]"); + + client.getOccurrenceNote(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getNoteTest() { + String name2 = "name2-1052831874"; + String shortDescription = "shortDescription-235369287"; + String longDescription = "longDescription-1747792199"; + Note expectedResponse = + Note.newBuilder() + .setName(name2) + .setShortDescription(shortDescription) + .setLongDescription(longDescription) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + Note actualResponse = client.getNote(formattedName); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetNoteRequest actualRequest = (GetNoteRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getNoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + client.getNote(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNotesTest() { + String nextPageToken = ""; + Note notesElement = Note.newBuilder().build(); + List notes = Arrays.asList(notesElement); + ListNotesResponse expectedResponse = + ListNotesResponse.newBuilder().setNextPageToken(nextPageToken).addAllNotes(notes).build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + ListNotesPagedResponse pagedListResponse = client.listNotes(formattedParent, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getNotesList().get(0), resources.get(0)); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNotesRequest actualRequest = (ListNotesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listNotesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + client.listNotes(formattedParent, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteNoteTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + client.deleteNote(formattedName); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteNoteRequest actualRequest = (DeleteNoteRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteNoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + + client.deleteNote(formattedName); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void createNoteTest() { + String name = "name3373707"; + String shortDescription = "shortDescription-235369287"; + String longDescription = "longDescription-1747792199"; + Note expectedResponse = + Note.newBuilder() + .setName(name) + .setShortDescription(shortDescription) + .setLongDescription(longDescription) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String noteId = "noteId2129224840"; + Note note = Note.newBuilder().build(); + + Note actualResponse = client.createNote(formattedParent, noteId, note); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateNoteRequest actualRequest = (CreateNoteRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(noteId, actualRequest.getNoteId()); + Assert.assertEquals(note, actualRequest.getNote()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createNoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String noteId = "noteId2129224840"; + Note note = Note.newBuilder().build(); + + client.createNote(formattedParent, noteId, note); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void batchCreateNotesTest() { + BatchCreateNotesResponse expectedResponse = BatchCreateNotesResponse.newBuilder().build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + Map notes = new HashMap<>(); + + BatchCreateNotesResponse actualResponse = client.batchCreateNotes(formattedParent, notes); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + BatchCreateNotesRequest actualRequest = (BatchCreateNotesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(notes, actualRequest.getNotesMap()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void batchCreateNotesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + Map notes = new HashMap<>(); + + client.batchCreateNotes(formattedParent, notes); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateNoteTest() { + String name2 = "name2-1052831874"; + String shortDescription = "shortDescription-235369287"; + String longDescription = "longDescription-1747792199"; + Note expectedResponse = + Note.newBuilder() + .setName(name2) + .setShortDescription(shortDescription) + .setLongDescription(longDescription) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + Note note = Note.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Note actualResponse = client.updateNote(formattedName, note, updateMask); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateNoteRequest actualRequest = (UpdateNoteRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(note, actualRequest.getNote()); + Assert.assertEquals(updateMask, actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateNoteExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + Note note = Note.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + client.updateNote(formattedName, note, updateMask); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listNoteOccurrencesTest() { + String nextPageToken = ""; + Occurrence occurrencesElement = Occurrence.newBuilder().build(); + List occurrences = Arrays.asList(occurrencesElement); + ListNoteOccurrencesResponse expectedResponse = + ListNoteOccurrencesResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllOccurrences(occurrences) + .build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + String filter = "filter-1274492040"; + + ListNoteOccurrencesPagedResponse pagedListResponse = + client.listNoteOccurrences(formattedName, filter); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getOccurrencesList().get(0), resources.get(0)); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListNoteOccurrencesRequest actualRequest = (ListNoteOccurrencesRequest) actualRequests.get(0); + + Assert.assertEquals(formattedName, actualRequest.getName()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listNoteOccurrencesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedName = GrafeasV1Beta1Client.formatNoteName("[PROJECT]", "[NOTE]"); + String filter = "filter-1274492040"; + + client.listNoteOccurrences(formattedName, filter); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getVulnerabilityOccurrencesSummaryTest() { + VulnerabilityOccurrencesSummary expectedResponse = + VulnerabilityOccurrencesSummary.newBuilder().build(); + mockGrafeasV1Beta1.addResponse(expectedResponse); + + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + VulnerabilityOccurrencesSummary actualResponse = + client.getVulnerabilityOccurrencesSummary(formattedParent, filter); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockGrafeasV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVulnerabilityOccurrencesSummaryRequest actualRequest = + (GetVulnerabilityOccurrencesSummaryRequest) actualRequests.get(0); + + Assert.assertEquals(formattedParent, actualRequest.getParent()); + Assert.assertEquals(filter, actualRequest.getFilter()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getVulnerabilityOccurrencesSummaryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockGrafeasV1Beta1.addException(exception); + + try { + String formattedParent = GrafeasV1Beta1Client.formatProjectName("[PROJECT]"); + String filter = "filter-1274492040"; + + client.getVulnerabilityOccurrencesSummary(formattedParent, filter); + 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/v1beta1/MockContainerAnalysisV1Beta1.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockContainerAnalysisV1Beta1.java new file mode 100644 index 000000000000..fdc96befcbba --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockContainerAnalysisV1Beta1.java @@ -0,0 +1,57 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockContainerAnalysisV1Beta1 implements MockGrpcService { + private final MockContainerAnalysisV1Beta1Impl serviceImpl; + + public MockContainerAnalysisV1Beta1() { + serviceImpl = new MockContainerAnalysisV1Beta1Impl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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/v1beta1/MockContainerAnalysisV1Beta1Impl.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockContainerAnalysisV1Beta1Impl.java new file mode 100644 index 000000000000..5f1029c4f249 --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockContainerAnalysisV1Beta1Impl.java @@ -0,0 +1,157 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.containeranalysis.v1beta1.ContainerAnalysisV1Beta1Grpc.ContainerAnalysisV1Beta1ImplBase; +import com.google.containeranalysis.v1beta1.GetScanConfigRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsRequest; +import com.google.containeranalysis.v1beta1.ListScanConfigsResponse; +import com.google.containeranalysis.v1beta1.ScanConfig; +import com.google.containeranalysis.v1beta1.UpdateScanConfigRequest; +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.GeneratedMessageV3; +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 MockContainerAnalysisV1Beta1Impl extends ContainerAnalysisV1Beta1ImplBase { + private ArrayList requests; + private Queue responses; + + public MockContainerAnalysisV1Beta1Impl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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")); + } + } + + @Override + public void getScanConfig( + GetScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanConfig) { + requests.add(request); + responseObserver.onNext((ScanConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listScanConfigs( + ListScanConfigsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListScanConfigsResponse) { + requests.add(request); + responseObserver.onNext((ListScanConfigsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateScanConfig( + UpdateScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanConfig) { + requests.add(request); + responseObserver.onNext((ScanConfig) 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/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockGrafeasV1Beta1.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockGrafeasV1Beta1.java new file mode 100644 index 000000000000..1d5de9f4987c --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockGrafeasV1Beta1.java @@ -0,0 +1,57 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.GeneratedMessageV3; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockGrafeasV1Beta1 implements MockGrpcService { + private final MockGrafeasV1Beta1Impl serviceImpl; + + public MockGrafeasV1Beta1() { + serviceImpl = new MockGrafeasV1Beta1Impl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(GeneratedMessageV3 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/v1beta1/MockGrafeasV1Beta1Impl.java b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockGrafeasV1Beta1Impl.java new file mode 100644 index 000000000000..2e8b4ba6bceb --- /dev/null +++ b/google-cloud-clients/google-cloud-containeranalysis/src/test/java/com/google/cloud/devtools/containeranalysis/v1beta1/MockGrafeasV1Beta1Impl.java @@ -0,0 +1,306 @@ +/* + * 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 + * + * 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.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.Empty; +import com.google.protobuf.GeneratedMessageV3; +import io.grafeas.v1beta1.BatchCreateNotesRequest; +import io.grafeas.v1beta1.BatchCreateNotesResponse; +import io.grafeas.v1beta1.BatchCreateOccurrencesRequest; +import io.grafeas.v1beta1.BatchCreateOccurrencesResponse; +import io.grafeas.v1beta1.CreateNoteRequest; +import io.grafeas.v1beta1.CreateOccurrenceRequest; +import io.grafeas.v1beta1.DeleteNoteRequest; +import io.grafeas.v1beta1.DeleteOccurrenceRequest; +import io.grafeas.v1beta1.GetNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceNoteRequest; +import io.grafeas.v1beta1.GetOccurrenceRequest; +import io.grafeas.v1beta1.GetVulnerabilityOccurrencesSummaryRequest; +import io.grafeas.v1beta1.GrafeasV1Beta1Grpc.GrafeasV1Beta1ImplBase; +import io.grafeas.v1beta1.ListNoteOccurrencesRequest; +import io.grafeas.v1beta1.ListNoteOccurrencesResponse; +import io.grafeas.v1beta1.ListNotesRequest; +import io.grafeas.v1beta1.ListNotesResponse; +import io.grafeas.v1beta1.ListOccurrencesRequest; +import io.grafeas.v1beta1.ListOccurrencesResponse; +import io.grafeas.v1beta1.Note; +import io.grafeas.v1beta1.Occurrence; +import io.grafeas.v1beta1.UpdateNoteRequest; +import io.grafeas.v1beta1.UpdateOccurrenceRequest; +import io.grafeas.v1beta1.VulnerabilityOccurrencesSummary; +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 MockGrafeasV1Beta1Impl extends GrafeasV1Beta1ImplBase { + private ArrayList requests; + private Queue responses; + + public MockGrafeasV1Beta1Impl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(GeneratedMessageV3 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 getOccurrence( + GetOccurrenceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Occurrence) { + requests.add(request); + responseObserver.onNext((Occurrence) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listOccurrences( + ListOccurrencesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListOccurrencesResponse) { + requests.add(request); + responseObserver.onNext((ListOccurrencesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteOccurrence( + DeleteOccurrenceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createOccurrence( + CreateOccurrenceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Occurrence) { + requests.add(request); + responseObserver.onNext((Occurrence) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void batchCreateOccurrences( + BatchCreateOccurrencesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BatchCreateOccurrencesResponse) { + requests.add(request); + responseObserver.onNext((BatchCreateOccurrencesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateOccurrence( + UpdateOccurrenceRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Occurrence) { + requests.add(request); + responseObserver.onNext((Occurrence) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getOccurrenceNote( + GetOccurrenceNoteRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Note) { + requests.add(request); + responseObserver.onNext((Note) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getNote(GetNoteRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Note) { + requests.add(request); + responseObserver.onNext((Note) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listNotes( + ListNotesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListNotesResponse) { + requests.add(request); + responseObserver.onNext((ListNotesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteNote(DeleteNoteRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void createNote(CreateNoteRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Note) { + requests.add(request); + responseObserver.onNext((Note) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void batchCreateNotes( + BatchCreateNotesRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof BatchCreateNotesResponse) { + requests.add(request); + responseObserver.onNext((BatchCreateNotesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateNote(UpdateNoteRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Note) { + requests.add(request); + responseObserver.onNext((Note) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listNoteOccurrences( + ListNoteOccurrencesRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListNoteOccurrencesResponse) { + requests.add(request); + responseObserver.onNext((ListNoteOccurrencesResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getVulnerabilityOccurrencesSummary( + GetVulnerabilityOccurrencesSummaryRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof VulnerabilityOccurrencesSummary) { + requests.add(request); + responseObserver.onNext((VulnerabilityOccurrencesSummary) 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/pom.xml b/google-cloud-clients/pom.xml index 3ccc57a9644b..ef779b5d0023 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -419,6 +419,7 @@ google-cloud-bigquerydatatransfer google-cloud-compute google-cloud-container + google-cloud-containeranalysis google-cloud-contrib google-cloud-core google-cloud-core-http @@ -755,7 +756,7 @@ Stub packages - com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dlp.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.language.v1.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages diff --git a/versions.txt b/versions.txt index 47f3211d5edd..5f977f948c0b 100644 --- a/versions.txt +++ b/versions.txt @@ -13,6 +13,7 @@ grpc-google-cloud-bigquerydatatransfer-v1:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-bigtable-admin-v2:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-bigtable-v2:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-container-v1:0.22.0:0.22.1-SNAPSHOT +grpc-google-cloud-containeranalysis-v1beta1:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-dataproc-v1:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-dataproc-v1beta2:0.22.0:0.22.1-SNAPSHOT grpc-google-cloud-dialogflow-v2:0.22.0:0.22.1-SNAPSHOT @@ -55,6 +56,7 @@ proto-google-cloud-bigquerydatatransfer-v1:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-bigtable-admin-v2:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-bigtable-v2:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-container-v1:0.22.0:0.22.1-SNAPSHOT +proto-google-cloud-containeranalysis-v1beta1:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-dataproc-v1:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-dataproc-v1beta2:0.22.0:0.22.1-SNAPSHOT proto-google-cloud-datastore-v1:0.22.0:0.22.1-SNAPSHOT @@ -113,6 +115,7 @@ google-cloud-bom:0.57.0-alpha:0.57.1-alpha-SNAPSHOT google-cloud-compat-checker:0.57.0-alpha:0.57.1-alpha-SNAPSHOT google-cloud-compute:0.57.0-alpha:0.57.1-alpha-SNAPSHOT google-cloud-container:0.57.0-beta:0.57.1-beta-SNAPSHOT +google-cloud-containeranalysis:0.57.0-beta:0.57.1-beta-SNAPSHOT google-cloud-contrib:0.57.0-alpha:0.57.1-alpha-SNAPSHOT google-cloud-core:1.39.0:1.39.1-SNAPSHOT google-cloud-core-grpc:1.39.0:1.39.1-SNAPSHOT