diff --git a/google-api-grpc/grpc-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java b/google-api-grpc/grpc-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java new file mode 100644 index 000000000000..c7cfc4e7ad96 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceGrpc.java @@ -0,0 +1,433 @@ +package com.google.cloud.asset.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; + +/** + *
+ * Asset service definition. + *+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/asset/v1beta1/asset_service.proto") +public final class AssetServiceGrpc { + + private AssetServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.asset.v1beta1.AssetService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getExportAssetsMethod()} instead. + public static final io.grpc.MethodDescriptor
+ * Asset service definition. + *+ */ + public static abstract class AssetServiceImplBase implements io.grpc.BindableService { + + /** + *
+ * Exports assets with time and resource types to a given Google Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + * to keep track of the export. + *+ */ + public void exportAssets(com.google.cloud.asset.v1beta1.ExportAssetsRequest request, + io.grpc.stub.StreamObserver
+ * Batch gets assets update history that overlaps a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API only outputs history when asset and its + * attached IAM POLICY both exist. So there may be gaps in the output history. + *+ */ + public void batchGetAssetsHistory(com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest request, + io.grpc.stub.StreamObserver
+ * Asset service definition. + *+ */ + public static final class AssetServiceStub extends io.grpc.stub.AbstractStub
+ * Exports assets with time and resource types to a given Google Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + * to keep track of the export. + *+ */ + public void exportAssets(com.google.cloud.asset.v1beta1.ExportAssetsRequest request, + io.grpc.stub.StreamObserver
+ * Batch gets assets update history that overlaps a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API only outputs history when asset and its + * attached IAM POLICY both exist. So there may be gaps in the output history. + *+ */ + public void batchGetAssetsHistory(com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest request, + io.grpc.stub.StreamObserver
+ * Asset service definition. + *+ */ + public static final class AssetServiceBlockingStub extends io.grpc.stub.AbstractStub
+ * Exports assets with time and resource types to a given Google Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + * to keep track of the export. + *+ */ + public com.google.longrunning.Operation exportAssets(com.google.cloud.asset.v1beta1.ExportAssetsRequest request) { + return blockingUnaryCall( + getChannel(), getExportAssetsMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Batch gets assets update history that overlaps a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API only outputs history when asset and its + * attached IAM POLICY both exist. So there may be gaps in the output history. + *+ */ + public com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse batchGetAssetsHistory(com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest request) { + return blockingUnaryCall( + getChannel(), getBatchGetAssetsHistoryMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+ * Asset service definition. + *+ */ + public static final class AssetServiceFutureStub extends io.grpc.stub.AbstractStub
+ * Exports assets with time and resource types to a given Google Cloud Storage + * location. The output format is newline-delimited JSON. + * This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users + * to keep track of the export. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Batch gets assets update history that overlaps a time window. + * For RESOURCE content, this API outputs history with asset in both + * non-delete or deleted status. + * For IAM_POLICY content, this API only outputs history when asset and its + * attached IAM POLICY both exist. So there may be gaps in the output history. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
- * Executes an SQL query, returning all rows in a single reply. This + * Executes an SQL statement, returning all results in a single reply. This * method cannot be used to return a result set larger than 10 MiB; * if the query yields more data than that, the query fails with * a `FAILED_PRECONDITION` error. - * Queries inside read-write transactions might return `ABORTED`. If + * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. * Larger result sets can be fetched in streaming fashion by calling @@ -723,7 +723,9 @@ public void rollback(com.google.spanner.v1.RollbackRequest request, * must be used by the PartitionQueryRequest used to create the * partition tokens and the ExecuteSqlRequests that use the partition tokens. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the query, and + * the whole operation must be restarted from the beginning. **/ public void partitionQuery(com.google.spanner.v1.PartitionQueryRequest request, @@ -738,9 +740,13 @@ public void partitionQuery(com.google.spanner.v1.PartitionQueryRequest request, * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read * result to read. The same session and read-only transaction must be used by * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. + * ReadRequests that use the partition tokens. There are no ordering + * guarantees on rows returned among the returned partition tokens, or even + * within each individual StreamingRead call issued with a partition_token. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the read, and + * the whole operation must be restarted from the beginning. * */ public void partitionRead(com.google.spanner.v1.PartitionReadRequest request, @@ -931,11 +937,11 @@ public void deleteSession(com.google.spanner.v1.DeleteSessionRequest request, /** *
- * Executes an SQL query, returning all rows in a single reply. This + * Executes an SQL statement, returning all results in a single reply. This * method cannot be used to return a result set larger than 10 MiB; * if the query yields more data than that, the query fails with * a `FAILED_PRECONDITION` error. - * Queries inside read-write transactions might return `ABORTED`. If + * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. * Larger result sets can be fetched in streaming fashion by calling @@ -1056,7 +1062,9 @@ public void rollback(com.google.spanner.v1.RollbackRequest request, * must be used by the PartitionQueryRequest used to create the * partition tokens and the ExecuteSqlRequests that use the partition tokens. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the query, and + * the whole operation must be restarted from the beginning. **/ public void partitionQuery(com.google.spanner.v1.PartitionQueryRequest request, @@ -1072,9 +1080,13 @@ public void partitionQuery(com.google.spanner.v1.PartitionQueryRequest request, * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read * result to read. The same session and read-only transaction must be used by * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. + * ReadRequests that use the partition tokens. There are no ordering + * guarantees on rows returned among the returned partition tokens, or even + * within each individual StreamingRead call issued with a partition_token. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the read, and + * the whole operation must be restarted from the beginning. * */ public void partitionRead(com.google.spanner.v1.PartitionReadRequest request, @@ -1166,11 +1178,11 @@ public com.google.protobuf.Empty deleteSession(com.google.spanner.v1.DeleteSessi /** *
- * Executes an SQL query, returning all rows in a single reply. This + * Executes an SQL statement, returning all results in a single reply. This * method cannot be used to return a result set larger than 10 MiB; * if the query yields more data than that, the query fails with * a `FAILED_PRECONDITION` error. - * Queries inside read-write transactions might return `ABORTED`. If + * Operations inside read-write transactions might return `ABORTED`. If * this occurs, the application should restart the transaction from * the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. * Larger result sets can be fetched in streaming fashion by calling @@ -1286,7 +1298,9 @@ public com.google.protobuf.Empty rollback(com.google.spanner.v1.RollbackRequest * must be used by the PartitionQueryRequest used to create the * partition tokens and the ExecuteSqlRequests that use the partition tokens. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the query, and + * the whole operation must be restarted from the beginning. **/ public com.google.spanner.v1.PartitionResponse partitionQuery(com.google.spanner.v1.PartitionQueryRequest request) { @@ -1301,9 +1315,13 @@ public com.google.spanner.v1.PartitionResponse partitionQuery(com.google.spanner * by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read * result to read. The same session and read-only transaction must be used by * the PartitionReadRequest used to create the partition tokens and the - * ReadRequests that use the partition tokens. + * ReadRequests that use the partition tokens. There are no ordering + * guarantees on rows returned among the returned partition tokens, or even + * within each individual StreamingRead call issued with a partition_token. * Partition tokens become invalid when the session used to create them - * is deleted or begins a new transaction. + * is deleted, is idle for too long, begins a new transaction, or becomes too + * old. When any of these happen, it is not possible to resume the read, and + * the whole operation must be restarted from the beginning. * */ public com.google.spanner.v1.PartitionResponse partitionRead(com.google.spanner.v1.PartitionReadRequest request) { @@ -1398,11 +1416,11 @@ public com.google.common.util.concurrent.ListenableFuture
+ * Cloud asset. This include all Google Cloud Platform resources, as well as + * IAM policies and other non-GCP assets. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.Asset} + */ +public final class Asset extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.Asset) + AssetOrBuilder { +private static final long serialVersionUID = 0L; + // Use Asset.newBuilder() to construct. + private Asset(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private Asset() { + name_ = ""; + assetType_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Asset( + 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(); + + assetType_ = s; + break; + } + case 26: { + com.google.cloud.asset.v1beta1.Resource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = input.readMessage(com.google.cloud.asset.v1beta1.Resource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + com.google.iam.v1.Policy.Builder subBuilder = null; + if (iamPolicy_ != null) { + subBuilder = iamPolicy_.toBuilder(); + } + iamPolicy_ = input.readMessage(com.google.iam.v1.Policy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(iamPolicy_); + iamPolicy_ = 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.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.Asset.class, com.google.cloud.asset.v1beta1.Asset.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+ * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
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 full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
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 ASSET_TYPE_FIELD_NUMBER = 2;
+ private volatile java.lang.Object assetType_;
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public java.lang.String getAssetType() {
+ java.lang.Object ref = assetType_;
+ 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();
+ assetType_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public com.google.protobuf.ByteString
+ getAssetTypeBytes() {
+ java.lang.Object ref = assetType_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ assetType_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int RESOURCE_FIELD_NUMBER = 3;
+ private com.google.cloud.asset.v1beta1.Resource resource_;
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public boolean hasResource() {
+ return resource_ != null;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Resource getResource() {
+ return resource_ == null ? com.google.cloud.asset.v1beta1.Resource.getDefaultInstance() : resource_;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public com.google.cloud.asset.v1beta1.ResourceOrBuilder getResourceOrBuilder() {
+ return getResource();
+ }
+
+ public static final int IAM_POLICY_FIELD_NUMBER = 4;
+ private com.google.iam.v1.Policy iamPolicy_;
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public boolean hasIamPolicy() {
+ return iamPolicy_ != null;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public com.google.iam.v1.Policy getIamPolicy() {
+ return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder() {
+ return getIamPolicy();
+ }
+
+ 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 (!getAssetTypeBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetType_);
+ }
+ if (resource_ != null) {
+ output.writeMessage(3, getResource());
+ }
+ if (iamPolicy_ != null) {
+ output.writeMessage(4, getIamPolicy());
+ }
+ 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 (!getAssetTypeBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, assetType_);
+ }
+ if (resource_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getResource());
+ }
+ if (iamPolicy_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, getIamPolicy());
+ }
+ 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.cloud.asset.v1beta1.Asset)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.Asset other = (com.google.cloud.asset.v1beta1.Asset) obj;
+
+ boolean result = true;
+ result = result && getName()
+ .equals(other.getName());
+ result = result && getAssetType()
+ .equals(other.getAssetType());
+ result = result && (hasResource() == other.hasResource());
+ if (hasResource()) {
+ result = result && getResource()
+ .equals(other.getResource());
+ }
+ result = result && (hasIamPolicy() == other.hasIamPolicy());
+ if (hasIamPolicy()) {
+ result = result && getIamPolicy()
+ .equals(other.getIamPolicy());
+ }
+ 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) + ASSET_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + getAssetType().hashCode();
+ if (hasResource()) {
+ hash = (37 * hash) + RESOURCE_FIELD_NUMBER;
+ hash = (53 * hash) + getResource().hashCode();
+ }
+ if (hasIamPolicy()) {
+ hash = (37 * hash) + IAM_POLICY_FIELD_NUMBER;
+ hash = (53 * hash) + getIamPolicy().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.Asset parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset 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.cloud.asset.v1beta1.Asset parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset 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.cloud.asset.v1beta1.Asset parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset 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.cloud.asset.v1beta1.Asset parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.Asset 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.cloud.asset.v1beta1.Asset 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;
+ }
+ /**
+ * + * Cloud asset. This include all Google Cloud Platform resources, as well as + * IAM policies and other non-GCP assets. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.Asset} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
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 full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
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 full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
string name = 1;
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
string name = 1;
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
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 assetType_ = "";
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public java.lang.String getAssetType() {
+ java.lang.Object ref = assetType_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ assetType_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public com.google.protobuf.ByteString
+ getAssetTypeBytes() {
+ java.lang.Object ref = assetType_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ assetType_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public Builder setAssetType(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ assetType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public Builder clearAssetType() {
+
+ assetType_ = getDefaultInstance().getAssetType();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ public Builder setAssetTypeBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ assetType_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.asset.v1beta1.Resource resource_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Resource, com.google.cloud.asset.v1beta1.Resource.Builder, com.google.cloud.asset.v1beta1.ResourceOrBuilder> resourceBuilder_;
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public boolean hasResource() {
+ return resourceBuilder_ != null || resource_ != null;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Resource getResource() {
+ if (resourceBuilder_ == null) {
+ return resource_ == null ? com.google.cloud.asset.v1beta1.Resource.getDefaultInstance() : resource_;
+ } else {
+ return resourceBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public Builder setResource(com.google.cloud.asset.v1beta1.Resource value) {
+ if (resourceBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ resource_ = value;
+ onChanged();
+ } else {
+ resourceBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public Builder setResource(
+ com.google.cloud.asset.v1beta1.Resource.Builder builderForValue) {
+ if (resourceBuilder_ == null) {
+ resource_ = builderForValue.build();
+ onChanged();
+ } else {
+ resourceBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public Builder mergeResource(com.google.cloud.asset.v1beta1.Resource value) {
+ if (resourceBuilder_ == null) {
+ if (resource_ != null) {
+ resource_ =
+ com.google.cloud.asset.v1beta1.Resource.newBuilder(resource_).mergeFrom(value).buildPartial();
+ } else {
+ resource_ = value;
+ }
+ onChanged();
+ } else {
+ resourceBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public Builder clearResource() {
+ if (resourceBuilder_ == null) {
+ resource_ = null;
+ onChanged();
+ } else {
+ resource_ = null;
+ resourceBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Resource.Builder getResourceBuilder() {
+
+ onChanged();
+ return getResourceFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ public com.google.cloud.asset.v1beta1.ResourceOrBuilder getResourceOrBuilder() {
+ if (resourceBuilder_ != null) {
+ return resourceBuilder_.getMessageOrBuilder();
+ } else {
+ return resource_ == null ?
+ com.google.cloud.asset.v1beta1.Resource.getDefaultInstance() : resource_;
+ }
+ }
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Resource, com.google.cloud.asset.v1beta1.Resource.Builder, com.google.cloud.asset.v1beta1.ResourceOrBuilder>
+ getResourceFieldBuilder() {
+ if (resourceBuilder_ == null) {
+ resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Resource, com.google.cloud.asset.v1beta1.Resource.Builder, com.google.cloud.asset.v1beta1.ResourceOrBuilder>(
+ getResource(),
+ getParentForChildren(),
+ isClean());
+ resource_ = null;
+ }
+ return resourceBuilder_;
+ }
+
+ private com.google.iam.v1.Policy iamPolicy_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder> iamPolicyBuilder_;
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public boolean hasIamPolicy() {
+ return iamPolicyBuilder_ != null || iamPolicy_ != null;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public com.google.iam.v1.Policy getIamPolicy() {
+ if (iamPolicyBuilder_ == null) {
+ return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_;
+ } else {
+ return iamPolicyBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public Builder setIamPolicy(com.google.iam.v1.Policy value) {
+ if (iamPolicyBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ iamPolicy_ = value;
+ onChanged();
+ } else {
+ iamPolicyBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public Builder setIamPolicy(
+ com.google.iam.v1.Policy.Builder builderForValue) {
+ if (iamPolicyBuilder_ == null) {
+ iamPolicy_ = builderForValue.build();
+ onChanged();
+ } else {
+ iamPolicyBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public Builder mergeIamPolicy(com.google.iam.v1.Policy value) {
+ if (iamPolicyBuilder_ == null) {
+ if (iamPolicy_ != null) {
+ iamPolicy_ =
+ com.google.iam.v1.Policy.newBuilder(iamPolicy_).mergeFrom(value).buildPartial();
+ } else {
+ iamPolicy_ = value;
+ }
+ onChanged();
+ } else {
+ iamPolicyBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public Builder clearIamPolicy() {
+ if (iamPolicyBuilder_ == null) {
+ iamPolicy_ = null;
+ onChanged();
+ } else {
+ iamPolicy_ = null;
+ iamPolicyBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public com.google.iam.v1.Policy.Builder getIamPolicyBuilder() {
+
+ onChanged();
+ return getIamPolicyFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder() {
+ if (iamPolicyBuilder_ != null) {
+ return iamPolicyBuilder_.getMessageOrBuilder();
+ } else {
+ return iamPolicy_ == null ?
+ com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_;
+ }
+ }
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder>
+ getIamPolicyFieldBuilder() {
+ if (iamPolicyBuilder_ == null) {
+ iamPolicyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.iam.v1.Policy, com.google.iam.v1.Policy.Builder, com.google.iam.v1.PolicyOrBuilder>(
+ getIamPolicy(),
+ getParentForChildren(),
+ isClean());
+ iamPolicy_ = null;
+ }
+ return iamPolicyBuilder_;
+ }
+ @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.cloud.asset.v1beta1.Asset)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.Asset)
+ private static final com.google.cloud.asset.v1beta1.Asset DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.Asset();
+ }
+
+ public static com.google.cloud.asset.v1beta1.Asset getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
string name = 1;
+ */
+ java.lang.String getName();
+ /**
+ * + * The full name of the asset. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + *+ * + *
string name = 1;
+ */
+ com.google.protobuf.ByteString
+ getNameBytes();
+
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ java.lang.String getAssetType();
+ /**
+ * + * Type of the asset. Example: "google.compute.disk". + *+ * + *
string asset_type = 2;
+ */
+ com.google.protobuf.ByteString
+ getAssetTypeBytes();
+
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ boolean hasResource();
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ com.google.cloud.asset.v1beta1.Resource getResource();
+ /**
+ * + * Representation of the resource. + *+ * + *
.google.cloud.asset.v1beta1.Resource resource = 3;
+ */
+ com.google.cloud.asset.v1beta1.ResourceOrBuilder getResourceOrBuilder();
+
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ boolean hasIamPolicy();
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ com.google.iam.v1.Policy getIamPolicy();
+ /**
+ * + * Representation of the actual IAM policy set on a cloud resource. For each + * resource, there must be at most one IAM policy set on it. + *+ * + *
.google.iam.v1.Policy iam_policy = 4;
+ */
+ com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetProto.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetProto.java
new file mode 100644
index 000000000000..cb216ad144aa
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetProto.java
@@ -0,0 +1,120 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/assets.proto
+
+package com.google.cloud.asset.v1beta1;
+
+public final class AssetProto {
+ private AssetProto() {}
+ 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_cloud_asset_v1beta1_TemporalAsset_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_TemporalAsset_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_TimeWindow_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_TimeWindow_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_Asset_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_Asset_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_Resource_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_Resource_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/cloud/asset/v1beta1/assets.prot" +
+ "o\022\032google.cloud.asset.v1beta1\032\034google/ap" +
+ "i/annotations.proto\032\032google/iam/v1/polic" +
+ "y.proto\032\031google/protobuf/any.proto\032\034goog" +
+ "le/protobuf/struct.proto\032\037google/protobu" +
+ "f/timestamp.proto\"\212\001\n\rTemporalAsset\0226\n\006w" +
+ "indow\030\001 \001(\0132&.google.cloud.asset.v1beta1" +
+ ".TimeWindow\022\017\n\007deleted\030\002 \001(\010\0220\n\005asset\030\003 " +
+ "\001(\0132!.google.cloud.asset.v1beta1.Asset\"j" +
+ "\n\nTimeWindow\022.\n\nstart_time\030\001 \001(\0132\032.googl" +
+ "e.protobuf.Timestamp\022,\n\010end_time\030\002 \001(\0132\032" +
+ ".google.protobuf.Timestamp\"\214\001\n\005Asset\022\014\n\004" +
+ "name\030\001 \001(\t\022\022\n\nasset_type\030\002 \001(\t\0226\n\010resour" +
+ "ce\030\003 \001(\0132$.google.cloud.asset.v1beta1.Re" +
+ "source\022)\n\niam_policy\030\004 \001(\0132\025.google.iam." +
+ "v1.Policy\"\240\001\n\010Resource\022\017\n\007version\030\001 \001(\t\022" +
+ "\036\n\026discovery_document_uri\030\002 \001(\t\022\026\n\016disco" +
+ "very_name\030\003 \001(\t\022\024\n\014resource_url\030\004 \001(\t\022\016\n" +
+ "\006parent\030\005 \001(\t\022%\n\004data\030\006 \001(\0132\027.google.pro" +
+ "tobuf.StructB\251\001\n\036com.google.cloud.asset." +
+ "v1beta1B\nAssetProtoP\001Z?google.golang.org" +
+ "/genproto/googleapis/cloud/asset/v1beta1" +
+ ";asset\252\002\032Google.Cloud.Asset.V1Beta1\312\002\032Go" +
+ "ogle\\Cloud\\Asset\\V1beta1b\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.PolicyProto.getDescriptor(),
+ com.google.protobuf.AnyProto.getDescriptor(),
+ com.google.protobuf.StructProto.getDescriptor(),
+ com.google.protobuf.TimestampProto.getDescriptor(),
+ }, assigner);
+ internal_static_google_cloud_asset_v1beta1_TemporalAsset_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_google_cloud_asset_v1beta1_TemporalAsset_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_TemporalAsset_descriptor,
+ new java.lang.String[] { "Window", "Deleted", "Asset", });
+ internal_static_google_cloud_asset_v1beta1_TimeWindow_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_google_cloud_asset_v1beta1_TimeWindow_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_TimeWindow_descriptor,
+ new java.lang.String[] { "StartTime", "EndTime", });
+ internal_static_google_cloud_asset_v1beta1_Asset_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_google_cloud_asset_v1beta1_Asset_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_Asset_descriptor,
+ new java.lang.String[] { "Name", "AssetType", "Resource", "IamPolicy", });
+ internal_static_google_cloud_asset_v1beta1_Resource_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_google_cloud_asset_v1beta1_Resource_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_Resource_descriptor,
+ new java.lang.String[] { "Version", "DiscoveryDocumentUri", "DiscoveryName", "ResourceUrl", "Parent", "Data", });
+ com.google.api.AnnotationsProto.getDescriptor();
+ com.google.iam.v1.PolicyProto.getDescriptor();
+ com.google.protobuf.AnyProto.getDescriptor();
+ com.google.protobuf.StructProto.getDescriptor();
+ com.google.protobuf.TimestampProto.getDescriptor();
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceProto.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceProto.java
new file mode 100644
index 000000000000..b340f65a2f97
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceProto.java
@@ -0,0 +1,165 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+public final class AssetServiceProto {
+ private AssetServiceProto() {}
+ 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_cloud_asset_v1beta1_ExportAssetsRequest_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryResponse_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryResponse_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_OutputConfig_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_OutputConfig_fieldAccessorTable;
+ static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_google_cloud_asset_v1beta1_GcsDestination_descriptor;
+ static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_google_cloud_asset_v1beta1_GcsDestination_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/cloud/asset/v1beta1/asset_servi" +
+ "ce.proto\022\032google.cloud.asset.v1beta1\032\034go" +
+ "ogle/api/annotations.proto\032\'google/cloud" +
+ "/asset/v1beta1/assets.proto\032#google/long" +
+ "running/operations.proto\032\037google/protobu" +
+ "f/timestamp.proto\"\351\001\n\023ExportAssetsReques" +
+ "t\022\016\n\006parent\030\001 \001(\t\022-\n\tread_time\030\002 \001(\0132\032.g" +
+ "oogle.protobuf.Timestamp\022\023\n\013asset_types\030" +
+ "\003 \003(\t\022=\n\014content_type\030\004 \001(\0162\'.google.clo" +
+ "ud.asset.v1beta1.ContentType\022?\n\routput_c" +
+ "onfig\030\005 \001(\0132(.google.cloud.asset.v1beta1" +
+ ".OutputConfig\"\206\001\n\024ExportAssetsResponse\022-" +
+ "\n\tread_time\030\001 \001(\0132\032.google.protobuf.Time" +
+ "stamp\022?\n\routput_config\030\002 \001(\0132(.google.cl" +
+ "oud.asset.v1beta1.OutputConfig\"\304\001\n\034Batch" +
+ "GetAssetsHistoryRequest\022\016\n\006parent\030\001 \001(\t\022" +
+ "\023\n\013asset_names\030\002 \003(\t\022=\n\014content_type\030\003 \001" +
+ "(\0162\'.google.cloud.asset.v1beta1.ContentT" +
+ "ype\022@\n\020read_time_window\030\004 \001(\0132&.google.c" +
+ "loud.asset.v1beta1.TimeWindow\"Z\n\035BatchGe" +
+ "tAssetsHistoryResponse\0229\n\006assets\030\001 \003(\0132)" +
+ ".google.cloud.asset.v1beta1.TemporalAsse" +
+ "t\"d\n\014OutputConfig\022E\n\017gcs_destination\030\001 \001" +
+ "(\0132*.google.cloud.asset.v1beta1.GcsDesti" +
+ "nationH\000B\r\n\013destination\"\035\n\016GcsDestinatio" +
+ "n\022\013\n\003uri\030\001 \001(\t*I\n\013ContentType\022\034\n\030CONTENT" +
+ "_TYPE_UNSPECIFIED\020\000\022\014\n\010RESOURCE\020\001\022\016\n\nIAM" +
+ "_POLICY\020\0022\337\003\n\014AssetService\022\311\001\n\014ExportAss" +
+ "ets\022/.google.cloud.asset.v1beta1.ExportA" +
+ "ssetsRequest\032\035.google.longrunning.Operat" +
+ "ion\"i\202\323\344\223\002c\")/v1beta1/{parent=projects/*" +
+ "}:exportAssets:\001*Z3\"./v1beta1/{parent=or" +
+ "ganizations/*}:exportAssets:\001*\022\202\002\n\025Batch" +
+ "GetAssetsHistory\0228.google.cloud.asset.v1" +
+ "beta1.BatchGetAssetsHistoryRequest\0329.goo" +
+ "gle.cloud.asset.v1beta1.BatchGetAssetsHi" +
+ "storyResponse\"t\202\323\344\223\002n\0222/v1beta1/{parent=" +
+ "projects/*}:batchGetAssetsHistoryZ8\0226/v1" +
+ "beta1/{parent=organizations/*}:batchGetA" +
+ "ssetHistoryB\260\001\n\036com.google.cloud.asset.v" +
+ "1beta1B\021AssetServiceProtoP\001Z?google.gola" +
+ "ng.org/genproto/googleapis/cloud/asset/v" +
+ "1beta1;asset\252\002\032Google.Cloud.Asset.V1Beta" +
+ "1\312\002\032Google\\Cloud\\Asset\\V1beta1b\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.cloud.asset.v1beta1.AssetProto.getDescriptor(),
+ com.google.longrunning.OperationsProto.getDescriptor(),
+ com.google.protobuf.TimestampProto.getDescriptor(),
+ }, assigner);
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_descriptor =
+ getDescriptor().getMessageTypes().get(0);
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_descriptor,
+ new java.lang.String[] { "Parent", "ReadTime", "AssetTypes", "ContentType", "OutputConfig", });
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_descriptor =
+ getDescriptor().getMessageTypes().get(1);
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_descriptor,
+ new java.lang.String[] { "ReadTime", "OutputConfig", });
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_descriptor =
+ getDescriptor().getMessageTypes().get(2);
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_descriptor,
+ new java.lang.String[] { "Parent", "AssetNames", "ContentType", "ReadTimeWindow", });
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryResponse_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryResponse_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryResponse_descriptor,
+ new java.lang.String[] { "Assets", });
+ internal_static_google_cloud_asset_v1beta1_OutputConfig_descriptor =
+ getDescriptor().getMessageTypes().get(4);
+ internal_static_google_cloud_asset_v1beta1_OutputConfig_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_OutputConfig_descriptor,
+ new java.lang.String[] { "GcsDestination", "Destination", });
+ internal_static_google_cloud_asset_v1beta1_GcsDestination_descriptor =
+ getDescriptor().getMessageTypes().get(5);
+ internal_static_google_cloud_asset_v1beta1_GcsDestination_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_google_cloud_asset_v1beta1_GcsDestination_descriptor,
+ new java.lang.String[] { "Uri", });
+ 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.cloud.asset.v1beta1.AssetProto.getDescriptor();
+ com.google.longrunning.OperationsProto.getDescriptor();
+ com.google.protobuf.TimestampProto.getDescriptor();
+ }
+
+ // @@protoc_insertion_point(outer_class_scope)
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequest.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequest.java
new file mode 100644
index 000000000000..6f00c7eb3a9a
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryRequest.java
@@ -0,0 +1,1249 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * Batch get assets history request. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} + */ +public final class BatchGetAssetsHistoryRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) + BatchGetAssetsHistoryRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchGetAssetsHistoryRequest.newBuilder() to construct. + private BatchGetAssetsHistoryRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private BatchGetAssetsHistoryRequest() { + parent_ = ""; + assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contentType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchGetAssetsHistoryRequest( + 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(); + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + assetNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + assetNames_.add(s); + break; + } + case 24: { + int rawValue = input.readEnum(); + + contentType_ = rawValue; + break; + } + case 34: { + com.google.cloud.asset.v1beta1.TimeWindow.Builder subBuilder = null; + if (readTimeWindow_ != null) { + subBuilder = readTimeWindow_.toBuilder(); + } + readTimeWindow_ = input.readMessage(com.google.cloud.asset.v1beta1.TimeWindow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTimeWindow_); + readTimeWindow_ = 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 { + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + assetNames_ = assetNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_BatchGetAssetsHistoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.class, com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+ * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
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 ASSET_NAMES_FIELD_NUMBER = 2;
+ private com.google.protobuf.LazyStringList assetNames_;
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public com.google.protobuf.ProtocolStringList
+ getAssetNamesList() {
+ return assetNames_;
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public int getAssetNamesCount() {
+ return assetNames_.size();
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public java.lang.String getAssetNames(int index) {
+ return assetNames_.get(index);
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public com.google.protobuf.ByteString
+ getAssetNamesBytes(int index) {
+ return assetNames_.getByteString(index);
+ }
+
+ public static final int CONTENT_TYPE_FIELD_NUMBER = 3;
+ private int contentType_;
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public int getContentTypeValue() {
+ return contentType_;
+ }
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public com.google.cloud.asset.v1beta1.ContentType getContentType() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.asset.v1beta1.ContentType result = com.google.cloud.asset.v1beta1.ContentType.valueOf(contentType_);
+ return result == null ? com.google.cloud.asset.v1beta1.ContentType.UNRECOGNIZED : result;
+ }
+
+ public static final int READ_TIME_WINDOW_FIELD_NUMBER = 4;
+ private com.google.cloud.asset.v1beta1.TimeWindow readTimeWindow_;
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public boolean hasReadTimeWindow() {
+ return readTimeWindow_ != null;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow getReadTimeWindow() {
+ return readTimeWindow_ == null ? com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : readTimeWindow_;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
+ return getReadTimeWindow();
+ }
+
+ 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 < assetNames_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetNames_.getRaw(i));
+ }
+ if (contentType_ != com.google.cloud.asset.v1beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
+ output.writeEnum(3, contentType_);
+ }
+ if (readTimeWindow_ != null) {
+ output.writeMessage(4, getReadTimeWindow());
+ }
+ 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_);
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < assetNames_.size(); i++) {
+ dataSize += computeStringSizeNoTag(assetNames_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getAssetNamesList().size();
+ }
+ if (contentType_ != com.google.cloud.asset.v1beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(3, contentType_);
+ }
+ if (readTimeWindow_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, getReadTimeWindow());
+ }
+ 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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest other = (com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest) obj;
+
+ boolean result = true;
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && getAssetNamesList()
+ .equals(other.getAssetNamesList());
+ result = result && contentType_ == other.contentType_;
+ result = result && (hasReadTimeWindow() == other.hasReadTimeWindow());
+ if (hasReadTimeWindow()) {
+ result = result && getReadTimeWindow()
+ .equals(other.getReadTimeWindow());
+ }
+ 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 (getAssetNamesCount() > 0) {
+ hash = (37 * hash) + ASSET_NAMES_FIELD_NUMBER;
+ hash = (53 * hash) + getAssetNamesList().hashCode();
+ }
+ hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + contentType_;
+ if (hasReadTimeWindow()) {
+ hash = (37 * hash) + READ_TIME_WINDOW_FIELD_NUMBER;
+ hash = (53 * hash) + getReadTimeWindow().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest 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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest 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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest 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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest 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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest 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;
+ }
+ /**
+ * + * Batch get assets history request. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
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.LazyStringList assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ private void ensureAssetNamesIsMutable() {
+ if (!((bitField0_ & 0x00000002) == 0x00000002)) {
+ assetNames_ = new com.google.protobuf.LazyStringArrayList(assetNames_);
+ bitField0_ |= 0x00000002;
+ }
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public com.google.protobuf.ProtocolStringList
+ getAssetNamesList() {
+ return assetNames_.getUnmodifiableView();
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public int getAssetNamesCount() {
+ return assetNames_.size();
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public java.lang.String getAssetNames(int index) {
+ return assetNames_.get(index);
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public com.google.protobuf.ByteString
+ getAssetNamesBytes(int index) {
+ return assetNames_.getByteString(index);
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public Builder setAssetNames(
+ int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetNamesIsMutable();
+ assetNames_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public Builder addAssetNames(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetNamesIsMutable();
+ assetNames_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public Builder addAllAssetNames(
+ java.lang.Iterable+ * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public Builder clearAssetNames() {
+ assetNames_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000002);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ public Builder addAssetNamesBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureAssetNamesIsMutable();
+ assetNames_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private int contentType_ = 0;
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public int getContentTypeValue() {
+ return contentType_;
+ }
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public Builder setContentTypeValue(int value) {
+ contentType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public com.google.cloud.asset.v1beta1.ContentType getContentType() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.asset.v1beta1.ContentType result = com.google.cloud.asset.v1beta1.ContentType.valueOf(contentType_);
+ return result == null ? com.google.cloud.asset.v1beta1.ContentType.UNRECOGNIZED : result;
+ }
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public Builder setContentType(com.google.cloud.asset.v1beta1.ContentType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ contentType_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ public Builder clearContentType() {
+
+ contentType_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.asset.v1beta1.TimeWindow readTimeWindow_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.TimeWindow, com.google.cloud.asset.v1beta1.TimeWindow.Builder, com.google.cloud.asset.v1beta1.TimeWindowOrBuilder> readTimeWindowBuilder_;
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public boolean hasReadTimeWindow() {
+ return readTimeWindowBuilder_ != null || readTimeWindow_ != null;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow getReadTimeWindow() {
+ if (readTimeWindowBuilder_ == null) {
+ return readTimeWindow_ == null ? com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : readTimeWindow_;
+ } else {
+ return readTimeWindowBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public Builder setReadTimeWindow(com.google.cloud.asset.v1beta1.TimeWindow value) {
+ if (readTimeWindowBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ readTimeWindow_ = value;
+ onChanged();
+ } else {
+ readTimeWindowBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public Builder setReadTimeWindow(
+ com.google.cloud.asset.v1beta1.TimeWindow.Builder builderForValue) {
+ if (readTimeWindowBuilder_ == null) {
+ readTimeWindow_ = builderForValue.build();
+ onChanged();
+ } else {
+ readTimeWindowBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public Builder mergeReadTimeWindow(com.google.cloud.asset.v1beta1.TimeWindow value) {
+ if (readTimeWindowBuilder_ == null) {
+ if (readTimeWindow_ != null) {
+ readTimeWindow_ =
+ com.google.cloud.asset.v1beta1.TimeWindow.newBuilder(readTimeWindow_).mergeFrom(value).buildPartial();
+ } else {
+ readTimeWindow_ = value;
+ }
+ onChanged();
+ } else {
+ readTimeWindowBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public Builder clearReadTimeWindow() {
+ if (readTimeWindowBuilder_ == null) {
+ readTimeWindow_ = null;
+ onChanged();
+ } else {
+ readTimeWindow_ = null;
+ readTimeWindowBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow.Builder getReadTimeWindowBuilder() {
+
+ onChanged();
+ return getReadTimeWindowFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getReadTimeWindowOrBuilder() {
+ if (readTimeWindowBuilder_ != null) {
+ return readTimeWindowBuilder_.getMessageOrBuilder();
+ } else {
+ return readTimeWindow_ == null ?
+ com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : readTimeWindow_;
+ }
+ }
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.TimeWindow, com.google.cloud.asset.v1beta1.TimeWindow.Builder, com.google.cloud.asset.v1beta1.TimeWindowOrBuilder>
+ getReadTimeWindowFieldBuilder() {
+ if (readTimeWindowBuilder_ == null) {
+ readTimeWindowBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.TimeWindow, com.google.cloud.asset.v1beta1.TimeWindow.Builder, com.google.cloud.asset.v1beta1.TimeWindowOrBuilder>(
+ getReadTimeWindow(),
+ getParentForChildren(),
+ isClean());
+ readTimeWindow_ = null;
+ }
+ return readTimeWindowBuilder_;
+ }
+ @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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest)
+ private static final com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest();
+ }
+
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ java.lang.String getParent();
+ /**
+ * + * Required. The relative name of the root asset. It can only be an + * organization number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id")"or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ java.util.List+ * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ int getAssetNamesCount();
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ java.lang.String getAssetNames(int index);
+ /**
+ * + * A list of the full names of the assets. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * Example: + * "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1". + * The request becomes a no-op if the asset name list is empty, and the max + * size of the asset name list is 100 in one request. + *+ * + *
repeated string asset_names = 2;
+ */
+ com.google.protobuf.ByteString
+ getAssetNamesBytes(int index);
+
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ int getContentTypeValue();
+ /**
+ * + * Required. The content type. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 3;
+ */
+ com.google.cloud.asset.v1beta1.ContentType getContentType();
+
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ boolean hasReadTimeWindow();
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ com.google.cloud.asset.v1beta1.TimeWindow getReadTimeWindow();
+ /**
+ * + * Required. The time window for the asset history. The start time is + * required. The returned results contain all temporal assets whose time + * window overlap with read_time_window. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow read_time_window = 4;
+ */
+ com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getReadTimeWindowOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponse.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponse.java
new file mode 100644
index 000000000000..059c23b69d5b
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/BatchGetAssetsHistoryResponse.java
@@ -0,0 +1,859 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * Batch get assets history response. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} + */ +public final class BatchGetAssetsHistoryResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) + BatchGetAssetsHistoryResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use BatchGetAssetsHistoryResponse.newBuilder() to construct. + private BatchGetAssetsHistoryResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private BatchGetAssetsHistoryResponse() { + assets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BatchGetAssetsHistoryResponse( + 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)) { + assets_ = new java.util.ArrayList
+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public java.util.List+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public java.util.List extends com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder>
+ getAssetsOrBuilderList() {
+ return assets_;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public int getAssetsCount() {
+ return assets_.size();
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAsset getAssets(int index) {
+ return assets_.get(index);
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder getAssetsOrBuilder(
+ int index) {
+ return assets_.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 < assets_.size(); i++) {
+ output.writeMessage(1, assets_.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 < assets_.size(); i++) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, assets_.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.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse other = (com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse) obj;
+
+ boolean result = true;
+ result = result && getAssetsList()
+ .equals(other.getAssetsList());
+ 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 (getAssetsCount() > 0) {
+ hash = (37 * hash) + ASSETS_FIELD_NUMBER;
+ hash = (53 * hash) + getAssetsList().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse 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.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse 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.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse 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.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse 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.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse 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;
+ }
+ /**
+ * + * Batch get assets history response. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public java.util.List+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public int getAssetsCount() {
+ if (assetsBuilder_ == null) {
+ return assets_.size();
+ } else {
+ return assetsBuilder_.getCount();
+ }
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAsset getAssets(int index) {
+ if (assetsBuilder_ == null) {
+ return assets_.get(index);
+ } else {
+ return assetsBuilder_.getMessage(index);
+ }
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder setAssets(
+ int index, com.google.cloud.asset.v1beta1.TemporalAsset value) {
+ if (assetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetsIsMutable();
+ assets_.set(index, value);
+ onChanged();
+ } else {
+ assetsBuilder_.setMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder setAssets(
+ int index, com.google.cloud.asset.v1beta1.TemporalAsset.Builder builderForValue) {
+ if (assetsBuilder_ == null) {
+ ensureAssetsIsMutable();
+ assets_.set(index, builderForValue.build());
+ onChanged();
+ } else {
+ assetsBuilder_.setMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder addAssets(com.google.cloud.asset.v1beta1.TemporalAsset value) {
+ if (assetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetsIsMutable();
+ assets_.add(value);
+ onChanged();
+ } else {
+ assetsBuilder_.addMessage(value);
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder addAssets(
+ int index, com.google.cloud.asset.v1beta1.TemporalAsset value) {
+ if (assetsBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetsIsMutable();
+ assets_.add(index, value);
+ onChanged();
+ } else {
+ assetsBuilder_.addMessage(index, value);
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder addAssets(
+ com.google.cloud.asset.v1beta1.TemporalAsset.Builder builderForValue) {
+ if (assetsBuilder_ == null) {
+ ensureAssetsIsMutable();
+ assets_.add(builderForValue.build());
+ onChanged();
+ } else {
+ assetsBuilder_.addMessage(builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder addAssets(
+ int index, com.google.cloud.asset.v1beta1.TemporalAsset.Builder builderForValue) {
+ if (assetsBuilder_ == null) {
+ ensureAssetsIsMutable();
+ assets_.add(index, builderForValue.build());
+ onChanged();
+ } else {
+ assetsBuilder_.addMessage(index, builderForValue.build());
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder addAllAssets(
+ java.lang.Iterable extends com.google.cloud.asset.v1beta1.TemporalAsset> values) {
+ if (assetsBuilder_ == null) {
+ ensureAssetsIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, assets_);
+ onChanged();
+ } else {
+ assetsBuilder_.addAllMessages(values);
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder clearAssets() {
+ if (assetsBuilder_ == null) {
+ assets_ = java.util.Collections.emptyList();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ } else {
+ assetsBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public Builder removeAssets(int index) {
+ if (assetsBuilder_ == null) {
+ ensureAssetsIsMutable();
+ assets_.remove(index);
+ onChanged();
+ } else {
+ assetsBuilder_.remove(index);
+ }
+ return this;
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAsset.Builder getAssetsBuilder(
+ int index) {
+ return getAssetsFieldBuilder().getBuilder(index);
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder getAssetsOrBuilder(
+ int index) {
+ if (assetsBuilder_ == null) {
+ return assets_.get(index); } else {
+ return assetsBuilder_.getMessageOrBuilder(index);
+ }
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public java.util.List extends com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder>
+ getAssetsOrBuilderList() {
+ if (assetsBuilder_ != null) {
+ return assetsBuilder_.getMessageOrBuilderList();
+ } else {
+ return java.util.Collections.unmodifiableList(assets_);
+ }
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAsset.Builder addAssetsBuilder() {
+ return getAssetsFieldBuilder().addBuilder(
+ com.google.cloud.asset.v1beta1.TemporalAsset.getDefaultInstance());
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TemporalAsset.Builder addAssetsBuilder(
+ int index) {
+ return getAssetsFieldBuilder().addBuilder(
+ index, com.google.cloud.asset.v1beta1.TemporalAsset.getDefaultInstance());
+ }
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ public java.util.List+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ java.util.List+ * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ com.google.cloud.asset.v1beta1.TemporalAsset getAssets(int index);
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ int getAssetsCount();
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ java.util.List extends com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder>
+ getAssetsOrBuilderList();
+ /**
+ * + * A list of assets with valid time windows. + *+ * + *
repeated .google.cloud.asset.v1beta1.TemporalAsset assets = 1;
+ */
+ com.google.cloud.asset.v1beta1.TemporalAssetOrBuilder getAssetsOrBuilder(
+ int index);
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ContentType.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ContentType.java
new file mode 100644
index 000000000000..d3caa84afb59
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ContentType.java
@@ -0,0 +1,140 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * Asset content type. + *+ * + * Protobuf enum {@code google.cloud.asset.v1beta1.ContentType} + */ +public enum ContentType + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+ * Unspecified content type. + *+ * + *
CONTENT_TYPE_UNSPECIFIED = 0;
+ */
+ CONTENT_TYPE_UNSPECIFIED(0),
+ /**
+ * + * Resource metadata. + *+ * + *
RESOURCE = 1;
+ */
+ RESOURCE(1),
+ /**
+ * + * The actual IAM policy set on a resource. + *+ * + *
IAM_POLICY = 2;
+ */
+ IAM_POLICY(2),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * + * Unspecified content type. + *+ * + *
CONTENT_TYPE_UNSPECIFIED = 0;
+ */
+ public static final int CONTENT_TYPE_UNSPECIFIED_VALUE = 0;
+ /**
+ * + * Resource metadata. + *+ * + *
RESOURCE = 1;
+ */
+ public static final int RESOURCE_VALUE = 1;
+ /**
+ * + * The actual IAM policy set on a resource. + *+ * + *
IAM_POLICY = 2;
+ */
+ public static final int IAM_POLICY_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 ContentType valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static ContentType forNumber(int value) {
+ switch (value) {
+ case 0: return CONTENT_TYPE_UNSPECIFIED;
+ case 1: return RESOURCE;
+ case 2: return IAM_POLICY;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Export asset request. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.ExportAssetsRequest} + */ +public final class ExportAssetsRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.ExportAssetsRequest) + ExportAssetsRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExportAssetsRequest.newBuilder() to construct. + private ExportAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private ExportAssetsRequest() { + parent_ = ""; + assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contentType_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExportAssetsRequest( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + assetTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + assetTypes_.add(s); + break; + } + case 32: { + int rawValue = input.readEnum(); + + contentType_ = rawValue; + break; + } + case 42: { + com.google.cloud.asset.v1beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.asset.v1beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = 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 { + if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { + assetTypes_ = assetTypes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_ExportAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.ExportAssetsRequest.class, com.google.cloud.asset.v1beta1.ExportAssetsRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+ * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
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 READ_TIME_FIELD_NUMBER = 2;
+ private com.google.protobuf.Timestamp readTime_;
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public boolean hasReadTime() {
+ return readTime_ != null;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public com.google.protobuf.Timestamp getReadTime() {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ return getReadTime();
+ }
+
+ public static final int ASSET_TYPES_FIELD_NUMBER = 3;
+ private com.google.protobuf.LazyStringList assetTypes_;
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public com.google.protobuf.ProtocolStringList
+ getAssetTypesList() {
+ return assetTypes_;
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public int getAssetTypesCount() {
+ return assetTypes_.size();
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public java.lang.String getAssetTypes(int index) {
+ return assetTypes_.get(index);
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public com.google.protobuf.ByteString
+ getAssetTypesBytes(int index) {
+ return assetTypes_.getByteString(index);
+ }
+
+ public static final int CONTENT_TYPE_FIELD_NUMBER = 4;
+ private int contentType_;
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public int getContentTypeValue() {
+ return contentType_;
+ }
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public com.google.cloud.asset.v1beta1.ContentType getContentType() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.asset.v1beta1.ContentType result = com.google.cloud.asset.v1beta1.ContentType.valueOf(contentType_);
+ return result == null ? com.google.cloud.asset.v1beta1.ContentType.UNRECOGNIZED : result;
+ }
+
+ public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5;
+ private com.google.cloud.asset.v1beta1.OutputConfig outputConfig_;
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public boolean hasOutputConfig() {
+ return outputConfig_ != null;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig() {
+ return outputConfig_ == null ? com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() {
+ return getOutputConfig();
+ }
+
+ 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 (readTime_ != null) {
+ output.writeMessage(2, getReadTime());
+ }
+ for (int i = 0; i < assetTypes_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, assetTypes_.getRaw(i));
+ }
+ if (contentType_ != com.google.cloud.asset.v1beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
+ output.writeEnum(4, contentType_);
+ }
+ if (outputConfig_ != null) {
+ output.writeMessage(5, getOutputConfig());
+ }
+ 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 (readTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getReadTime());
+ }
+ {
+ int dataSize = 0;
+ for (int i = 0; i < assetTypes_.size(); i++) {
+ dataSize += computeStringSizeNoTag(assetTypes_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getAssetTypesList().size();
+ }
+ if (contentType_ != com.google.cloud.asset.v1beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(4, contentType_);
+ }
+ if (outputConfig_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, getOutputConfig());
+ }
+ 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.cloud.asset.v1beta1.ExportAssetsRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.ExportAssetsRequest other = (com.google.cloud.asset.v1beta1.ExportAssetsRequest) obj;
+
+ boolean result = true;
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && (hasReadTime() == other.hasReadTime());
+ if (hasReadTime()) {
+ result = result && getReadTime()
+ .equals(other.getReadTime());
+ }
+ result = result && getAssetTypesList()
+ .equals(other.getAssetTypesList());
+ result = result && contentType_ == other.contentType_;
+ result = result && (hasOutputConfig() == other.hasOutputConfig());
+ if (hasOutputConfig()) {
+ result = result && getOutputConfig()
+ .equals(other.getOutputConfig());
+ }
+ 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 (hasReadTime()) {
+ hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getReadTime().hashCode();
+ }
+ if (getAssetTypesCount() > 0) {
+ hash = (37 * hash) + ASSET_TYPES_FIELD_NUMBER;
+ hash = (53 * hash) + getAssetTypesList().hashCode();
+ }
+ hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER;
+ hash = (53 * hash) + contentType_;
+ if (hasOutputConfig()) {
+ hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
+ hash = (53 * hash) + getOutputConfig().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest 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.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest 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.cloud.asset.v1beta1.ExportAssetsRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest 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.cloud.asset.v1beta1.ExportAssetsRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest 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.cloud.asset.v1beta1.ExportAssetsRequest 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;
+ }
+ /**
+ * + * Export asset request. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.ExportAssetsRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
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;
+ }
+ }
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
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.Timestamp readTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> readTimeBuilder_;
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public boolean hasReadTime() {
+ return readTimeBuilder_ != null || readTime_ != null;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public com.google.protobuf.Timestamp getReadTime() {
+ if (readTimeBuilder_ == null) {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ } else {
+ return readTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public Builder setReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ readTime_ = value;
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public Builder setReadTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (readTimeBuilder_ == null) {
+ readTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (readTime_ != null) {
+ readTime_ =
+ com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial();
+ } else {
+ readTime_ = value;
+ }
+ onChanged();
+ } else {
+ readTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public Builder clearReadTime() {
+ if (readTimeBuilder_ == null) {
+ readTime_ = null;
+ onChanged();
+ } else {
+ readTime_ = null;
+ readTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
+
+ onChanged();
+ return getReadTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ if (readTimeBuilder_ != null) {
+ return readTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return readTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ }
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getReadTimeFieldBuilder() {
+ if (readTimeBuilder_ == null) {
+ readTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getReadTime(),
+ getParentForChildren(),
+ isClean());
+ readTime_ = null;
+ }
+ return readTimeBuilder_;
+ }
+
+ private com.google.protobuf.LazyStringList assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ private void ensureAssetTypesIsMutable() {
+ if (!((bitField0_ & 0x00000004) == 0x00000004)) {
+ assetTypes_ = new com.google.protobuf.LazyStringArrayList(assetTypes_);
+ bitField0_ |= 0x00000004;
+ }
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public com.google.protobuf.ProtocolStringList
+ getAssetTypesList() {
+ return assetTypes_.getUnmodifiableView();
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public int getAssetTypesCount() {
+ return assetTypes_.size();
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public java.lang.String getAssetTypes(int index) {
+ return assetTypes_.get(index);
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public com.google.protobuf.ByteString
+ getAssetTypesBytes(int index) {
+ return assetTypes_.getByteString(index);
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public Builder setAssetTypes(
+ int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetTypesIsMutable();
+ assetTypes_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public Builder addAssetTypes(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAssetTypesIsMutable();
+ assetTypes_.add(value);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public Builder addAllAssetTypes(
+ java.lang.Iterable+ * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public Builder clearAssetTypes() {
+ assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000004);
+ onChanged();
+ return this;
+ }
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ public Builder addAssetTypesBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+ ensureAssetTypesIsMutable();
+ assetTypes_.add(value);
+ onChanged();
+ return this;
+ }
+
+ private int contentType_ = 0;
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public int getContentTypeValue() {
+ return contentType_;
+ }
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public Builder setContentTypeValue(int value) {
+ contentType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public com.google.cloud.asset.v1beta1.ContentType getContentType() {
+ @SuppressWarnings("deprecation")
+ com.google.cloud.asset.v1beta1.ContentType result = com.google.cloud.asset.v1beta1.ContentType.valueOf(contentType_);
+ return result == null ? com.google.cloud.asset.v1beta1.ContentType.UNRECOGNIZED : result;
+ }
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public Builder setContentType(com.google.cloud.asset.v1beta1.ContentType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ contentType_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ public Builder clearContentType() {
+
+ contentType_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.asset.v1beta1.OutputConfig outputConfig_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder> outputConfigBuilder_;
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public boolean hasOutputConfig() {
+ return outputConfigBuilder_ != null || outputConfig_ != null;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig() {
+ if (outputConfigBuilder_ == null) {
+ return outputConfig_ == null ? com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ } else {
+ return outputConfigBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public Builder setOutputConfig(com.google.cloud.asset.v1beta1.OutputConfig value) {
+ if (outputConfigBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ outputConfig_ = value;
+ onChanged();
+ } else {
+ outputConfigBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public Builder setOutputConfig(
+ com.google.cloud.asset.v1beta1.OutputConfig.Builder builderForValue) {
+ if (outputConfigBuilder_ == null) {
+ outputConfig_ = builderForValue.build();
+ onChanged();
+ } else {
+ outputConfigBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public Builder mergeOutputConfig(com.google.cloud.asset.v1beta1.OutputConfig value) {
+ if (outputConfigBuilder_ == null) {
+ if (outputConfig_ != null) {
+ outputConfig_ =
+ com.google.cloud.asset.v1beta1.OutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial();
+ } else {
+ outputConfig_ = value;
+ }
+ onChanged();
+ } else {
+ outputConfigBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public Builder clearOutputConfig() {
+ if (outputConfigBuilder_ == null) {
+ outputConfig_ = null;
+ onChanged();
+ } else {
+ outputConfig_ = null;
+ outputConfigBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig.Builder getOutputConfigBuilder() {
+
+ onChanged();
+ return getOutputConfigFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() {
+ if (outputConfigBuilder_ != null) {
+ return outputConfigBuilder_.getMessageOrBuilder();
+ } else {
+ return outputConfig_ == null ?
+ com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ }
+ }
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder>
+ getOutputConfigFieldBuilder() {
+ if (outputConfigBuilder_ == null) {
+ outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder>(
+ getOutputConfig(),
+ getParentForChildren(),
+ isClean());
+ outputConfig_ = null;
+ }
+ return outputConfigBuilder_;
+ }
+ @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.cloud.asset.v1beta1.ExportAssetsRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.ExportAssetsRequest)
+ private static final com.google.cloud.asset.v1beta1.ExportAssetsRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.ExportAssetsRequest();
+ }
+
+ public static com.google.cloud.asset.v1beta1.ExportAssetsRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ java.lang.String getParent();
+ /**
+ * + * Required. The relative name of the root asset. Can only be an organization + * number (such as "organizations/123"), or a project id (such as + * "projects/my-project-id") or a project number (such as "projects/12345"). + *+ * + *
string parent = 1;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ boolean hasReadTime();
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ com.google.protobuf.Timestamp getReadTime();
+ /**
+ * + * Timestamp to take an asset snapshot. This can only be set to a timestamp in + * the past or of the current time. If not specified, the current time will be + * used. Due to delays in resource data collection and indexing, there is a + * volatile window during which running the same query may get different + * results. + *+ * + *
.google.protobuf.Timestamp read_time = 2;
+ */
+ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder();
+
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ java.util.List+ * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ int getAssetTypesCount();
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ java.lang.String getAssetTypes(int index);
+ /**
+ * + * A list of asset types of which to take a snapshot for. Example: + * "google.compute.disk". If specified, only matching assets will be returned. + *+ * + *
repeated string asset_types = 3;
+ */
+ com.google.protobuf.ByteString
+ getAssetTypesBytes(int index);
+
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ int getContentTypeValue();
+ /**
+ * + * Asset content type. If not specified, no content but the asset name will be + * returned. + *+ * + *
.google.cloud.asset.v1beta1.ContentType content_type = 4;
+ */
+ com.google.cloud.asset.v1beta1.ContentType getContentType();
+
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ boolean hasOutputConfig();
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig();
+ /**
+ * + * Required. Output configuration indicating where the results will be output + * to. All results will be in newline delimited JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 5;
+ */
+ com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponse.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponse.java
new file mode 100644
index 000000000000..e9ef44b952b3
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ExportAssetsResponse.java
@@ -0,0 +1,896 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * The export asset response. This message is returned by the + * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned + * [google.longrunning.Operation.response][google.longrunning.Operation.response] field. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.ExportAssetsResponse} + */ +public final class ExportAssetsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.ExportAssetsResponse) + ExportAssetsResponseOrBuilder { +private static final long serialVersionUID = 0L; + // Use ExportAssetsResponse.newBuilder() to construct. + private ExportAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private ExportAssetsResponse() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExportAssetsResponse( + 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.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + com.google.cloud.asset.v1beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = input.readMessage(com.google.cloud.asset.v1beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = 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.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_ExportAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.ExportAssetsResponse.class, com.google.cloud.asset.v1beta1.ExportAssetsResponse.Builder.class); + } + + public static final int READ_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp readTime_; + /** + *
+ * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public boolean hasReadTime() {
+ return readTime_ != null;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public com.google.protobuf.Timestamp getReadTime() {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ return getReadTime();
+ }
+
+ public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2;
+ private com.google.cloud.asset.v1beta1.OutputConfig outputConfig_;
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public boolean hasOutputConfig() {
+ return outputConfig_ != null;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig() {
+ return outputConfig_ == null ? com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() {
+ return getOutputConfig();
+ }
+
+ 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 (readTime_ != null) {
+ output.writeMessage(1, getReadTime());
+ }
+ if (outputConfig_ != null) {
+ output.writeMessage(2, getOutputConfig());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (readTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getReadTime());
+ }
+ if (outputConfig_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getOutputConfig());
+ }
+ 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.cloud.asset.v1beta1.ExportAssetsResponse)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.ExportAssetsResponse other = (com.google.cloud.asset.v1beta1.ExportAssetsResponse) obj;
+
+ boolean result = true;
+ result = result && (hasReadTime() == other.hasReadTime());
+ if (hasReadTime()) {
+ result = result && getReadTime()
+ .equals(other.getReadTime());
+ }
+ result = result && (hasOutputConfig() == other.hasOutputConfig());
+ if (hasOutputConfig()) {
+ result = result && getOutputConfig()
+ .equals(other.getOutputConfig());
+ }
+ 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 (hasReadTime()) {
+ hash = (37 * hash) + READ_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getReadTime().hashCode();
+ }
+ if (hasOutputConfig()) {
+ hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER;
+ hash = (53 * hash) + getOutputConfig().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse 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.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse 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.cloud.asset.v1beta1.ExportAssetsResponse parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse 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.cloud.asset.v1beta1.ExportAssetsResponse parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse 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.cloud.asset.v1beta1.ExportAssetsResponse 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 export asset response. This message is returned by the + * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned + * [google.longrunning.Operation.response][google.longrunning.Operation.response] field. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.ExportAssetsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public boolean hasReadTime() {
+ return readTimeBuilder_ != null || readTime_ != null;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public com.google.protobuf.Timestamp getReadTime() {
+ if (readTimeBuilder_ == null) {
+ return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ } else {
+ return readTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public Builder setReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ readTime_ = value;
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public Builder setReadTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (readTimeBuilder_ == null) {
+ readTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ readTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public Builder mergeReadTime(com.google.protobuf.Timestamp value) {
+ if (readTimeBuilder_ == null) {
+ if (readTime_ != null) {
+ readTime_ =
+ com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial();
+ } else {
+ readTime_ = value;
+ }
+ onChanged();
+ } else {
+ readTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public Builder clearReadTime() {
+ if (readTimeBuilder_ == null) {
+ readTime_ = null;
+ onChanged();
+ } else {
+ readTime_ = null;
+ readTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() {
+
+ onChanged();
+ return getReadTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() {
+ if (readTimeBuilder_ != null) {
+ return readTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return readTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : readTime_;
+ }
+ }
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getReadTimeFieldBuilder() {
+ if (readTimeBuilder_ == null) {
+ readTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getReadTime(),
+ getParentForChildren(),
+ isClean());
+ readTime_ = null;
+ }
+ return readTimeBuilder_;
+ }
+
+ private com.google.cloud.asset.v1beta1.OutputConfig outputConfig_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder> outputConfigBuilder_;
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public boolean hasOutputConfig() {
+ return outputConfigBuilder_ != null || outputConfig_ != null;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig() {
+ if (outputConfigBuilder_ == null) {
+ return outputConfig_ == null ? com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ } else {
+ return outputConfigBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public Builder setOutputConfig(com.google.cloud.asset.v1beta1.OutputConfig value) {
+ if (outputConfigBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ outputConfig_ = value;
+ onChanged();
+ } else {
+ outputConfigBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public Builder setOutputConfig(
+ com.google.cloud.asset.v1beta1.OutputConfig.Builder builderForValue) {
+ if (outputConfigBuilder_ == null) {
+ outputConfig_ = builderForValue.build();
+ onChanged();
+ } else {
+ outputConfigBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public Builder mergeOutputConfig(com.google.cloud.asset.v1beta1.OutputConfig value) {
+ if (outputConfigBuilder_ == null) {
+ if (outputConfig_ != null) {
+ outputConfig_ =
+ com.google.cloud.asset.v1beta1.OutputConfig.newBuilder(outputConfig_).mergeFrom(value).buildPartial();
+ } else {
+ outputConfig_ = value;
+ }
+ onChanged();
+ } else {
+ outputConfigBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public Builder clearOutputConfig() {
+ if (outputConfigBuilder_ == null) {
+ outputConfig_ = null;
+ onChanged();
+ } else {
+ outputConfig_ = null;
+ outputConfigBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfig.Builder getOutputConfigBuilder() {
+
+ onChanged();
+ return getOutputConfigFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ public com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() {
+ if (outputConfigBuilder_ != null) {
+ return outputConfigBuilder_.getMessageOrBuilder();
+ } else {
+ return outputConfig_ == null ?
+ com.google.cloud.asset.v1beta1.OutputConfig.getDefaultInstance() : outputConfig_;
+ }
+ }
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder>
+ getOutputConfigFieldBuilder() {
+ if (outputConfigBuilder_ == null) {
+ outputConfigBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.OutputConfig, com.google.cloud.asset.v1beta1.OutputConfig.Builder, com.google.cloud.asset.v1beta1.OutputConfigOrBuilder>(
+ getOutputConfig(),
+ getParentForChildren(),
+ isClean());
+ outputConfig_ = null;
+ }
+ return outputConfigBuilder_;
+ }
+ @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.cloud.asset.v1beta1.ExportAssetsResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.ExportAssetsResponse)
+ private static final com.google.cloud.asset.v1beta1.ExportAssetsResponse DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.ExportAssetsResponse();
+ }
+
+ public static com.google.cloud.asset.v1beta1.ExportAssetsResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ boolean hasReadTime();
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ com.google.protobuf.Timestamp getReadTime();
+ /**
+ * + * Time the snapshot was taken. + *+ * + *
.google.protobuf.Timestamp read_time = 1;
+ */
+ com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder();
+
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ boolean hasOutputConfig();
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ com.google.cloud.asset.v1beta1.OutputConfig getOutputConfig();
+ /**
+ * + * Output configuration indicating where the results were output to. + * All results are in JSON format. + *+ * + *
.google.cloud.asset.v1beta1.OutputConfig output_config = 2;
+ */
+ com.google.cloud.asset.v1beta1.OutputConfigOrBuilder getOutputConfigOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestination.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestination.java
new file mode 100644
index 000000000000..213c84e267d4
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/GcsDestination.java
@@ -0,0 +1,598 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * A Google Cloud Storage (GCS) location. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.GcsDestination} + */ +public final class GcsDestination extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.GcsDestination) + GcsDestinationOrBuilder { +private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private GcsDestination() { + uri_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GcsDestination( + 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(); + + uri_ = 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.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.GcsDestination.class, com.google.cloud.asset.v1beta1.GcsDestination.Builder.class); + } + + public static final int URI_FIELD_NUMBER = 1; + private volatile java.lang.Object uri_; + /** + *
+ * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ 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 path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ 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;
+ }
+ }
+
+ 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 (!getUriBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uri_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getUriBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, uri_);
+ }
+ 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.cloud.asset.v1beta1.GcsDestination)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.GcsDestination other = (com.google.cloud.asset.v1beta1.GcsDestination) obj;
+
+ boolean result = true;
+ result = result && getUri()
+ .equals(other.getUri());
+ 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) + URI_FIELD_NUMBER;
+ hash = (53 * hash) + getUri().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.GcsDestination parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination 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.cloud.asset.v1beta1.GcsDestination parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination 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.cloud.asset.v1beta1.GcsDestination parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination 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.cloud.asset.v1beta1.GcsDestination parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.GcsDestination 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.cloud.asset.v1beta1.GcsDestination 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 Google Cloud Storage (GCS) location. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.GcsDestination} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ 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 path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ 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 path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ public Builder setUri(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ uri_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ public Builder clearUri() {
+
+ uri_ = getDefaultInstance().getUri();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ public Builder setUriBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ uri_ = 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.cloud.asset.v1beta1.GcsDestination)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.GcsDestination)
+ private static final com.google.cloud.asset.v1beta1.GcsDestination DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.GcsDestination();
+ }
+
+ public static com.google.cloud.asset.v1beta1.GcsDestination getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ java.lang.String getUri();
+ /**
+ * + * The path of the GCS objects. It's the same path that is used by gsutil, for + * example: "gs://bucket_name/object_path". See: + * https://cloud.google.com/storage/docs/viewing-editing-metadata for more + * information. + *+ * + *
string uri = 1;
+ */
+ com.google.protobuf.ByteString
+ getUriBytes();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfig.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfig.java
new file mode 100644
index 000000000000..b034f0192a89
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/OutputConfig.java
@@ -0,0 +1,742 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/asset_service.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * Output configuration for export assets destination. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.OutputConfig} + */ +public final class OutputConfig extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.OutputConfig) + OutputConfigOrBuilder { +private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private OutputConfig() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private OutputConfig( + 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.cloud.asset.v1beta1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = ((com.google.cloud.asset.v1beta1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage(com.google.cloud.asset.v1beta1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.asset.v1beta1.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 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 com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetServiceProto.internal_static_google_cloud_asset_v1beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.OutputConfig.class, com.google.cloud.asset.v1beta1.OutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + public enum DestinationCase + implements com.google.protobuf.Internal.EnumLite { + GCS_DESTINATION(1), + DESTINATION_NOT_SET(0); + private final int value; + private DestinationCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: return GCS_DESTINATION; + case 0: return DESTINATION_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public DestinationCase + getDestinationCase() { + return DestinationCase.forNumber( + destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + *
+ * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public boolean hasGcsDestination() {
+ return destinationCase_ == 1;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public com.google.cloud.asset.v1beta1.GcsDestination getGcsDestination() {
+ if (destinationCase_ == 1) {
+ return (com.google.cloud.asset.v1beta1.GcsDestination) destination_;
+ }
+ return com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance();
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public com.google.cloud.asset.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
+ if (destinationCase_ == 1) {
+ return (com.google.cloud.asset.v1beta1.GcsDestination) destination_;
+ }
+ return com.google.cloud.asset.v1beta1.GcsDestination.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 (destinationCase_ == 1) {
+ output.writeMessage(1, (com.google.cloud.asset.v1beta1.GcsDestination) destination_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (destinationCase_ == 1) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, (com.google.cloud.asset.v1beta1.GcsDestination) destination_);
+ }
+ 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.cloud.asset.v1beta1.OutputConfig)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.OutputConfig other = (com.google.cloud.asset.v1beta1.OutputConfig) obj;
+
+ boolean result = true;
+ result = result && getDestinationCase().equals(
+ other.getDestinationCase());
+ if (!result) return false;
+ switch (destinationCase_) {
+ case 1:
+ result = result && getGcsDestination()
+ .equals(other.getGcsDestination());
+ 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 (destinationCase_) {
+ case 1:
+ hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER;
+ hash = (53 * hash) + getGcsDestination().hashCode();
+ break;
+ case 0:
+ default:
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.OutputConfig parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig 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.cloud.asset.v1beta1.OutputConfig parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig 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.cloud.asset.v1beta1.OutputConfig parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig 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.cloud.asset.v1beta1.OutputConfig parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.OutputConfig 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.cloud.asset.v1beta1.OutputConfig 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;
+ }
+ /**
+ * + * Output configuration for export assets destination. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.OutputConfig} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public boolean hasGcsDestination() {
+ return destinationCase_ == 1;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public com.google.cloud.asset.v1beta1.GcsDestination getGcsDestination() {
+ if (gcsDestinationBuilder_ == null) {
+ if (destinationCase_ == 1) {
+ return (com.google.cloud.asset.v1beta1.GcsDestination) destination_;
+ }
+ return com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance();
+ } else {
+ if (destinationCase_ == 1) {
+ return gcsDestinationBuilder_.getMessage();
+ }
+ return com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public Builder setGcsDestination(com.google.cloud.asset.v1beta1.GcsDestination value) {
+ if (gcsDestinationBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ destination_ = value;
+ onChanged();
+ } else {
+ gcsDestinationBuilder_.setMessage(value);
+ }
+ destinationCase_ = 1;
+ return this;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public Builder setGcsDestination(
+ com.google.cloud.asset.v1beta1.GcsDestination.Builder builderForValue) {
+ if (gcsDestinationBuilder_ == null) {
+ destination_ = builderForValue.build();
+ onChanged();
+ } else {
+ gcsDestinationBuilder_.setMessage(builderForValue.build());
+ }
+ destinationCase_ = 1;
+ return this;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public Builder mergeGcsDestination(com.google.cloud.asset.v1beta1.GcsDestination value) {
+ if (gcsDestinationBuilder_ == null) {
+ if (destinationCase_ == 1 &&
+ destination_ != com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance()) {
+ destination_ = com.google.cloud.asset.v1beta1.GcsDestination.newBuilder((com.google.cloud.asset.v1beta1.GcsDestination) destination_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ destination_ = value;
+ }
+ onChanged();
+ } else {
+ if (destinationCase_ == 1) {
+ gcsDestinationBuilder_.mergeFrom(value);
+ }
+ gcsDestinationBuilder_.setMessage(value);
+ }
+ destinationCase_ = 1;
+ return this;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public Builder clearGcsDestination() {
+ if (gcsDestinationBuilder_ == null) {
+ if (destinationCase_ == 1) {
+ destinationCase_ = 0;
+ destination_ = null;
+ onChanged();
+ }
+ } else {
+ if (destinationCase_ == 1) {
+ destinationCase_ = 0;
+ destination_ = null;
+ }
+ gcsDestinationBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public com.google.cloud.asset.v1beta1.GcsDestination.Builder getGcsDestinationBuilder() {
+ return getGcsDestinationFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ public com.google.cloud.asset.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() {
+ if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) {
+ return gcsDestinationBuilder_.getMessageOrBuilder();
+ } else {
+ if (destinationCase_ == 1) {
+ return (com.google.cloud.asset.v1beta1.GcsDestination) destination_;
+ }
+ return com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.GcsDestination, com.google.cloud.asset.v1beta1.GcsDestination.Builder, com.google.cloud.asset.v1beta1.GcsDestinationOrBuilder>
+ getGcsDestinationFieldBuilder() {
+ if (gcsDestinationBuilder_ == null) {
+ if (!(destinationCase_ == 1)) {
+ destination_ = com.google.cloud.asset.v1beta1.GcsDestination.getDefaultInstance();
+ }
+ gcsDestinationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.GcsDestination, com.google.cloud.asset.v1beta1.GcsDestination.Builder, com.google.cloud.asset.v1beta1.GcsDestinationOrBuilder>(
+ (com.google.cloud.asset.v1beta1.GcsDestination) destination_,
+ getParentForChildren(),
+ isClean());
+ destination_ = null;
+ }
+ destinationCase_ = 1;
+ onChanged();;
+ return gcsDestinationBuilder_;
+ }
+ @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.cloud.asset.v1beta1.OutputConfig)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.OutputConfig)
+ private static final com.google.cloud.asset.v1beta1.OutputConfig DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.OutputConfig();
+ }
+
+ public static com.google.cloud.asset.v1beta1.OutputConfig getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ boolean hasGcsDestination();
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ com.google.cloud.asset.v1beta1.GcsDestination getGcsDestination();
+ /**
+ * + * Destination on Google Cloud Storage (GCS). + *+ * + *
.google.cloud.asset.v1beta1.GcsDestination gcs_destination = 1;
+ */
+ com.google.cloud.asset.v1beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder();
+
+ public com.google.cloud.asset.v1beta1.OutputConfig.DestinationCase getDestinationCase();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ProjectName.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/ProjectName.java
new file mode 100644
index 000000000000..2d5a7149ee52
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/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.cloud.asset.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+ * Representation of a cloud resource. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.Resource} + */ +public final class Resource extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.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() { + version_ = ""; + discoveryDocumentUri_ = ""; + discoveryName_ = ""; + resourceUrl_ = ""; + parent_ = ""; + } + + @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(); + + version_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + discoveryDocumentUri_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + discoveryName_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUrl_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 50: { + com.google.protobuf.Struct.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = 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.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.Resource.class, com.google.cloud.asset.v1beta1.Resource.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + *
+ * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public java.lang.String getVersion() {
+ java.lang.Object ref = version_;
+ 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();
+ version_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public com.google.protobuf.ByteString
+ getVersionBytes() {
+ java.lang.Object ref = version_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ version_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DISCOVERY_DOCUMENT_URI_FIELD_NUMBER = 2;
+ private volatile java.lang.Object discoveryDocumentUri_;
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public java.lang.String getDiscoveryDocumentUri() {
+ java.lang.Object ref = discoveryDocumentUri_;
+ 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();
+ discoveryDocumentUri_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public com.google.protobuf.ByteString
+ getDiscoveryDocumentUriBytes() {
+ java.lang.Object ref = discoveryDocumentUri_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ discoveryDocumentUri_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int DISCOVERY_NAME_FIELD_NUMBER = 3;
+ private volatile java.lang.Object discoveryName_;
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public java.lang.String getDiscoveryName() {
+ java.lang.Object ref = discoveryName_;
+ 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();
+ discoveryName_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public com.google.protobuf.ByteString
+ getDiscoveryNameBytes() {
+ java.lang.Object ref = discoveryName_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ discoveryName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int RESOURCE_URL_FIELD_NUMBER = 4;
+ private volatile java.lang.Object resourceUrl_;
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ 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 REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ 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 PARENT_FIELD_NUMBER = 5;
+ private volatile java.lang.Object parent_;
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ 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 full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ 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 DATA_FIELD_NUMBER = 6;
+ private com.google.protobuf.Struct data_;
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public boolean hasData() {
+ return data_ != null;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public com.google.protobuf.Struct getData() {
+ return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public com.google.protobuf.StructOrBuilder getDataOrBuilder() {
+ return getData();
+ }
+
+ 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 (!getVersionBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_);
+ }
+ if (!getDiscoveryDocumentUriBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, discoveryDocumentUri_);
+ }
+ if (!getDiscoveryNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 3, discoveryName_);
+ }
+ if (!getResourceUrlBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resourceUrl_);
+ }
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_);
+ }
+ if (data_ != null) {
+ output.writeMessage(6, getData());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getVersionBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_);
+ }
+ if (!getDiscoveryDocumentUriBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, discoveryDocumentUri_);
+ }
+ if (!getDiscoveryNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, discoveryName_);
+ }
+ if (!getResourceUrlBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resourceUrl_);
+ }
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_);
+ }
+ if (data_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, getData());
+ }
+ 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.cloud.asset.v1beta1.Resource)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.Resource other = (com.google.cloud.asset.v1beta1.Resource) obj;
+
+ boolean result = true;
+ result = result && getVersion()
+ .equals(other.getVersion());
+ result = result && getDiscoveryDocumentUri()
+ .equals(other.getDiscoveryDocumentUri());
+ result = result && getDiscoveryName()
+ .equals(other.getDiscoveryName());
+ result = result && getResourceUrl()
+ .equals(other.getResourceUrl());
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && (hasData() == other.hasData());
+ if (hasData()) {
+ result = result && getData()
+ .equals(other.getData());
+ }
+ 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) + VERSION_FIELD_NUMBER;
+ hash = (53 * hash) + getVersion().hashCode();
+ hash = (37 * hash) + DISCOVERY_DOCUMENT_URI_FIELD_NUMBER;
+ hash = (53 * hash) + getDiscoveryDocumentUri().hashCode();
+ hash = (37 * hash) + DISCOVERY_NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getDiscoveryName().hashCode();
+ hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER;
+ hash = (53 * hash) + getResourceUrl().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ if (hasData()) {
+ hash = (37 * hash) + DATA_FIELD_NUMBER;
+ hash = (53 * hash) + getData().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.Resource parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.Resource parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.Resource parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.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 com.google.cloud.asset.v1beta1.Resource parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.Resource parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.Resource parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.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 com.google.cloud.asset.v1beta1.Resource parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.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 com.google.cloud.asset.v1beta1.Resource parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.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(com.google.cloud.asset.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;
+ }
+ /**
+ * + * Representation of a cloud resource. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.Resource} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public java.lang.String getVersion() {
+ java.lang.Object ref = version_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ version_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public com.google.protobuf.ByteString
+ getVersionBytes() {
+ java.lang.Object ref = version_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ version_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public Builder setVersion(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ version_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public Builder clearVersion() {
+
+ version_ = getDefaultInstance().getVersion();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ public Builder setVersionBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ version_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object discoveryDocumentUri_ = "";
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public java.lang.String getDiscoveryDocumentUri() {
+ java.lang.Object ref = discoveryDocumentUri_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ discoveryDocumentUri_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public com.google.protobuf.ByteString
+ getDiscoveryDocumentUriBytes() {
+ java.lang.Object ref = discoveryDocumentUri_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ discoveryDocumentUri_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public Builder setDiscoveryDocumentUri(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ discoveryDocumentUri_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public Builder clearDiscoveryDocumentUri() {
+
+ discoveryDocumentUri_ = getDefaultInstance().getDiscoveryDocumentUri();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ public Builder setDiscoveryDocumentUriBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ discoveryDocumentUri_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object discoveryName_ = "";
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public java.lang.String getDiscoveryName() {
+ java.lang.Object ref = discoveryName_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ discoveryName_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public com.google.protobuf.ByteString
+ getDiscoveryNameBytes() {
+ java.lang.Object ref = discoveryName_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ discoveryName_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public Builder setDiscoveryName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ discoveryName_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public Builder clearDiscoveryName() {
+
+ discoveryName_ = getDefaultInstance().getDiscoveryName();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ public Builder setDiscoveryNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ discoveryName_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object resourceUrl_ = "";
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ 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 REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ 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 REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ public Builder setResourceUrl(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ resourceUrl_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ public Builder clearResourceUrl() {
+
+ resourceUrl_ = getDefaultInstance().getResourceUrl();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ public Builder setResourceUrlBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ resourceUrl_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object parent_ = "";
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ 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 full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ 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 full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ 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.Struct data_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> dataBuilder_;
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public boolean hasData() {
+ return dataBuilder_ != null || data_ != null;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public com.google.protobuf.Struct getData() {
+ if (dataBuilder_ == null) {
+ return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_;
+ } else {
+ return dataBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public Builder setData(com.google.protobuf.Struct value) {
+ if (dataBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ data_ = value;
+ onChanged();
+ } else {
+ dataBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public Builder setData(
+ com.google.protobuf.Struct.Builder builderForValue) {
+ if (dataBuilder_ == null) {
+ data_ = builderForValue.build();
+ onChanged();
+ } else {
+ dataBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public Builder mergeData(com.google.protobuf.Struct value) {
+ if (dataBuilder_ == null) {
+ if (data_ != null) {
+ data_ =
+ com.google.protobuf.Struct.newBuilder(data_).mergeFrom(value).buildPartial();
+ } else {
+ data_ = value;
+ }
+ onChanged();
+ } else {
+ dataBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public Builder clearData() {
+ if (dataBuilder_ == null) {
+ data_ = null;
+ onChanged();
+ } else {
+ data_ = null;
+ dataBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public com.google.protobuf.Struct.Builder getDataBuilder() {
+
+ onChanged();
+ return getDataFieldBuilder().getBuilder();
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ public com.google.protobuf.StructOrBuilder getDataOrBuilder() {
+ if (dataBuilder_ != null) {
+ return dataBuilder_.getMessageOrBuilder();
+ } else {
+ return data_ == null ?
+ com.google.protobuf.Struct.getDefaultInstance() : data_;
+ }
+ }
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>
+ getDataFieldBuilder() {
+ if (dataBuilder_ == null) {
+ dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
+ getData(),
+ getParentForChildren(),
+ isClean());
+ data_ = null;
+ }
+ return dataBuilder_;
+ }
+ @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.cloud.asset.v1beta1.Resource)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.Resource)
+ private static final com.google.cloud.asset.v1beta1.Resource DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.Resource();
+ }
+
+ public static com.google.cloud.asset.v1beta1.Resource getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ java.lang.String getVersion();
+ /**
+ * + * The API version. Example: "v1". + *+ * + *
string version = 1;
+ */
+ com.google.protobuf.ByteString
+ getVersionBytes();
+
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ java.lang.String getDiscoveryDocumentUri();
+ /**
+ * + * The URL of the discovery document containing the resource's JSON schema. + * Example: + * "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest". + * It will be left unspecified for resources without a discovery-based API, + * such as Cloud Bigtable. + *+ * + *
string discovery_document_uri = 2;
+ */
+ com.google.protobuf.ByteString
+ getDiscoveryDocumentUriBytes();
+
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ java.lang.String getDiscoveryName();
+ /**
+ * + * The JSON schema name listed in the discovery document. + * Example: "Project". It will be left unspecified for resources (such as + * Cloud Bigtable) without a discovery-based API. + *+ * + *
string discovery_name = 3;
+ */
+ com.google.protobuf.ByteString
+ getDiscoveryNameBytes();
+
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ java.lang.String getResourceUrl();
+ /**
+ * + * The REST URL for accessing the resource. An HTTP GET operation using this + * URL returns the resource itself. + * Example: + * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + * It will be left unspecified for resources without a REST API. + *+ * + *
string resource_url = 4;
+ */
+ com.google.protobuf.ByteString
+ getResourceUrlBytes();
+
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ java.lang.String getParent();
+ /**
+ * + * The full name of the immediate parent of this resource. See: + * https://cloud.google.com/apis/design/resource_names#full_resource_name + * For GCP assets, it is the parent resource defined in the IAM policy + * hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy. + * Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123". + * For third-party assets, it is up to the users to define. + *+ * + *
string parent = 5;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ boolean hasData();
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ com.google.protobuf.Struct getData();
+ /**
+ * + * The content of the resource, in which some sensitive fields are scrubbed + * away and may not be present. + *+ * + *
.google.protobuf.Struct data = 6;
+ */
+ com.google.protobuf.StructOrBuilder getDataOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAsset.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAsset.java
new file mode 100644
index 000000000000..517dccf7aa28
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TemporalAsset.java
@@ -0,0 +1,957 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/assets.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * Temporal asset. In addition to the asset, the temporal asset includes the + * status of the asset and valid from and to time of it. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.TemporalAsset} + */ +public final class TemporalAsset extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.TemporalAsset) + TemporalAssetOrBuilder { +private static final long serialVersionUID = 0L; + // Use TemporalAsset.newBuilder() to construct. + private TemporalAsset(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private TemporalAsset() { + deleted_ = false; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TemporalAsset( + 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.cloud.asset.v1beta1.TimeWindow.Builder subBuilder = null; + if (window_ != null) { + subBuilder = window_.toBuilder(); + } + window_ = input.readMessage(com.google.cloud.asset.v1beta1.TimeWindow.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(window_); + window_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + deleted_ = input.readBool(); + break; + } + case 26: { + com.google.cloud.asset.v1beta1.Asset.Builder subBuilder = null; + if (asset_ != null) { + subBuilder = asset_.toBuilder(); + } + asset_ = input.readMessage(com.google.cloud.asset.v1beta1.Asset.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(asset_); + asset_ = 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.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_TemporalAsset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_TemporalAsset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.TemporalAsset.class, com.google.cloud.asset.v1beta1.TemporalAsset.Builder.class); + } + + public static final int WINDOW_FIELD_NUMBER = 1; + private com.google.cloud.asset.v1beta1.TimeWindow window_; + /** + *
+ * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public boolean hasWindow() {
+ return window_ != null;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow getWindow() {
+ return window_ == null ? com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : window_;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getWindowOrBuilder() {
+ return getWindow();
+ }
+
+ public static final int DELETED_FIELD_NUMBER = 2;
+ private boolean deleted_;
+ /**
+ * + * If the asset is deleted or not. + *+ * + *
bool deleted = 2;
+ */
+ public boolean getDeleted() {
+ return deleted_;
+ }
+
+ public static final int ASSET_FIELD_NUMBER = 3;
+ private com.google.cloud.asset.v1beta1.Asset asset_;
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public boolean hasAsset() {
+ return asset_ != null;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Asset getAsset() {
+ return asset_ == null ? com.google.cloud.asset.v1beta1.Asset.getDefaultInstance() : asset_;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public com.google.cloud.asset.v1beta1.AssetOrBuilder getAssetOrBuilder() {
+ return getAsset();
+ }
+
+ 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 (window_ != null) {
+ output.writeMessage(1, getWindow());
+ }
+ if (deleted_ != false) {
+ output.writeBool(2, deleted_);
+ }
+ if (asset_ != null) {
+ output.writeMessage(3, getAsset());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (window_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getWindow());
+ }
+ if (deleted_ != false) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBoolSize(2, deleted_);
+ }
+ if (asset_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getAsset());
+ }
+ 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.cloud.asset.v1beta1.TemporalAsset)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.TemporalAsset other = (com.google.cloud.asset.v1beta1.TemporalAsset) obj;
+
+ boolean result = true;
+ result = result && (hasWindow() == other.hasWindow());
+ if (hasWindow()) {
+ result = result && getWindow()
+ .equals(other.getWindow());
+ }
+ result = result && (getDeleted()
+ == other.getDeleted());
+ result = result && (hasAsset() == other.hasAsset());
+ if (hasAsset()) {
+ result = result && getAsset()
+ .equals(other.getAsset());
+ }
+ 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 (hasWindow()) {
+ hash = (37 * hash) + WINDOW_FIELD_NUMBER;
+ hash = (53 * hash) + getWindow().hashCode();
+ }
+ hash = (37 * hash) + DELETED_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
+ getDeleted());
+ if (hasAsset()) {
+ hash = (37 * hash) + ASSET_FIELD_NUMBER;
+ hash = (53 * hash) + getAsset().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.TemporalAsset parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset 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.cloud.asset.v1beta1.TemporalAsset parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset 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.cloud.asset.v1beta1.TemporalAsset parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset 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.cloud.asset.v1beta1.TemporalAsset parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TemporalAsset 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.cloud.asset.v1beta1.TemporalAsset 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;
+ }
+ /**
+ * + * Temporal asset. In addition to the asset, the temporal asset includes the + * status of the asset and valid from and to time of it. + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.TemporalAsset} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public boolean hasWindow() {
+ return windowBuilder_ != null || window_ != null;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow getWindow() {
+ if (windowBuilder_ == null) {
+ return window_ == null ? com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : window_;
+ } else {
+ return windowBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public Builder setWindow(com.google.cloud.asset.v1beta1.TimeWindow value) {
+ if (windowBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ window_ = value;
+ onChanged();
+ } else {
+ windowBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public Builder setWindow(
+ com.google.cloud.asset.v1beta1.TimeWindow.Builder builderForValue) {
+ if (windowBuilder_ == null) {
+ window_ = builderForValue.build();
+ onChanged();
+ } else {
+ windowBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public Builder mergeWindow(com.google.cloud.asset.v1beta1.TimeWindow value) {
+ if (windowBuilder_ == null) {
+ if (window_ != null) {
+ window_ =
+ com.google.cloud.asset.v1beta1.TimeWindow.newBuilder(window_).mergeFrom(value).buildPartial();
+ } else {
+ window_ = value;
+ }
+ onChanged();
+ } else {
+ windowBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public Builder clearWindow() {
+ if (windowBuilder_ == null) {
+ window_ = null;
+ onChanged();
+ } else {
+ window_ = null;
+ windowBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindow.Builder getWindowBuilder() {
+
+ onChanged();
+ return getWindowFieldBuilder().getBuilder();
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ public com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getWindowOrBuilder() {
+ if (windowBuilder_ != null) {
+ return windowBuilder_.getMessageOrBuilder();
+ } else {
+ return window_ == null ?
+ com.google.cloud.asset.v1beta1.TimeWindow.getDefaultInstance() : window_;
+ }
+ }
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.TimeWindow, com.google.cloud.asset.v1beta1.TimeWindow.Builder, com.google.cloud.asset.v1beta1.TimeWindowOrBuilder>
+ getWindowFieldBuilder() {
+ if (windowBuilder_ == null) {
+ windowBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.TimeWindow, com.google.cloud.asset.v1beta1.TimeWindow.Builder, com.google.cloud.asset.v1beta1.TimeWindowOrBuilder>(
+ getWindow(),
+ getParentForChildren(),
+ isClean());
+ window_ = null;
+ }
+ return windowBuilder_;
+ }
+
+ private boolean deleted_ ;
+ /**
+ * + * If the asset is deleted or not. + *+ * + *
bool deleted = 2;
+ */
+ public boolean getDeleted() {
+ return deleted_;
+ }
+ /**
+ * + * If the asset is deleted or not. + *+ * + *
bool deleted = 2;
+ */
+ public Builder setDeleted(boolean value) {
+
+ deleted_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * If the asset is deleted or not. + *+ * + *
bool deleted = 2;
+ */
+ public Builder clearDeleted() {
+
+ deleted_ = false;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.asset.v1beta1.Asset asset_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Asset, com.google.cloud.asset.v1beta1.Asset.Builder, com.google.cloud.asset.v1beta1.AssetOrBuilder> assetBuilder_;
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public boolean hasAsset() {
+ return assetBuilder_ != null || asset_ != null;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Asset getAsset() {
+ if (assetBuilder_ == null) {
+ return asset_ == null ? com.google.cloud.asset.v1beta1.Asset.getDefaultInstance() : asset_;
+ } else {
+ return assetBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public Builder setAsset(com.google.cloud.asset.v1beta1.Asset value) {
+ if (assetBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ asset_ = value;
+ onChanged();
+ } else {
+ assetBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public Builder setAsset(
+ com.google.cloud.asset.v1beta1.Asset.Builder builderForValue) {
+ if (assetBuilder_ == null) {
+ asset_ = builderForValue.build();
+ onChanged();
+ } else {
+ assetBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public Builder mergeAsset(com.google.cloud.asset.v1beta1.Asset value) {
+ if (assetBuilder_ == null) {
+ if (asset_ != null) {
+ asset_ =
+ com.google.cloud.asset.v1beta1.Asset.newBuilder(asset_).mergeFrom(value).buildPartial();
+ } else {
+ asset_ = value;
+ }
+ onChanged();
+ } else {
+ assetBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public Builder clearAsset() {
+ if (assetBuilder_ == null) {
+ asset_ = null;
+ onChanged();
+ } else {
+ asset_ = null;
+ assetBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public com.google.cloud.asset.v1beta1.Asset.Builder getAssetBuilder() {
+
+ onChanged();
+ return getAssetFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ public com.google.cloud.asset.v1beta1.AssetOrBuilder getAssetOrBuilder() {
+ if (assetBuilder_ != null) {
+ return assetBuilder_.getMessageOrBuilder();
+ } else {
+ return asset_ == null ?
+ com.google.cloud.asset.v1beta1.Asset.getDefaultInstance() : asset_;
+ }
+ }
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Asset, com.google.cloud.asset.v1beta1.Asset.Builder, com.google.cloud.asset.v1beta1.AssetOrBuilder>
+ getAssetFieldBuilder() {
+ if (assetBuilder_ == null) {
+ assetBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.asset.v1beta1.Asset, com.google.cloud.asset.v1beta1.Asset.Builder, com.google.cloud.asset.v1beta1.AssetOrBuilder>(
+ getAsset(),
+ getParentForChildren(),
+ isClean());
+ asset_ = null;
+ }
+ return assetBuilder_;
+ }
+ @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.cloud.asset.v1beta1.TemporalAsset)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.TemporalAsset)
+ private static final com.google.cloud.asset.v1beta1.TemporalAsset DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.TemporalAsset();
+ }
+
+ public static com.google.cloud.asset.v1beta1.TemporalAsset getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ boolean hasWindow();
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ com.google.cloud.asset.v1beta1.TimeWindow getWindow();
+ /**
+ * + * The time window when the asset data and state was observed. + *+ * + *
.google.cloud.asset.v1beta1.TimeWindow window = 1;
+ */
+ com.google.cloud.asset.v1beta1.TimeWindowOrBuilder getWindowOrBuilder();
+
+ /**
+ * + * If the asset is deleted or not. + *+ * + *
bool deleted = 2;
+ */
+ boolean getDeleted();
+
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ boolean hasAsset();
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ com.google.cloud.asset.v1beta1.Asset getAsset();
+ /**
+ * + * Asset. + *+ * + *
.google.cloud.asset.v1beta1.Asset asset = 3;
+ */
+ com.google.cloud.asset.v1beta1.AssetOrBuilder getAssetOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindow.java b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindow.java
new file mode 100644
index 000000000000..38afd096dc7b
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/java/com/google/cloud/asset/v1beta1/TimeWindow.java
@@ -0,0 +1,892 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/asset/v1beta1/assets.proto
+
+package com.google.cloud.asset.v1beta1;
+
+/**
+ * + * A time window of [start_time, end_time). + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.TimeWindow} + */ +public final class TimeWindow extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1beta1.TimeWindow) + TimeWindowOrBuilder { +private static final long serialVersionUID = 0L; + // Use TimeWindow.newBuilder() to construct. + private TimeWindow(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private TimeWindow() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TimeWindow( + 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.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 18: { + 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; + } + 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.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_TimeWindow_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1beta1.AssetProto.internal_static_google_cloud_asset_v1beta1_TimeWindow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1beta1.TimeWindow.class, com.google.cloud.asset.v1beta1.TimeWindow.Builder.class); + } + + public static final int START_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp startTime_; + /** + *
+ * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public boolean hasStartTime() {
+ return startTime_ != null;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public com.google.protobuf.Timestamp getStartTime() {
+ return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
+ return getStartTime();
+ }
+
+ public static final int END_TIME_FIELD_NUMBER = 2;
+ private com.google.protobuf.Timestamp endTime_;
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public boolean hasEndTime() {
+ return endTime_ != null;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public com.google.protobuf.Timestamp getEndTime() {
+ return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
+ return getEndTime();
+ }
+
+ 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 (startTime_ != null) {
+ output.writeMessage(1, getStartTime());
+ }
+ if (endTime_ != null) {
+ output.writeMessage(2, getEndTime());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (startTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(1, getStartTime());
+ }
+ if (endTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getEndTime());
+ }
+ 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.cloud.asset.v1beta1.TimeWindow)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.asset.v1beta1.TimeWindow other = (com.google.cloud.asset.v1beta1.TimeWindow) obj;
+
+ boolean result = true;
+ 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 && 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 (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 = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.asset.v1beta1.TimeWindow parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow 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.cloud.asset.v1beta1.TimeWindow parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow 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.cloud.asset.v1beta1.TimeWindow parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow 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.cloud.asset.v1beta1.TimeWindow parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.asset.v1beta1.TimeWindow 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.cloud.asset.v1beta1.TimeWindow 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 time window of [start_time, end_time). + *+ * + * Protobuf type {@code google.cloud.asset.v1beta1.TimeWindow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public boolean hasStartTime() {
+ return startTimeBuilder_ != null || startTime_ != null;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public com.google.protobuf.Timestamp getStartTime() {
+ if (startTimeBuilder_ == null) {
+ return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
+ } else {
+ return startTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ 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;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public Builder setStartTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (startTimeBuilder_ == null) {
+ startTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ startTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ 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;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public Builder clearStartTime() {
+ if (startTimeBuilder_ == null) {
+ startTime_ = null;
+ onChanged();
+ } else {
+ startTime_ = null;
+ startTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() {
+
+ onChanged();
+ return getStartTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() {
+ if (startTimeBuilder_ != null) {
+ return startTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return startTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : startTime_;
+ }
+ }
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ 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_;
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public boolean hasEndTime() {
+ return endTimeBuilder_ != null || endTime_ != null;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public com.google.protobuf.Timestamp getEndTime() {
+ if (endTimeBuilder_ == null) {
+ return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
+ } else {
+ return endTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ 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;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public Builder setEndTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (endTimeBuilder_ == null) {
+ endTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ endTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ 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;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public Builder clearEndTime() {
+ if (endTimeBuilder_ == null) {
+ endTime_ = null;
+ onChanged();
+ } else {
+ endTime_ = null;
+ endTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() {
+
+ onChanged();
+ return getEndTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() {
+ if (endTimeBuilder_ != null) {
+ return endTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return endTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : endTime_;
+ }
+ }
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ 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_;
+ }
+ @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.cloud.asset.v1beta1.TimeWindow)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.asset.v1beta1.TimeWindow)
+ private static final com.google.cloud.asset.v1beta1.TimeWindow DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.asset.v1beta1.TimeWindow();
+ }
+
+ public static com.google.cloud.asset.v1beta1.TimeWindow getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ boolean hasStartTime();
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ com.google.protobuf.Timestamp getStartTime();
+ /**
+ * + * Start time of the time window (inclusive). + *+ * + *
.google.protobuf.Timestamp start_time = 1;
+ */
+ com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder();
+
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ boolean hasEndTime();
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ com.google.protobuf.Timestamp getEndTime();
+ /**
+ * + * End time of the time window (exclusive). + * Current timestamp if not specified. + *+ * + *
.google.protobuf.Timestamp end_time = 2;
+ */
+ com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/asset_service.proto b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/asset_service.proto
new file mode 100644
index 000000000000..b64502f68e42
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/asset_service.proto
@@ -0,0 +1,163 @@
+// 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.cloud.asset.v1beta1;
+
+import "google/api/annotations.proto";
+import "google/cloud/asset/v1beta1/assets.proto";
+import "google/longrunning/operations.proto";
+import "google/protobuf/timestamp.proto";
+
+option csharp_namespace = "Google.Cloud.Asset.V1Beta1";
+option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset";
+option java_multiple_files = true;
+option java_outer_classname = "AssetServiceProto";
+option java_package = "com.google.cloud.asset.v1beta1";
+option php_namespace = "Google\\Cloud\\Asset\\V1beta1";
+
+
+// Asset service definition.
+service AssetService {
+ // Exports assets with time and resource types to a given Google Cloud Storage
+ // location. The output format is newline-delimited JSON.
+ // This API implements the [google.longrunning.Operation][google.longrunning.Operation] API allowing users
+ // to keep track of the export.
+ rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) {
+ option (google.api.http) = {
+ post: "/v1beta1/{parent=projects/*}:exportAssets"
+ body: "*"
+ additional_bindings {
+ post: "/v1beta1/{parent=organizations/*}:exportAssets"
+ body: "*"
+ }
+ };
+ }
+
+ // Batch gets assets update history that overlaps a time window.
+ // For RESOURCE content, this API outputs history with asset in both
+ // non-delete or deleted status.
+ // For IAM_POLICY content, this API only outputs history when asset and its
+ // attached IAM POLICY both exist. So there may be gaps in the output history.
+ rpc BatchGetAssetsHistory(BatchGetAssetsHistoryRequest) returns (BatchGetAssetsHistoryResponse) {
+ option (google.api.http) = {
+ get: "/v1beta1/{parent=projects/*}:batchGetAssetsHistory"
+ additional_bindings {
+ get: "/v1beta1/{parent=organizations/*}:batchGetAssetHistory"
+ }
+ };
+ }
+}
+
+// Export asset request.
+message ExportAssetsRequest {
+ // Required. The relative name of the root asset. Can only be an organization
+ // number (such as "organizations/123"), or a project id (such as
+ // "projects/my-project-id") or a project number (such as "projects/12345").
+ string parent = 1;
+
+ // Timestamp to take an asset snapshot. This can only be set to a timestamp in
+ // the past or of the current time. If not specified, the current time will be
+ // used. Due to delays in resource data collection and indexing, there is a
+ // volatile window during which running the same query may get different
+ // results.
+ google.protobuf.Timestamp read_time = 2;
+
+ // A list of asset types of which to take a snapshot for. Example:
+ // "google.compute.disk". If specified, only matching assets will be returned.
+ repeated string asset_types = 3;
+
+ // Asset content type. If not specified, no content but the asset name will be
+ // returned.
+ ContentType content_type = 4;
+
+ // Required. Output configuration indicating where the results will be output
+ // to. All results will be in newline delimited JSON format.
+ OutputConfig output_config = 5;
+}
+
+// The export asset response. This message is returned by the
+// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned
+// [google.longrunning.Operation.response][google.longrunning.Operation.response] field.
+message ExportAssetsResponse {
+ // Time the snapshot was taken.
+ google.protobuf.Timestamp read_time = 1;
+
+ // Output configuration indicating where the results were output to.
+ // All results are in JSON format.
+ OutputConfig output_config = 2;
+}
+
+// Batch get assets history request.
+message BatchGetAssetsHistoryRequest {
+ // Required. The relative name of the root asset. It can only be an
+ // organization number (such as "organizations/123"), or a project id (such as
+ // "projects/my-project-id")"or a project number (such as "projects/12345").
+ string parent = 1;
+
+ // A list of the full names of the assets. See:
+ // https://cloud.google.com/apis/design/resource_names#full_resource_name
+ // Example:
+ // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1".
+ //
+ // The request becomes a no-op if the asset name list is empty, and the max
+ // size of the asset name list is 100 in one request.
+ repeated string asset_names = 2;
+
+ // Required. The content type.
+ ContentType content_type = 3;
+
+ // Required. The time window for the asset history. The start time is
+ // required. The returned results contain all temporal assets whose time
+ // window overlap with read_time_window.
+ TimeWindow read_time_window = 4;
+}
+
+// Batch get assets history response.
+message BatchGetAssetsHistoryResponse {
+ // A list of assets with valid time windows.
+ repeated TemporalAsset assets = 1;
+}
+
+// Output configuration for export assets destination.
+message OutputConfig {
+ // Asset export destination.
+ oneof destination {
+ // Destination on Google Cloud Storage (GCS).
+ GcsDestination gcs_destination = 1;
+ }
+}
+
+// A Google Cloud Storage (GCS) location.
+message GcsDestination {
+ // The path of the GCS objects. It's the same path that is used by gsutil, for
+ // example: "gs://bucket_name/object_path". See:
+ // https://cloud.google.com/storage/docs/viewing-editing-metadata for more
+ // information.
+ string uri = 1;
+}
+
+// Asset content type.
+enum ContentType {
+ // Unspecified content type.
+ CONTENT_TYPE_UNSPECIFIED = 0;
+
+ // Resource metadata.
+ RESOURCE = 1;
+
+ // The actual IAM policy set on a resource.
+ IAM_POLICY = 2;
+}
diff --git a/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/assets.proto b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/assets.proto
new file mode 100644
index 000000000000..db270b0879fa
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-cloudasset-v1beta1/src/main/proto/google/cloud/asset/v1beta1/assets.proto
@@ -0,0 +1,114 @@
+// 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.cloud.asset.v1beta1;
+
+import "google/api/annotations.proto";
+import "google/iam/v1/policy.proto";
+import "google/protobuf/any.proto";
+import "google/protobuf/struct.proto";
+import "google/protobuf/timestamp.proto";
+
+option csharp_namespace = "Google.Cloud.Asset.V1Beta1";
+option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1beta1;asset";
+option java_multiple_files = true;
+option java_outer_classname = "AssetProto";
+option java_package = "com.google.cloud.asset.v1beta1";
+option php_namespace = "Google\\Cloud\\Asset\\V1beta1";
+
+
+// Temporal asset. In addition to the asset, the temporal asset includes the
+// status of the asset and valid from and to time of it.
+message TemporalAsset {
+ // The time window when the asset data and state was observed.
+ TimeWindow window = 1;
+
+ // If the asset is deleted or not.
+ bool deleted = 2;
+
+ // Asset.
+ Asset asset = 3;
+}
+
+// A time window of [start_time, end_time).
+message TimeWindow {
+ // Start time of the time window (inclusive).
+ google.protobuf.Timestamp start_time = 1;
+
+ // End time of the time window (exclusive).
+ // Current timestamp if not specified.
+ google.protobuf.Timestamp end_time = 2;
+}
+
+// Cloud asset. This include all Google Cloud Platform resources, as well as
+// IAM policies and other non-GCP assets.
+message Asset {
+ // The full name of the asset. See:
+ // https://cloud.google.com/apis/design/resource_names#full_resource_name
+ // Example:
+ // "//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1".
+ string name = 1;
+
+ // Type of the asset. Example: "google.compute.disk".
+ string asset_type = 2;
+
+ // Representation of the resource.
+ Resource resource = 3;
+
+ // Representation of the actual IAM policy set on a cloud resource. For each
+ // resource, there must be at most one IAM policy set on it.
+ google.iam.v1.Policy iam_policy = 4;
+}
+
+// Representation of a cloud resource.
+message Resource {
+ // The API version. Example: "v1".
+ string version = 1;
+
+ // The URL of the discovery document containing the resource's JSON schema.
+ // Example:
+ // "https://www.googleapis.com/discovery/v1/apis/compute/v1/rest".
+ // It will be left unspecified for resources without a discovery-based API,
+ // such as Cloud Bigtable.
+ string discovery_document_uri = 2;
+
+ // The JSON schema name listed in the discovery document.
+ // Example: "Project". It will be left unspecified for resources (such as
+ // Cloud Bigtable) without a discovery-based API.
+ string discovery_name = 3;
+
+ // The REST URL for accessing the resource. An HTTP GET operation using this
+ // URL returns the resource itself.
+ // Example:
+ // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+ // It will be left unspecified for resources without a REST API.
+ string resource_url = 4;
+
+ // The full name of the immediate parent of this resource. See:
+ // https://cloud.google.com/apis/design/resource_names#full_resource_name
+ //
+ // For GCP assets, it is the parent resource defined in the IAM policy
+ // hierarchy: https://cloud.google.com/iam/docs/overview#policy_hierarchy.
+ // Example: "//cloudresourcemanager.googleapis.com/projects/my_project_123".
+ //
+ // For third-party assets, it is up to the users to define.
+ string parent = 5;
+
+ // The content of the resource, in which some sensitive fields are scrubbed
+ // away and may not be present.
+ google.protobuf.Struct data = 6;
+}
diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java
index c619ee9cdbf3..3740e5df6c2e 100644
--- a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java
+++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadata.java
@@ -334,7 +334,7 @@ public java.lang.String getStatusDetail() {
private boolean cancelRequested_;
/**
* - * Specifies if cancellation was requested for the operaiton. + * Specifies if cancellation was requested for the operation. ** *
bool cancel_requested = 6;
@@ -1397,7 +1397,7 @@ public Builder setStatusDetailBytes(
private boolean cancelRequested_ ;
/**
* - * Specifies if cancellation was requested for the operaiton. + * Specifies if cancellation was requested for the operation. ** *
bool cancel_requested = 6;
@@ -1407,7 +1407,7 @@ public boolean getCancelRequested() {
}
/**
* - * Specifies if cancellation was requested for the operaiton. + * Specifies if cancellation was requested for the operation. ** *
bool cancel_requested = 6;
@@ -1420,7 +1420,7 @@ public Builder setCancelRequested(boolean value) {
}
/**
* - * Specifies if cancellation was requested for the operaiton. + * Specifies if cancellation was requested for the operation. ** *
bool cancel_requested = 6;
diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java
index 232e762aea2b..e849fdf497bc 100644
--- a/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/java/com/google/cloud/redis/v1/OperationMetadataOrBuilder.java
@@ -113,7 +113,7 @@ public interface OperationMetadataOrBuilder extends
/**
* - * Specifies if cancellation was requested for the operaiton. + * Specifies if cancellation was requested for the operation. ** *
bool cancel_requested = 6;
diff --git a/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto b/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto
index bf2cc0fe6b04..08cdf270cdf7 100644
--- a/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto
+++ b/google-api-grpc/proto-google-cloud-redis-v1/src/main/proto/google/cloud/redis/v1/cloud_redis.proto
@@ -342,7 +342,7 @@ message OperationMetadata {
// Operation status details.
string status_detail = 5;
- // Specifies if cancellation was requested for the operaiton.
+ // Specifies if cancellation was requested for the operation.
bool cancel_requested = 6;
// API version.
diff --git a/google-api-grpc/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto b/google-api-grpc/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
index 89f7343c814b..56dbff19e17b 100644
--- a/google-api-grpc/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.proto
+++ b/google-api-grpc/proto-google-cloud-spanner-admin-database-v1/src/main/proto/google/spanner/admin/database/v1/spanner_database_admin.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.
diff --git a/google-api-grpc/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto b/google-api-grpc/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto
index 23d315bc1746..e960e5428e3a 100644
--- a/google-api-grpc/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.proto
+++ b/google-api-grpc/proto-google-cloud-spanner-admin-instance-v1/src/main/proto/google/spanner/admin/instance/v1/spanner_instance_admin.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.
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
index cde1cf05aae8..3acf5bc0f359 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequest.java
@@ -26,6 +26,7 @@ private ExecuteSqlRequest() {
resumeToken_ = com.google.protobuf.ByteString.EMPTY;
queryMode_ = 0;
partitionToken_ = com.google.protobuf.ByteString.EMPTY;
+ seqno_ = 0L;
}
@java.lang.Override
@@ -119,6 +120,11 @@ private ExecuteSqlRequest(
partitionToken_ = input.readBytes();
break;
}
+ case 72: {
+
+ seqno_ = input.readInt64();
+ break;
+ }
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
@@ -165,7 +171,7 @@ protected com.google.protobuf.MapField internalGetMapField(
/**
* - * Mode in which the query must be processed. + * Mode in which the statement must be processed. ** * Protobuf enum {@code google.spanner.v1.ExecuteSqlRequest.QueryMode} @@ -174,8 +180,7 @@ public enum QueryMode implements com.google.protobuf.ProtocolMessageEnum { /** *
- * The default mode where only the query result, without any information - * about the query plan is returned. + * The default mode. Only the statement results are returned. ** *
NORMAL = 0;
@@ -183,7 +188,7 @@ public enum QueryMode
NORMAL(0),
/**
* - * This mode returns only the query plan, without any result rows or + * This mode returns only the query plan, without any results or * execution statistics information. ** @@ -193,7 +198,7 @@ public enum QueryMode /** *
* This mode returns both the query plan and the execution statistics along - * with the result rows. + * with the results. ** *
PROFILE = 2;
@@ -204,8 +209,7 @@ public enum QueryMode
/**
* - * The default mode where only the query result, without any information - * about the query plan is returned. + * The default mode. Only the statement results are returned. ** *
NORMAL = 0;
@@ -213,7 +217,7 @@ public enum QueryMode
public static final int NORMAL_VALUE = 0;
/**
* - * This mode returns only the query plan, without any result rows or + * This mode returns only the query plan, without any results or * execution statistics information. ** @@ -223,7 +227,7 @@ public enum QueryMode /** *
* This mode returns both the query plan and the execution statistics along - * with the result rows. + * with the results. ** *
PROFILE = 2;
@@ -353,6 +357,13 @@ public java.lang.String getSession() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -364,6 +375,13 @@ public boolean hasTransaction() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -375,6 +393,13 @@ public com.google.spanner.v1.TransactionSelector getTransaction() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -387,7 +412,7 @@ public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilde
private volatile java.lang.Object sql_;
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -406,7 +431,7 @@ public java.lang.String getSql() {
}
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -429,14 +454,14 @@ public java.lang.String getSql() {
private com.google.protobuf.Struct params_;
/**
* - * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -449,14 +474,14 @@ public boolean hasParams() { } /** *@@ -585,7 +610,7 @@ public com.google.spanner.v1.Type getParamTypesOrDefault( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. * @@ -608,10 +633,10 @@ public com.google.spanner.v1.Type getParamTypesOrThrow( private com.google.protobuf.ByteString resumeToken_; /** *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -469,14 +494,14 @@ public com.google.protobuf.Struct getParams() { } /** *@@ -563,7 +588,7 @@ public java.util.Map- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -520,7 +545,7 @@ public int getParamTypesCount() { * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *@@ -546,7 +571,7 @@ public java.util.MapgetParamTypes * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. * getParamTypes * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *
- * If this request is resuming a previously interrupted SQL query + * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL query execution to resume where the last one left + * enables the new SQL statement execution to resume where the last one left * off. The rest of the request parameters must exactly match the * request that yielded this token. *@@ -667,6 +692,26 @@ public com.google.protobuf.ByteString getPartitionToken() { return partitionToken_; } + public static final int SEQNO_FIELD_NUMBER = 9; + private long seqno_; + /** + *
+ * A per-transaction sequence number used to identify this request. This + * makes each request idempotent such that if the request is received multiple + * times, at most one will succeed. + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction may be aborted. Replays of previously + * handled requests will yield the same response as the first execution. + * Required for DML statements. Ignored for queries. + *+ * + *
int64 seqno = 9;
+ */
+ public long getSeqno() {
+ return seqno_;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -708,6 +753,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (!partitionToken_.isEmpty()) {
output.writeBytes(8, partitionToken_);
}
+ if (seqno_ != 0L) {
+ output.writeInt64(9, seqno_);
+ }
unknownFields.writeTo(output);
}
@@ -753,6 +801,10 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(8, partitionToken_);
}
+ if (seqno_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(9, seqno_);
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -790,6 +842,8 @@ public boolean equals(final java.lang.Object obj) {
result = result && queryMode_ == other.queryMode_;
result = result && getPartitionToken()
.equals(other.getPartitionToken());
+ result = result && (getSeqno()
+ == other.getSeqno());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@@ -823,6 +877,9 @@ public int hashCode() {
hash = (53 * hash) + queryMode_;
hash = (37 * hash) + PARTITION_TOKEN_FIELD_NUMBER;
hash = (53 * hash) + getPartitionToken().hashCode();
+ hash = (37 * hash) + SEQNO_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getSeqno());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -1006,6 +1063,8 @@ public Builder clear() {
partitionToken_ = com.google.protobuf.ByteString.EMPTY;
+ seqno_ = 0L;
+
return this;
}
@@ -1051,6 +1110,7 @@ public com.google.spanner.v1.ExecuteSqlRequest buildPartial() {
result.resumeToken_ = resumeToken_;
result.queryMode_ = queryMode_;
result.partitionToken_ = partitionToken_;
+ result.seqno_ = seqno_;
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
@@ -1125,6 +1185,9 @@ public Builder mergeFrom(com.google.spanner.v1.ExecuteSqlRequest other) {
if (other.getPartitionToken() != com.google.protobuf.ByteString.EMPTY) {
setPartitionToken(other.getPartitionToken());
}
+ if (other.getSeqno() != 0L) {
+ setSeqno(other.getSeqno());
+ }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -1251,6 +1314,13 @@ public Builder setSessionBytes(
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1262,6 +1332,13 @@ public boolean hasTransaction() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1277,6 +1354,13 @@ public com.google.spanner.v1.TransactionSelector getTransaction() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1298,6 +1382,13 @@ public Builder setTransaction(com.google.spanner.v1.TransactionSelector value) {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1317,6 +1408,13 @@ public Builder setTransaction(
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1340,6 +1438,13 @@ public Builder mergeTransaction(com.google.spanner.v1.TransactionSelector value)
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1359,6 +1464,13 @@ public Builder clearTransaction() {
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1372,6 +1484,13 @@ public com.google.spanner.v1.TransactionSelector.Builder getTransactionBuilder()
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1388,6 +1507,13 @@ public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilde
* * The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *
.google.spanner.v1.TransactionSelector transaction = 2;
@@ -1409,7 +1535,7 @@ public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilde
private java.lang.Object sql_ = "";
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -1428,7 +1554,7 @@ public java.lang.String getSql() {
}
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -1448,7 +1574,7 @@ public java.lang.String getSql() {
}
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -1465,7 +1591,7 @@ public Builder setSql(
}
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -1478,7 +1604,7 @@ public Builder clearSql() {
}
/**
* - * Required. The SQL query string. + * Required. The SQL string. ** *
string sql = 3;
@@ -1500,14 +1626,14 @@ public Builder setSqlBytes(
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> paramsBuilder_;
/**
* - * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1520,14 +1646,14 @@ public boolean hasParams() { } /** *@@ -212,10 +233,10 @@ com.google.spanner.v1.Type getParamTypesOrThrow( /** *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1544,14 +1670,14 @@ public com.google.protobuf.Struct getParams() { } /** *@@ -199,7 +220,7 @@ com.google.spanner.v1.Type getParamTypesOrDefault( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1574,14 +1700,14 @@ public Builder setParams(com.google.protobuf.Struct value) { } /** *@@ -1934,10 +2060,10 @@ public Builder putAllParamTypes( private com.google.protobuf.ByteString resumeToken_ = com.google.protobuf.ByteString.EMPTY; /** *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1602,14 +1728,14 @@ public Builder setParams( } /** *@@ -1916,7 +2042,7 @@ public Builder putParamTypes( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1634,14 +1760,14 @@ public Builder mergeParams(com.google.protobuf.Struct value) { } /** *@@ -1894,7 +2020,7 @@ public Builder removeParamTypes( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1662,14 +1788,14 @@ public Builder clearParams() { } /** *@@ -1865,7 +1991,7 @@ public Builder clearParamTypes() { * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1684,14 +1810,14 @@ public com.google.protobuf.Struct.Builder getParamsBuilder() { } /** *@@ -1835,7 +1961,7 @@ public com.google.spanner.v1.Type getParamTypesOrDefault( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1709,14 +1835,14 @@ public com.google.protobuf.StructOrBuilder getParamsOrBuilder() { } /** *@@ -1813,7 +1939,7 @@ public java.util.Map- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -1770,7 +1896,7 @@ public int getParamTypesCount() { * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *@@ -1796,7 +1922,7 @@ public java.util.MapgetParamTypes * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. * getParamTypes * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. * - * If this request is resuming a previously interrupted SQL query + * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL query execution to resume where the last one left + * enables the new SQL statement execution to resume where the last one left * off. The rest of the request parameters must exactly match the * request that yielded this token. *@@ -1949,10 +2075,10 @@ public com.google.protobuf.ByteString getResumeToken() { } /** *- * If this request is resuming a previously interrupted SQL query + * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL query execution to resume where the last one left + * enables the new SQL statement execution to resume where the last one left * off. The rest of the request parameters must exactly match the * request that yielded this token. *@@ -1970,10 +2096,10 @@ public Builder setResumeToken(com.google.protobuf.ByteString value) { } /** *- * If this request is resuming a previously interrupted SQL query + * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL query execution to resume where the last one left + * enables the new SQL statement execution to resume where the last one left * off. The rest of the request parameters must exactly match the * request that yielded this token. *@@ -2111,6 +2237,65 @@ public Builder clearPartitionToken() { onChanged(); return this; } + + private long seqno_ ; + /** + *+ * A per-transaction sequence number used to identify this request. This + * makes each request idempotent such that if the request is received multiple + * times, at most one will succeed. + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction may be aborted. Replays of previously + * handled requests will yield the same response as the first execution. + * Required for DML statements. Ignored for queries. + *+ * + *int64 seqno = 9;
+ */ + public long getSeqno() { + return seqno_; + } + /** + *+ * A per-transaction sequence number used to identify this request. This + * makes each request idempotent such that if the request is received multiple + * times, at most one will succeed. + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction may be aborted. Replays of previously + * handled requests will yield the same response as the first execution. + * Required for DML statements. Ignored for queries. + *+ * + *int64 seqno = 9;
+ */ + public Builder setSeqno(long value) { + + seqno_ = value; + onChanged(); + return this; + } + /** + *+ * A per-transaction sequence number used to identify this request. This + * makes each request idempotent such that if the request is received multiple + * times, at most one will succeed. + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction may be aborted. Replays of previously + * handled requests will yield the same response as the first execution. + * Required for DML statements. Ignored for queries. + *+ * + *int64 seqno = 9;
+ */ + public Builder clearSeqno() { + + seqno_ = 0L; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java index 4be99d56d8db..09d723b5172e 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ExecuteSqlRequestOrBuilder.java @@ -29,6 +29,13 @@ public interface ExecuteSqlRequestOrBuilder extends ** The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *.google.spanner.v1.TransactionSelector transaction = 2;
@@ -38,6 +45,13 @@ public interface ExecuteSqlRequestOrBuilder extends ** The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *.google.spanner.v1.TransactionSelector transaction = 2;
@@ -47,6 +61,13 @@ public interface ExecuteSqlRequestOrBuilder extends ** The transaction to use. If none is provided, the default is a * temporary read-only transaction with strong concurrency. + * The transaction to use. + * For queries, if none is provided, the default is a temporary read-only + * transaction with strong concurrency. + * Standard DML statements require a ReadWrite transaction. Single-use + * transactions are not supported (to avoid replay). The caller must + * either supply an existing transaction ID or begin a new transaction. + * Partitioned DML requires an existing PartitionedDml transaction ID. ** *.google.spanner.v1.TransactionSelector transaction = 2;
@@ -55,7 +76,7 @@ public interface ExecuteSqlRequestOrBuilder extends /** *- * Required. The SQL query string. + * Required. The SQL string. ** *string sql = 3;
@@ -63,7 +84,7 @@ public interface ExecuteSqlRequestOrBuilder extends java.lang.String getSql(); /** *- * Required. The SQL query string. + * Required. The SQL string. ** *string sql = 3;
@@ -73,14 +94,14 @@ public interface ExecuteSqlRequestOrBuilder extends /** *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -91,14 +112,14 @@ public interface ExecuteSqlRequestOrBuilder extends boolean hasParams(); /** *@@ -182,7 +203,7 @@ boolean containsParamTypes( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -109,14 +130,14 @@ public interface ExecuteSqlRequestOrBuilder extends com.google.protobuf.Struct getParams(); /** *@@ -167,7 +188,7 @@ boolean containsParamTypes( * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *- * The SQL query string can contain parameter placeholders. A parameter + * The SQL string can contain parameter placeholders. A parameter * placeholder consists of `'@'` followed by the parameter * name. Parameter names consist of any combination of letters, * numbers, and underscores. * Parameters can appear anywhere that a literal value is expected. The same * parameter name can be used more than once, for example: * `"WHERE id > @msg_id AND id < @msg_id + 100"` - * It is an error to execute an SQL query with unbound parameters. + * It is an error to execute an SQL statement with unbound parameters. * Parameter values are specified using `params`, which is a JSON * object whose keys are parameter names, and whose values are the * corresponding parameter values. @@ -132,7 +153,7 @@ public interface ExecuteSqlRequestOrBuilder extends * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *@@ -146,7 +167,7 @@ public interface ExecuteSqlRequestOrBuilder extends * from a JSON value. For example, values of type `BYTES` and values * of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. * In these cases, `param_types` can be used to specify the exact - * SQL type for some or all of the SQL query parameters. See the + * SQL type for some or all of the SQL statement parameters. See the * definition of [Type][google.spanner.v1.Type] for more information * about SQL types. *
- * If this request is resuming a previously interrupted SQL query + * If this request is resuming a previously interrupted SQL statement * execution, `resume_token` should be copied from the last * [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - * enables the new SQL query execution to resume where the last one left + * enables the new SQL statement execution to resume where the last one left * off. The rest of the request parameters must exactly match the * request that yielded this token. *@@ -256,4 +277,20 @@ com.google.spanner.v1.Type getParamTypesOrThrow( *
bytes partition_token = 8;
*/
com.google.protobuf.ByteString getPartitionToken();
+
+ /**
+ * + * A per-transaction sequence number used to identify this request. This + * makes each request idempotent such that if the request is received multiple + * times, at most one will succeed. + * The sequence number must be monotonically increasing within the + * transaction. If a request arrives for the first time with an out-of-order + * sequence number, the transaction may be aborted. Replays of previously + * handled requests will yield the same response as the first execution. + * Required for DML statements. Ignored for queries. + *+ * + *
int64 seqno = 9;
+ */
+ long getSeqno();
}
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java
index e83a63b201e1..0fc603c1063f 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSet.java
@@ -549,10 +549,12 @@ public com.google.protobuf.ByteString getResumeToken() {
private com.google.spanner.v1.ResultSetStats stats_;
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -562,10 +564,12 @@ public boolean hasStats() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -575,10 +579,12 @@ public com.google.spanner.v1.ResultSetStats getStats() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2653,10 +2659,12 @@ public Builder clearResumeToken() {
com.google.spanner.v1.ResultSetStats, com.google.spanner.v1.ResultSetStats.Builder, com.google.spanner.v1.ResultSetStatsOrBuilder> statsBuilder_;
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2666,10 +2674,12 @@ public boolean hasStats() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2683,10 +2693,12 @@ public com.google.spanner.v1.ResultSetStats getStats() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2706,10 +2718,12 @@ public Builder setStats(com.google.spanner.v1.ResultSetStats value) {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2727,10 +2741,12 @@ public Builder setStats(
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2752,10 +2768,12 @@ public Builder mergeStats(com.google.spanner.v1.ResultSetStats value) {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2773,10 +2791,12 @@ public Builder clearStats() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2788,10 +2808,12 @@ public com.google.spanner.v1.ResultSetStats.Builder getStatsBuilder() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -2806,10 +2828,12 @@ public com.google.spanner.v1.ResultSetStatsOrBuilder getStatsOrBuilder() {
}
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java
index 2e8d97296e6b..69b0b8c03bdb 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartialResultSetOrBuilder.java
@@ -395,10 +395,12 @@ com.google.protobuf.ValueOrBuilder getValuesOrBuilder(
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -406,10 +408,12 @@ com.google.protobuf.ValueOrBuilder getValuesOrBuilder(
boolean hasStats();
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
@@ -417,10 +421,12 @@ com.google.protobuf.ValueOrBuilder getValuesOrBuilder(
com.google.spanner.v1.ResultSetStats getStats();
/**
* - * Query plan and execution statistics for the query that produced this + * Query plan and execution statistics for the statement that produced this * streaming result set. These can be requested by setting * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent * only once with the last response in the stream. + * This field will also be present in the last response for DML + * statements. ** *
.google.spanner.v1.ResultSetStats stats = 5;
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequest.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequest.java
index 5f604fe8d20e..aea633f0e263 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequest.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequest.java
@@ -245,6 +245,9 @@ public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilde
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -269,6 +272,9 @@ public java.lang.String getSql() {
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -1226,6 +1232,9 @@ public com.google.spanner.v1.TransactionSelectorOrBuilder getTransactionOrBuilde
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -1250,6 +1259,9 @@ public java.lang.String getSql() {
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -1275,6 +1287,9 @@ public java.lang.String getSql() {
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -1297,6 +1312,9 @@ public Builder setSql(
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -1315,6 +1333,9 @@ public Builder clearSql() {
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequestOrBuilder.java
index 98ea4df69a28..d9a2697b2541 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequestOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/PartitionQueryRequestOrBuilder.java
@@ -61,6 +61,9 @@ public interface PartitionQueryRequestOrBuilder extends
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
@@ -74,6 +77,9 @@ public interface PartitionQueryRequestOrBuilder extends
* union operator conceptually divides one or more tables into multiple
* splits, remotely evaluates a subquery independently on each split, and
* then unions all results.
+ * This must not contain DML commands, such as INSERT, UPDATE, or
+ * DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a
+ * PartitionedDml transaction for large, partition-friendly DML operations.
*
*
* string sql = 3;
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSet.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSet.java
index 72bcc7826be7..667e31de62db 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSet.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSet.java
@@ -236,8 +236,13 @@ public com.google.protobuf.ListValueOrBuilder getRowsOrBuilder(
private com.google.spanner.v1.ResultSetStats stats_;
/**
* - * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -248,8 +253,13 @@ public boolean hasStats() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -260,8 +270,13 @@ public com.google.spanner.v1.ResultSetStats getStats() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1241,8 +1256,13 @@ public com.google.protobuf.ListValue.Builder addRowsBuilder( com.google.spanner.v1.ResultSetStats, com.google.spanner.v1.ResultSetStats.Builder, com.google.spanner.v1.ResultSetStatsOrBuilder> statsBuilder_; /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1253,8 +1273,13 @@ public boolean hasStats() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1269,8 +1294,13 @@ public com.google.spanner.v1.ResultSetStats getStats() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1291,8 +1321,13 @@ public Builder setStats(com.google.spanner.v1.ResultSetStats value) { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1311,8 +1346,13 @@ public Builder setStats( } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1335,8 +1375,13 @@ public Builder mergeStats(com.google.spanner.v1.ResultSetStats value) { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1355,8 +1400,13 @@ public Builder clearStats() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1369,8 +1419,13 @@ public com.google.spanner.v1.ResultSetStats.Builder getStatsBuilder() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -1386,8 +1441,13 @@ public com.google.spanner.v1.ResultSetStatsOrBuilder getStatsOrBuilder() { } /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetOrBuilder.java index 4a54ea19a36f..30e00ef6820a 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetOrBuilder.java +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetOrBuilder.java @@ -103,8 +103,13 @@ com.google.protobuf.ListValueOrBuilder getRowsOrBuilder( /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -113,8 +118,13 @@ com.google.protobuf.ListValueOrBuilder getRowsOrBuilder( boolean hasStats(); /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** @@ -123,8 +133,13 @@ com.google.protobuf.ListValueOrBuilder getRowsOrBuilder( com.google.spanner.v1.ResultSetStats getStats(); /** *
- * Query plan and execution statistics for the query that produced this - * result set. These can be requested by setting + * Query plan and execution statistics for the SQL statement that + * produced this result set. These can be requested by setting + * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * DML statements always produce stats containing the number of rows + * modified, unless executed using the + * [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + * Other fields may or may not be populated, based on the * [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ** diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java index 03323009f4bc..db5ab855f5d7 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetProto.java @@ -60,14 +60,16 @@ public static void registerAllExtensions( "google.spanner.v1.ResultSetStats\"y\n\021Resu" + "ltSetMetadata\022/\n\010row_type\030\001 \001(\0132\035.google" + ".spanner.v1.StructType\0223\n\013transaction\030\002 " + - "\001(\0132\036.google.spanner.v1.Transaction\"p\n\016R" + - "esultSetStats\0220\n\nquery_plan\030\001 \001(\0132\034.goog" + - "le.spanner.v1.QueryPlan\022,\n\013query_stats\030\002" + - " \001(\0132\027.google.protobuf.StructB\232\001\n\025com.go" + - "ogle.spanner.v1B\016ResultSetProtoP\001Z8googl" + - "e.golang.org/genproto/googleapis/spanner" + - "/v1;spanner\370\001\001\252\002\027Google.Cloud.Spanner.V1" + - "\312\002\027Google\\Cloud\\Spanner\\V1b\006proto3" + "\001(\0132\036.google.spanner.v1.Transaction\"\271\001\n\016" + + "ResultSetStats\0220\n\nquery_plan\030\001 \001(\0132\034.goo" + + "gle.spanner.v1.QueryPlan\022,\n\013query_stats\030" + + "\002 \001(\0132\027.google.protobuf.Struct\022\031\n\017row_co" + + "unt_exact\030\003 \001(\003H\000\022\037\n\025row_count_lower_bou" + + "nd\030\004 \001(\003H\000B\013\n\trow_countB\232\001\n\025com.google.s" + + "panner.v1B\016ResultSetProtoP\001Z8google.gola" + + "ng.org/genproto/googleapis/spanner/v1;sp" + + "anner\370\001\001\252\002\027Google.Cloud.Spanner.V1\312\002\027Goo" + + "gle\\Cloud\\Spanner\\V1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -109,7 +111,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_spanner_v1_ResultSetStats_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_ResultSetStats_descriptor, - new java.lang.String[] { "QueryPlan", "QueryStats", }); + new java.lang.String[] { "QueryPlan", "QueryStats", "RowCountExact", "RowCountLowerBound", "RowCount", }); com.google.api.AnnotationsProto.getDescriptor(); com.google.protobuf.StructProto.getDescriptor(); com.google.spanner.v1.QueryPlanProto.getDescriptor(); diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStats.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStats.java index c4f2438a32a3..67d309332cc1 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStats.java +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStats.java @@ -72,6 +72,16 @@ private ResultSetStats( break; } + case 24: { + rowCountCase_ = 3; + rowCount_ = input.readInt64(); + break; + } + case 32: { + rowCountCase_ = 4; + rowCount_ = input.readInt64(); + break; + } default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { @@ -104,6 +114,44 @@ private ResultSetStats( com.google.spanner.v1.ResultSetStats.class, com.google.spanner.v1.ResultSetStats.Builder.class); } + private int rowCountCase_ = 0; + private java.lang.Object rowCount_; + public enum RowCountCase + implements com.google.protobuf.Internal.EnumLite { + ROW_COUNT_EXACT(3), + ROW_COUNT_LOWER_BOUND(4), + ROWCOUNT_NOT_SET(0); + private final int value; + private RowCountCase(int value) { + this.value = value; + } + /** + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RowCountCase valueOf(int value) { + return forNumber(value); + } + + public static RowCountCase forNumber(int value) { + switch (value) { + case 3: return ROW_COUNT_EXACT; + case 4: return ROW_COUNT_LOWER_BOUND; + case 0: return ROWCOUNT_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public RowCountCase + getRowCountCase() { + return RowCountCase.forNumber( + rowCountCase_); + } + public static final int QUERY_PLAN_FIELD_NUMBER = 1; private com.google.spanner.v1.QueryPlan queryPlan_; /** @@ -191,6 +239,37 @@ public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() { return getQueryStats(); } + public static final int ROW_COUNT_EXACT_FIELD_NUMBER = 3; + /** + *
+ * Standard DML returns an exact count of rows that were modified. + *+ * + *
int64 row_count_exact = 3;
+ */
+ public long getRowCountExact() {
+ if (rowCountCase_ == 3) {
+ return (java.lang.Long) rowCount_;
+ }
+ return 0L;
+ }
+
+ public static final int ROW_COUNT_LOWER_BOUND_FIELD_NUMBER = 4;
+ /**
+ * + * Partitioned DML does not offer exactly-once semantics, so it + * returns a lower bound of the rows modified. + *+ * + *
int64 row_count_lower_bound = 4;
+ */
+ public long getRowCountLowerBound() {
+ if (rowCountCase_ == 4) {
+ return (java.lang.Long) rowCount_;
+ }
+ return 0L;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -211,6 +290,14 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (queryStats_ != null) {
output.writeMessage(2, getQueryStats());
}
+ if (rowCountCase_ == 3) {
+ output.writeInt64(
+ 3, (long)((java.lang.Long) rowCount_));
+ }
+ if (rowCountCase_ == 4) {
+ output.writeInt64(
+ 4, (long)((java.lang.Long) rowCount_));
+ }
unknownFields.writeTo(output);
}
@@ -228,6 +315,16 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getQueryStats());
}
+ if (rowCountCase_ == 3) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(
+ 3, (long)((java.lang.Long) rowCount_));
+ }
+ if (rowCountCase_ == 4) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(
+ 4, (long)((java.lang.Long) rowCount_));
+ }
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
@@ -254,6 +351,21 @@ public boolean equals(final java.lang.Object obj) {
result = result && getQueryStats()
.equals(other.getQueryStats());
}
+ result = result && getRowCountCase().equals(
+ other.getRowCountCase());
+ if (!result) return false;
+ switch (rowCountCase_) {
+ case 3:
+ result = result && (getRowCountExact()
+ == other.getRowCountExact());
+ break;
+ case 4:
+ result = result && (getRowCountLowerBound()
+ == other.getRowCountLowerBound());
+ break;
+ case 0:
+ default:
+ }
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@@ -273,6 +385,20 @@ public int hashCode() {
hash = (37 * hash) + QUERY_STATS_FIELD_NUMBER;
hash = (53 * hash) + getQueryStats().hashCode();
}
+ switch (rowCountCase_) {
+ case 3:
+ hash = (37 * hash) + ROW_COUNT_EXACT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getRowCountExact());
+ break;
+ case 4:
+ hash = (37 * hash) + ROW_COUNT_LOWER_BOUND_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getRowCountLowerBound());
+ break;
+ case 0:
+ default:
+ }
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
@@ -422,6 +548,8 @@ public Builder clear() {
queryStats_ = null;
queryStatsBuilder_ = null;
}
+ rowCountCase_ = 0;
+ rowCount_ = null;
return this;
}
@@ -458,6 +586,13 @@ public com.google.spanner.v1.ResultSetStats buildPartial() {
} else {
result.queryStats_ = queryStatsBuilder_.build();
}
+ if (rowCountCase_ == 3) {
+ result.rowCount_ = rowCount_;
+ }
+ if (rowCountCase_ == 4) {
+ result.rowCount_ = rowCount_;
+ }
+ result.rowCountCase_ = rowCountCase_;
onBuilt();
return result;
}
@@ -512,6 +647,19 @@ public Builder mergeFrom(com.google.spanner.v1.ResultSetStats other) {
if (other.hasQueryStats()) {
mergeQueryStats(other.getQueryStats());
}
+ switch (other.getRowCountCase()) {
+ case ROW_COUNT_EXACT: {
+ setRowCountExact(other.getRowCountExact());
+ break;
+ }
+ case ROW_COUNT_LOWER_BOUND: {
+ setRowCountLowerBound(other.getRowCountLowerBound());
+ break;
+ }
+ case ROWCOUNT_NOT_SET: {
+ break;
+ }
+ }
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
@@ -540,6 +688,21 @@ public Builder mergeFrom(
}
return this;
}
+ private int rowCountCase_ = 0;
+ private java.lang.Object rowCount_;
+ public RowCountCase
+ getRowCountCase() {
+ return RowCountCase.forNumber(
+ rowCountCase_);
+ }
+
+ public Builder clearRowCount() {
+ rowCountCase_ = 0;
+ rowCount_ = null;
+ onChanged();
+ return this;
+ }
+
private com.google.spanner.v1.QueryPlan queryPlan_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
@@ -909,6 +1072,93 @@ public com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder() {
}
return queryStatsBuilder_;
}
+
+ /**
+ * + * Standard DML returns an exact count of rows that were modified. + *+ * + *
int64 row_count_exact = 3;
+ */
+ public long getRowCountExact() {
+ if (rowCountCase_ == 3) {
+ return (java.lang.Long) rowCount_;
+ }
+ return 0L;
+ }
+ /**
+ * + * Standard DML returns an exact count of rows that were modified. + *+ * + *
int64 row_count_exact = 3;
+ */
+ public Builder setRowCountExact(long value) {
+ rowCountCase_ = 3;
+ rowCount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Standard DML returns an exact count of rows that were modified. + *+ * + *
int64 row_count_exact = 3;
+ */
+ public Builder clearRowCountExact() {
+ if (rowCountCase_ == 3) {
+ rowCountCase_ = 0;
+ rowCount_ = null;
+ onChanged();
+ }
+ return this;
+ }
+
+ /**
+ * + * Partitioned DML does not offer exactly-once semantics, so it + * returns a lower bound of the rows modified. + *+ * + *
int64 row_count_lower_bound = 4;
+ */
+ public long getRowCountLowerBound() {
+ if (rowCountCase_ == 4) {
+ return (java.lang.Long) rowCount_;
+ }
+ return 0L;
+ }
+ /**
+ * + * Partitioned DML does not offer exactly-once semantics, so it + * returns a lower bound of the rows modified. + *+ * + *
int64 row_count_lower_bound = 4;
+ */
+ public Builder setRowCountLowerBound(long value) {
+ rowCountCase_ = 4;
+ rowCount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Partitioned DML does not offer exactly-once semantics, so it + * returns a lower bound of the rows modified. + *+ * + *
int64 row_count_lower_bound = 4;
+ */
+ public Builder clearRowCountLowerBound() {
+ if (rowCountCase_ == 4) {
+ rowCountCase_ = 0;
+ rowCount_ = null;
+ onChanged();
+ }
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStatsOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStatsOrBuilder.java
index 390292ec9df9..a168bbe2e2db 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStatsOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/ResultSetStatsOrBuilder.java
@@ -77,4 +77,25 @@ public interface ResultSetStatsOrBuilder extends
* .google.protobuf.Struct query_stats = 2;
*/
com.google.protobuf.StructOrBuilder getQueryStatsOrBuilder();
+
+ /**
+ * + * Standard DML returns an exact count of rows that were modified. + *+ * + *
int64 row_count_exact = 3;
+ */
+ long getRowCountExact();
+
+ /**
+ * + * Partitioned DML does not offer exactly-once semantics, so it + * returns a lower bound of the rows modified. + *+ * + *
int64 row_count_lower_bound = 4;
+ */
+ long getRowCountLowerBound();
+
+ public com.google.spanner.v1.ResultSetStats.RowCountCase getRowCountCase();
}
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
index 2f3ca6d3e93f..494e28b9d4ff 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/SpannerProto.java
@@ -146,7 +146,7 @@ public static void registerAllExtensions(
"\"]\n\024ListSessionsResponse\022,\n\010sessions\030\001 \003" +
"(\0132\032.google.spanner.v1.Session\022\027\n\017next_p" +
"age_token\030\002 \001(\t\"$\n\024DeleteSessionRequest\022" +
- "\014\n\004name\030\001 \001(\t\"\321\003\n\021ExecuteSqlRequest\022\017\n\007s" +
+ "\014\n\004name\030\001 \001(\t\"\340\003\n\021ExecuteSqlRequest\022\017\n\007s" +
"ession\030\001 \001(\t\022;\n\013transaction\030\002 \001(\0132&.goog" +
"le.spanner.v1.TransactionSelector\022\013\n\003sql" +
"\030\003 \001(\t\022\'\n\006params\030\004 \001(\0132\027.google.protobuf" +
@@ -154,108 +154,108 @@ public static void registerAllExtensions(
"anner.v1.ExecuteSqlRequest.ParamTypesEnt" +
"ry\022\024\n\014resume_token\030\006 \001(\014\022B\n\nquery_mode\030\007" +
" \001(\0162..google.spanner.v1.ExecuteSqlReque" +
- "st.QueryMode\022\027\n\017partition_token\030\010 \001(\014\032J\n" +
- "\017ParamTypesEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002" +
- " \001(\0132\027.google.spanner.v1.Type:\0028\001\".\n\tQue" +
- "ryMode\022\n\n\006NORMAL\020\000\022\010\n\004PLAN\020\001\022\013\n\007PROFILE\020" +
- "\002\"H\n\020PartitionOptions\022\034\n\024partition_size_" +
- "bytes\030\001 \001(\003\022\026\n\016max_partitions\030\002 \001(\003\"\366\002\n\025" +
- "PartitionQueryRequest\022\017\n\007session\030\001 \001(\t\022;" +
- "\n\013transaction\030\002 \001(\0132&.google.spanner.v1." +
- "TransactionSelector\022\013\n\003sql\030\003 \001(\t\022\'\n\006para" +
- "ms\030\004 \001(\0132\027.google.protobuf.Struct\022M\n\013par" +
- "am_types\030\005 \003(\01328.google.spanner.v1.Parti" +
- "tionQueryRequest.ParamTypesEntry\022>\n\021part" +
- "ition_options\030\006 \001(\0132#.google.spanner.v1." +
- "PartitionOptions\032J\n\017ParamTypesEntry\022\013\n\003k" +
- "ey\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027.google.spanner" +
- ".v1.Type:\0028\001\"\377\001\n\024PartitionReadRequest\022\017\n" +
- "\007session\030\001 \001(\t\022;\n\013transaction\030\002 \001(\0132&.go" +
- "ogle.spanner.v1.TransactionSelector\022\r\n\005t" +
- "able\030\003 \001(\t\022\r\n\005index\030\004 \001(\t\022\017\n\007columns\030\005 \003" +
- "(\t\022*\n\007key_set\030\006 \001(\0132\031.google.spanner.v1." +
- "KeySet\022>\n\021partition_options\030\t \001(\0132#.goog" +
- "le.spanner.v1.PartitionOptions\"$\n\tPartit" +
- "ion\022\027\n\017partition_token\030\001 \001(\014\"z\n\021Partitio" +
- "nResponse\0220\n\npartitions\030\001 \003(\0132\034.google.s" +
- "panner.v1.Partition\0223\n\013transaction\030\002 \001(\013" +
- "2\036.google.spanner.v1.Transaction\"\364\001\n\013Rea" +
- "dRequest\022\017\n\007session\030\001 \001(\t\022;\n\013transaction" +
- "\030\002 \001(\0132&.google.spanner.v1.TransactionSe" +
- "lector\022\r\n\005table\030\003 \001(\t\022\r\n\005index\030\004 \001(\t\022\017\n\007" +
- "columns\030\005 \003(\t\022*\n\007key_set\030\006 \001(\0132\031.google." +
- "spanner.v1.KeySet\022\r\n\005limit\030\010 \001(\003\022\024\n\014resu" +
- "me_token\030\t \001(\014\022\027\n\017partition_token\030\n \001(\014\"" +
- "b\n\027BeginTransactionRequest\022\017\n\007session\030\001 " +
- "\001(\t\0226\n\007options\030\002 \001(\0132%.google.spanner.v1" +
- ".TransactionOptions\"\302\001\n\rCommitRequest\022\017\n" +
- "\007session\030\001 \001(\t\022\030\n\016transaction_id\030\002 \001(\014H\000" +
- "\022G\n\026single_use_transaction\030\003 \001(\0132%.googl" +
- "e.spanner.v1.TransactionOptionsH\000\022.\n\tmut" +
- "ations\030\004 \003(\0132\033.google.spanner.v1.Mutatio" +
- "nB\r\n\013transaction\"F\n\016CommitResponse\0224\n\020co" +
- "mmit_timestamp\030\001 \001(\0132\032.google.protobuf.T" +
- "imestamp\":\n\017RollbackRequest\022\017\n\007session\030\001" +
- " \001(\t\022\026\n\016transaction_id\030\002 \001(\0142\203\021\n\007Spanner" +
- "\022\233\001\n\rCreateSession\022\'.google.spanner.v1.C" +
- "reateSessionRequest\032\032.google.spanner.v1." +
- "Session\"E\202\323\344\223\002?\":/v1/{database=projects/" +
- "*/instances/*/databases/*}/sessions:\001*\022\220" +
- "\001\n\nGetSession\022$.google.spanner.v1.GetSes" +
- "sionRequest\032\032.google.spanner.v1.Session\"" +
- "@\202\323\344\223\002:\0228/v1/{name=projects/*/instances/" +
- "*/databases/*/sessions/*}\022\243\001\n\014ListSessio" +
- "ns\022&.google.spanner.v1.ListSessionsReque" +
- "st\032\'.google.spanner.v1.ListSessionsRespo" +
- "nse\"B\202\323\344\223\002<\022:/v1/{database=projects/*/in" +
- "stances/*/databases/*}/sessions\022\222\001\n\rDele" +
- "teSession\022\'.google.spanner.v1.DeleteSess" +
- "ionRequest\032\026.google.protobuf.Empty\"@\202\323\344\223" +
- "\002:*8/v1/{name=projects/*/instances/*/dat" +
- "abases/*/sessions/*}\022\243\001\n\nExecuteSql\022$.go" +
- "ogle.spanner.v1.ExecuteSqlRequest\032\034.goog" +
- "le.spanner.v1.ResultSet\"Q\202\323\344\223\002K\"F/v1/{se" +
- "ssion=projects/*/instances/*/databases/*" +
- "/sessions/*}:executeSql:\001*\022\276\001\n\023ExecuteSt" +
- "reamingSql\022$.google.spanner.v1.ExecuteSq" +
- "lRequest\032#.google.spanner.v1.PartialResu" +
- "ltSet\"Z\202\323\344\223\002T\"O/v1/{session=projects/*/i" +
- "nstances/*/databases/*/sessions/*}:execu" +
- "teStreamingSql:\001*0\001\022\221\001\n\004Read\022\036.google.sp" +
- "anner.v1.ReadRequest\032\034.google.spanner.v1" +
- ".ResultSet\"K\202\323\344\223\002E\"@/v1/{session=project" +
- "s/*/instances/*/databases/*/sessions/*}:" +
- "read:\001*\022\254\001\n\rStreamingRead\022\036.google.spann" +
- "er.v1.ReadRequest\032#.google.spanner.v1.Pa" +
- "rtialResultSet\"T\202\323\344\223\002N\"I/v1/{session=pro" +
- "jects/*/instances/*/databases/*/sessions" +
- "/*}:streamingRead:\001*0\001\022\267\001\n\020BeginTransact" +
- "ion\022*.google.spanner.v1.BeginTransaction" +
- "Request\032\036.google.spanner.v1.Transaction\"" +
- "W\202\323\344\223\002Q\"L/v1/{session=projects/*/instanc" +
- "es/*/databases/*/sessions/*}:beginTransa" +
- "ction:\001*\022\234\001\n\006Commit\022 .google.spanner.v1." +
- "CommitRequest\032!.google.spanner.v1.Commit" +
- "Response\"M\202\323\344\223\002G\"B/v1/{session=projects/" +
- "*/instances/*/databases/*/sessions/*}:co" +
- "mmit:\001*\022\227\001\n\010Rollback\022\".google.spanner.v1" +
- ".RollbackRequest\032\026.google.protobuf.Empty" +
- "\"O\202\323\344\223\002I\"D/v1/{session=projects/*/instan" +
- "ces/*/databases/*/sessions/*}:rollback:\001" +
- "*\022\267\001\n\016PartitionQuery\022(.google.spanner.v1" +
- ".PartitionQueryRequest\032$.google.spanner." +
- "v1.PartitionResponse\"U\202\323\344\223\002O\"J/v1/{sessi" +
+ "st.QueryMode\022\027\n\017partition_token\030\010 \001(\014\022\r\n" +
+ "\005seqno\030\t \001(\003\032J\n\017ParamTypesEntry\022\013\n\003key\030\001" +
+ " \001(\t\022&\n\005value\030\002 \001(\0132\027.google.spanner.v1." +
+ "Type:\0028\001\".\n\tQueryMode\022\n\n\006NORMAL\020\000\022\010\n\004PLA" +
+ "N\020\001\022\013\n\007PROFILE\020\002\"H\n\020PartitionOptions\022\034\n\024" +
+ "partition_size_bytes\030\001 \001(\003\022\026\n\016max_partit" +
+ "ions\030\002 \001(\003\"\366\002\n\025PartitionQueryRequest\022\017\n\007" +
+ "session\030\001 \001(\t\022;\n\013transaction\030\002 \001(\0132&.goo" +
+ "gle.spanner.v1.TransactionSelector\022\013\n\003sq" +
+ "l\030\003 \001(\t\022\'\n\006params\030\004 \001(\0132\027.google.protobu" +
+ "f.Struct\022M\n\013param_types\030\005 \003(\01328.google.s" +
+ "panner.v1.PartitionQueryRequest.ParamTyp" +
+ "esEntry\022>\n\021partition_options\030\006 \001(\0132#.goo" +
+ "gle.spanner.v1.PartitionOptions\032J\n\017Param" +
+ "TypesEntry\022\013\n\003key\030\001 \001(\t\022&\n\005value\030\002 \001(\0132\027" +
+ ".google.spanner.v1.Type:\0028\001\"\377\001\n\024Partitio" +
+ "nReadRequest\022\017\n\007session\030\001 \001(\t\022;\n\013transac" +
+ "tion\030\002 \001(\0132&.google.spanner.v1.Transacti" +
+ "onSelector\022\r\n\005table\030\003 \001(\t\022\r\n\005index\030\004 \001(\t" +
+ "\022\017\n\007columns\030\005 \003(\t\022*\n\007key_set\030\006 \001(\0132\031.goo" +
+ "gle.spanner.v1.KeySet\022>\n\021partition_optio" +
+ "ns\030\t \001(\0132#.google.spanner.v1.PartitionOp" +
+ "tions\"$\n\tPartition\022\027\n\017partition_token\030\001 " +
+ "\001(\014\"z\n\021PartitionResponse\0220\n\npartitions\030\001" +
+ " \003(\0132\034.google.spanner.v1.Partition\0223\n\013tr" +
+ "ansaction\030\002 \001(\0132\036.google.spanner.v1.Tran" +
+ "saction\"\364\001\n\013ReadRequest\022\017\n\007session\030\001 \001(\t" +
+ "\022;\n\013transaction\030\002 \001(\0132&.google.spanner.v" +
+ "1.TransactionSelector\022\r\n\005table\030\003 \001(\t\022\r\n\005" +
+ "index\030\004 \001(\t\022\017\n\007columns\030\005 \003(\t\022*\n\007key_set\030" +
+ "\006 \001(\0132\031.google.spanner.v1.KeySet\022\r\n\005limi" +
+ "t\030\010 \001(\003\022\024\n\014resume_token\030\t \001(\014\022\027\n\017partiti" +
+ "on_token\030\n \001(\014\"b\n\027BeginTransactionReques" +
+ "t\022\017\n\007session\030\001 \001(\t\0226\n\007options\030\002 \001(\0132%.go" +
+ "ogle.spanner.v1.TransactionOptions\"\302\001\n\rC" +
+ "ommitRequest\022\017\n\007session\030\001 \001(\t\022\030\n\016transac" +
+ "tion_id\030\002 \001(\014H\000\022G\n\026single_use_transactio" +
+ "n\030\003 \001(\0132%.google.spanner.v1.TransactionO" +
+ "ptionsH\000\022.\n\tmutations\030\004 \003(\0132\033.google.spa" +
+ "nner.v1.MutationB\r\n\013transaction\"F\n\016Commi" +
+ "tResponse\0224\n\020commit_timestamp\030\001 \001(\0132\032.go" +
+ "ogle.protobuf.Timestamp\":\n\017RollbackReque" +
+ "st\022\017\n\007session\030\001 \001(\t\022\026\n\016transaction_id\030\002 " +
+ "\001(\0142\203\021\n\007Spanner\022\233\001\n\rCreateSession\022\'.goog" +
+ "le.spanner.v1.CreateSessionRequest\032\032.goo" +
+ "gle.spanner.v1.Session\"E\202\323\344\223\002?\":/v1/{dat" +
+ "abase=projects/*/instances/*/databases/*" +
+ "}/sessions:\001*\022\220\001\n\nGetSession\022$.google.sp" +
+ "anner.v1.GetSessionRequest\032\032.google.span" +
+ "ner.v1.Session\"@\202\323\344\223\002:\0228/v1/{name=projec" +
+ "ts/*/instances/*/databases/*/sessions/*}" +
+ "\022\243\001\n\014ListSessions\022&.google.spanner.v1.Li" +
+ "stSessionsRequest\032\'.google.spanner.v1.Li" +
+ "stSessionsResponse\"B\202\323\344\223\002<\022:/v1/{databas" +
+ "e=projects/*/instances/*/databases/*}/se" +
+ "ssions\022\222\001\n\rDeleteSession\022\'.google.spanne" +
+ "r.v1.DeleteSessionRequest\032\026.google.proto" +
+ "buf.Empty\"@\202\323\344\223\002:*8/v1/{name=projects/*/" +
+ "instances/*/databases/*/sessions/*}\022\243\001\n\n" +
+ "ExecuteSql\022$.google.spanner.v1.ExecuteSq" +
+ "lRequest\032\034.google.spanner.v1.ResultSet\"Q" +
+ "\202\323\344\223\002K\"F/v1/{session=projects/*/instance" +
+ "s/*/databases/*/sessions/*}:executeSql:\001" +
+ "*\022\276\001\n\023ExecuteStreamingSql\022$.google.spann" +
+ "er.v1.ExecuteSqlRequest\032#.google.spanner" +
+ ".v1.PartialResultSet\"Z\202\323\344\223\002T\"O/v1/{sessi" +
"on=projects/*/instances/*/databases/*/se" +
- "ssions/*}:partitionQuery:\001*\022\264\001\n\rPartitio" +
- "nRead\022\'.google.spanner.v1.PartitionReadR" +
- "equest\032$.google.spanner.v1.PartitionResp" +
- "onse\"T\202\323\344\223\002N\"I/v1/{session=projects/*/in" +
- "stances/*/databases/*/sessions/*}:partit" +
- "ionRead:\001*B\225\001\n\025com.google.spanner.v1B\014Sp" +
- "annerProtoP\001Z8google.golang.org/genproto" +
- "/googleapis/spanner/v1;spanner\252\002\027Google." +
- "Cloud.Spanner.V1\312\002\027Google\\Cloud\\Spanner\\" +
- "V1b\006proto3"
+ "ssions/*}:executeStreamingSql:\001*0\001\022\221\001\n\004R" +
+ "ead\022\036.google.spanner.v1.ReadRequest\032\034.go" +
+ "ogle.spanner.v1.ResultSet\"K\202\323\344\223\002E\"@/v1/{" +
+ "session=projects/*/instances/*/databases" +
+ "/*/sessions/*}:read:\001*\022\254\001\n\rStreamingRead" +
+ "\022\036.google.spanner.v1.ReadRequest\032#.googl" +
+ "e.spanner.v1.PartialResultSet\"T\202\323\344\223\002N\"I/" +
+ "v1/{session=projects/*/instances/*/datab" +
+ "ases/*/sessions/*}:streamingRead:\001*0\001\022\267\001" +
+ "\n\020BeginTransaction\022*.google.spanner.v1.B" +
+ "eginTransactionRequest\032\036.google.spanner." +
+ "v1.Transaction\"W\202\323\344\223\002Q\"L/v1/{session=pro" +
+ "jects/*/instances/*/databases/*/sessions" +
+ "/*}:beginTransaction:\001*\022\234\001\n\006Commit\022 .goo" +
+ "gle.spanner.v1.CommitRequest\032!.google.sp" +
+ "anner.v1.CommitResponse\"M\202\323\344\223\002G\"B/v1/{se" +
+ "ssion=projects/*/instances/*/databases/*" +
+ "/sessions/*}:commit:\001*\022\227\001\n\010Rollback\022\".go" +
+ "ogle.spanner.v1.RollbackRequest\032\026.google" +
+ ".protobuf.Empty\"O\202\323\344\223\002I\"D/v1/{session=pr" +
+ "ojects/*/instances/*/databases/*/session" +
+ "s/*}:rollback:\001*\022\267\001\n\016PartitionQuery\022(.go" +
+ "ogle.spanner.v1.PartitionQueryRequest\032$." +
+ "google.spanner.v1.PartitionResponse\"U\202\323\344" +
+ "\223\002O\"J/v1/{session=projects/*/instances/*" +
+ "/databases/*/sessions/*}:partitionQuery:" +
+ "\001*\022\264\001\n\rPartitionRead\022\'.google.spanner.v1" +
+ ".PartitionReadRequest\032$.google.spanner.v" +
+ "1.PartitionResponse\"T\202\323\344\223\002N\"I/v1/{sessio" +
+ "n=projects/*/instances/*/databases/*/ses" +
+ "sions/*}:partitionRead:\001*B\225\001\n\025com.google" +
+ ".spanner.v1B\014SpannerProtoP\001Z8google.gola" +
+ "ng.org/genproto/googleapis/spanner/v1;sp" +
+ "anner\252\002\027Google.Cloud.Spanner.V1\312\002\027Google" +
+ "\\Cloud\\Spanner\\V1b\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
@@ -325,7 +325,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors(
internal_static_google_spanner_v1_ExecuteSqlRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_spanner_v1_ExecuteSqlRequest_descriptor,
- new java.lang.String[] { "Session", "Transaction", "Sql", "Params", "ParamTypes", "ResumeToken", "QueryMode", "PartitionToken", });
+ new java.lang.String[] { "Session", "Transaction", "Sql", "Params", "ParamTypes", "ResumeToken", "QueryMode", "PartitionToken", "Seqno", });
internal_static_google_spanner_v1_ExecuteSqlRequest_ParamTypesEntry_descriptor =
internal_static_google_spanner_v1_ExecuteSqlRequest_descriptor.getNestedTypes().get(0);
internal_static_google_spanner_v1_ExecuteSqlRequest_ParamTypesEntry_fieldAccessorTable = new
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
index 9712d6bd06a5..6f3d628dd488 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptions.java
@@ -11,7 +11,7 @@
* re-used for the next transaction. It is not necessary to create a
* new session for each transaction.
* # Transaction Modes
- * Cloud Spanner supports two transaction modes:
+ * Cloud Spanner supports three transaction modes:
* 1. Locking read-write. This type of transaction is the only way
* to write data into Cloud Spanner. These transactions rely on
* pessimistic locking and, if necessary, two-phase commit.
@@ -22,6 +22,12 @@
* writes. Snapshot read-only transactions can be configured to
* read at timestamps in the past. Snapshot read-only
* transactions do not need to be committed.
+ * 3. Partitioned DML. This type of transaction is used to execute
+ * a single Partitioned DML statement. Partitioned DML partitions
+ * the key space and runs the DML statement over each partition
+ * in parallel using separate, internal transactions that commit
+ * independently. Partitioned DML transactions do not need to be
+ * committed.
* For transactions that only read, snapshot read-only transactions
* provide simpler semantics and are almost always faster. In
* particular, read-only transactions do not take locks, so they do
@@ -43,11 +49,8 @@
* [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of
* inactivity at the client may cause Cloud Spanner to release a
* transaction's locks and abort it.
- * Reads performed within a transaction acquire locks on the data
- * being read. Writes can only be done at commit time, after all reads
- * have been completed.
* Conceptually, a read-write transaction consists of zero or more
- * reads or SQL queries followed by
+ * reads or SQL statements followed by
* [Commit][google.spanner.v1.Spanner.Commit]. At any time before
* [Commit][google.spanner.v1.Spanner.Commit], the client can send a
* [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the
@@ -173,6 +176,50 @@
* restriction also applies to in-progress reads and/or SQL queries whose
* timestamp become too old while executing. Reads and SQL queries with
* too-old read timestamps fail with the error `FAILED_PRECONDITION`.
+ * ## Partitioned DML Transactions
+ * Partitioned DML transactions are used to execute DML statements with a
+ * different execution strategy that provides different, and often better,
+ * scalability properties for large, table-wide operations than DML in a
+ * ReadWrite transaction. Smaller scoped statements, such as an OLTP workload,
+ * should prefer using ReadWrite transactions.
+ * Partitioned DML partitions the keyspace and runs the DML statement on each
+ * partition in separate, internal transactions. These transactions commit
+ * automatically when complete, and run independently from one another.
+ * To reduce lock contention, this execution strategy only acquires read locks
+ * on rows that match the WHERE clause of the statement. Additionally, the
+ * smaller per-partition transactions hold locks for less time.
+ * That said, Partitioned DML is not a drop-in replacement for standard DML used
+ * in ReadWrite transactions.
+ * - The DML statement must be fully-partitionable. Specifically, the statement
+ * must be expressible as the union of many statements which each access only
+ * a single row of the table.
+ * - The statement is not applied atomically to all rows of the table. Rather,
+ * the statement is applied atomically to partitions of the table, in
+ * independent transactions. Secondary index rows are updated atomically
+ * with the base table rows.
+ * - Partitioned DML does not guarantee exactly-once execution semantics
+ * against a partition. The statement will be applied at least once to each
+ * partition. It is strongly recommended that the DML statement should be
+ * idempotent to avoid unexpected results. For instance, it is potentially
+ * dangerous to run a statement such as
+ * `UPDATE table SET column = column + 1` as it could be run multiple times
+ * against some rows.
+ * - The partitions are committed automatically - there is no support for
+ * Commit or Rollback. If the call returns an error, or if the client issuing
+ * the ExecuteSql call dies, it is possible that some rows had the statement
+ * executed on them successfully. It is also possible that statement was
+ * never executed against other rows.
+ * - Partitioned DML transactions may only contain the execution of a single
+ * DML statement via ExecuteSql or ExecuteStreamingSql.
+ * - If any error is encountered during the execution of the partitioned DML
+ * operation (for instance, a UNIQUE INDEX violation, division by zero, or a
+ * value that cannot be stored due to schema constraints), then the
+ * operation is stopped at that point and an error is returned. It is
+ * possible that at this point, some partitions have been committed (or even
+ * committed multiple times), and other partitions have not been run at all.
+ * Given the above, Partitioned DML is good fit for large, database-wide,
+ * operations that are idempotent, such as deleting old rows from a very large
+ * table.
*
*
* Protobuf type {@code google.spanner.v1.TransactionOptions}
@@ -241,6 +288,20 @@ private TransactionOptions(
modeCase_ = 2;
break;
}
+ case 26: {
+ com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder subBuilder = null;
+ if (modeCase_ == 3) {
+ subBuilder = ((com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_).toBuilder();
+ }
+ mode_ =
+ input.readMessage(com.google.spanner.v1.TransactionOptions.PartitionedDml.parser(), extensionRegistry);
+ if (subBuilder != null) {
+ subBuilder.mergeFrom((com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_);
+ mode_ = subBuilder.buildPartial();
+ }
+ modeCase_ = 3;
+ break;
+ }
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
@@ -695,6 +756,426 @@ public com.google.spanner.v1.TransactionOptions.ReadWrite getDefaultInstanceForT
}
+ public interface PartitionedDmlOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:google.spanner.v1.TransactionOptions.PartitionedDml)
+ com.google.protobuf.MessageOrBuilder {
+ }
+ /**
+ * + * Message type to initiate a Partitioned DML transaction. + *+ * + * Protobuf type {@code google.spanner.v1.TransactionOptions.PartitionedDml} + */ + public static final class PartitionedDml extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.spanner.v1.TransactionOptions.PartitionedDml) + PartitionedDmlOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartitionedDml.newBuilder() to construct. + private PartitionedDml(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private PartitionedDml() { + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PartitionedDml( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + 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; + 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.spanner.v1.TransactionProto.internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.spanner.v1.TransactionProto.internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.spanner.v1.TransactionOptions.PartitionedDml.class, com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.spanner.v1.TransactionOptions.PartitionedDml)) { + return super.equals(obj); + } + com.google.spanner.v1.TransactionOptions.PartitionedDml other = (com.google.spanner.v1.TransactionOptions.PartitionedDml) obj; + + boolean result = true; + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.spanner.v1.TransactionOptions.PartitionedDml parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml 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.spanner.v1.TransactionOptions.PartitionedDml parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml 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.spanner.v1.TransactionOptions.PartitionedDml parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml 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.spanner.v1.TransactionOptions.PartitionedDml parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.spanner.v1.TransactionOptions.PartitionedDml 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.spanner.v1.TransactionOptions.PartitionedDml 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 type to initiate a Partitioned DML transaction. + *+ * + * Protobuf type {@code google.spanner.v1.TransactionOptions.PartitionedDml} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public boolean hasPartitionedDml() {
+ return modeCase_ == 3;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public com.google.spanner.v1.TransactionOptions.PartitionedDml getPartitionedDml() {
+ if (modeCase_ == 3) {
+ return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_;
+ }
+ return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder() {
+ if (modeCase_ == 3) {
+ return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_;
+ }
+ return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ }
+
public static final int READ_ONLY_FIELD_NUMBER = 2;
/**
* @@ -3133,6 +3663,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (modeCase_ == 2) { output.writeMessage(2, (com.google.spanner.v1.TransactionOptions.ReadOnly) mode_); } + if (modeCase_ == 3) { + output.writeMessage(3, (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_); + } unknownFields.writeTo(output); } @@ -3150,6 +3683,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, (com.google.spanner.v1.TransactionOptions.ReadOnly) mode_); } + if (modeCase_ == 3) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -3174,6 +3711,10 @@ public boolean equals(final java.lang.Object obj) { result = result && getReadWrite() .equals(other.getReadWrite()); break; + case 3: + result = result && getPartitionedDml() + .equals(other.getPartitionedDml()); + break; case 2: result = result && getReadOnly() .equals(other.getReadOnly()); @@ -3197,6 +3738,10 @@ public int hashCode() { hash = (37 * hash) + READ_WRITE_FIELD_NUMBER; hash = (53 * hash) + getReadWrite().hashCode(); break; + case 3: + hash = (37 * hash) + PARTITIONED_DML_FIELD_NUMBER; + hash = (53 * hash) + getPartitionedDml().hashCode(); + break; case 2: hash = (37 * hash) + READ_ONLY_FIELD_NUMBER; hash = (53 * hash) + getReadOnly().hashCode(); @@ -3307,7 +3852,7 @@ protected Builder newBuilderForType( * re-used for the next transaction. It is not necessary to create a * new session for each transaction. * # Transaction Modes - * Cloud Spanner supports two transaction modes: + * Cloud Spanner supports three transaction modes: * 1. Locking read-write. This type of transaction is the only way * to write data into Cloud Spanner. These transactions rely on * pessimistic locking and, if necessary, two-phase commit. @@ -3318,6 +3863,12 @@ protected Builder newBuilderForType( * writes. Snapshot read-only transactions can be configured to * read at timestamps in the past. Snapshot read-only * transactions do not need to be committed. + * 3. Partitioned DML. This type of transaction is used to execute + * a single Partitioned DML statement. Partitioned DML partitions + * the key space and runs the DML statement over each partition + * in parallel using separate, internal transactions that commit + * independently. Partitioned DML transactions do not need to be + * committed. * For transactions that only read, snapshot read-only transactions * provide simpler semantics and are almost always faster. In * particular, read-only transactions do not take locks, so they do @@ -3339,11 +3890,8 @@ protected Builder newBuilderForType( * [Rollback][google.spanner.v1.Spanner.Rollback]. Long periods of * inactivity at the client may cause Cloud Spanner to release a * transaction's locks and abort it. - * Reads performed within a transaction acquire locks on the data - * being read. Writes can only be done at commit time, after all reads - * have been completed. * Conceptually, a read-write transaction consists of zero or more - * reads or SQL queries followed by + * reads or SQL statements followed by * [Commit][google.spanner.v1.Spanner.Commit]. At any time before * [Commit][google.spanner.v1.Spanner.Commit], the client can send a * [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the @@ -3469,6 +4017,50 @@ protected Builder newBuilderForType( * restriction also applies to in-progress reads and/or SQL queries whose * timestamp become too old while executing. Reads and SQL queries with * too-old read timestamps fail with the error `FAILED_PRECONDITION`. + * ## Partitioned DML Transactions + * Partitioned DML transactions are used to execute DML statements with a + * different execution strategy that provides different, and often better, + * scalability properties for large, table-wide operations than DML in a + * ReadWrite transaction. Smaller scoped statements, such as an OLTP workload, + * should prefer using ReadWrite transactions. + * Partitioned DML partitions the keyspace and runs the DML statement on each + * partition in separate, internal transactions. These transactions commit + * automatically when complete, and run independently from one another. + * To reduce lock contention, this execution strategy only acquires read locks + * on rows that match the WHERE clause of the statement. Additionally, the + * smaller per-partition transactions hold locks for less time. + * That said, Partitioned DML is not a drop-in replacement for standard DML used + * in ReadWrite transactions. + * - The DML statement must be fully-partitionable. Specifically, the statement + * must be expressible as the union of many statements which each access only + * a single row of the table. + * - The statement is not applied atomically to all rows of the table. Rather, + * the statement is applied atomically to partitions of the table, in + * independent transactions. Secondary index rows are updated atomically + * with the base table rows. + * - Partitioned DML does not guarantee exactly-once execution semantics + * against a partition. The statement will be applied at least once to each + * partition. It is strongly recommended that the DML statement should be + * idempotent to avoid unexpected results. For instance, it is potentially + * dangerous to run a statement such as + * `UPDATE table SET column = column + 1` as it could be run multiple times + * against some rows. + * - The partitions are committed automatically - there is no support for + * Commit or Rollback. If the call returns an error, or if the client issuing + * the ExecuteSql call dies, it is possible that some rows had the statement + * executed on them successfully. It is also possible that statement was + * never executed against other rows. + * - Partitioned DML transactions may only contain the execution of a single + * DML statement via ExecuteSql or ExecuteStreamingSql. + * - If any error is encountered during the execution of the partitioned DML + * operation (for instance, a UNIQUE INDEX violation, division by zero, or a + * value that cannot be stored due to schema constraints), then the + * operation is stopped at that point and an error is returned. It is + * possible that at this point, some partitions have been committed (or even + * committed multiple times), and other partitions have not been run at all. + * Given the above, Partitioned DML is good fit for large, database-wide, + * operations that are idempotent, such as deleting old rows from a very large + * table. ** * Protobuf type {@code google.spanner.v1.TransactionOptions} @@ -3543,6 +4135,13 @@ public com.google.spanner.v1.TransactionOptions buildPartial() { result.mode_ = readWriteBuilder_.build(); } } + if (modeCase_ == 3) { + if (partitionedDmlBuilder_ == null) { + result.mode_ = mode_; + } else { + result.mode_ = partitionedDmlBuilder_.build(); + } + } if (modeCase_ == 2) { if (readOnlyBuilder_ == null) { result.mode_ = mode_; @@ -3604,6 +4203,10 @@ public Builder mergeFrom(com.google.spanner.v1.TransactionOptions other) { mergeReadWrite(other.getReadWrite()); break; } + case PARTITIONED_DML: { + mergePartitionedDml(other.getPartitionedDml()); + break; + } case READ_ONLY: { mergeReadOnly(other.getReadOnly()); break; @@ -3855,6 +4458,205 @@ public com.google.spanner.v1.TransactionOptions.ReadWriteOrBuilder getReadWriteO return readWriteBuilder_; } + private com.google.protobuf.SingleFieldBuilderV3< + com.google.spanner.v1.TransactionOptions.PartitionedDml, com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder, com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder> partitionedDmlBuilder_; + /** + *
+ * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public boolean hasPartitionedDml() {
+ return modeCase_ == 3;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public com.google.spanner.v1.TransactionOptions.PartitionedDml getPartitionedDml() {
+ if (partitionedDmlBuilder_ == null) {
+ if (modeCase_ == 3) {
+ return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_;
+ }
+ return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ } else {
+ if (modeCase_ == 3) {
+ return partitionedDmlBuilder_.getMessage();
+ }
+ return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public Builder setPartitionedDml(com.google.spanner.v1.TransactionOptions.PartitionedDml value) {
+ if (partitionedDmlBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ mode_ = value;
+ onChanged();
+ } else {
+ partitionedDmlBuilder_.setMessage(value);
+ }
+ modeCase_ = 3;
+ return this;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public Builder setPartitionedDml(
+ com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder builderForValue) {
+ if (partitionedDmlBuilder_ == null) {
+ mode_ = builderForValue.build();
+ onChanged();
+ } else {
+ partitionedDmlBuilder_.setMessage(builderForValue.build());
+ }
+ modeCase_ = 3;
+ return this;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public Builder mergePartitionedDml(com.google.spanner.v1.TransactionOptions.PartitionedDml value) {
+ if (partitionedDmlBuilder_ == null) {
+ if (modeCase_ == 3 &&
+ mode_ != com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance()) {
+ mode_ = com.google.spanner.v1.TransactionOptions.PartitionedDml.newBuilder((com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ mode_ = value;
+ }
+ onChanged();
+ } else {
+ if (modeCase_ == 3) {
+ partitionedDmlBuilder_.mergeFrom(value);
+ }
+ partitionedDmlBuilder_.setMessage(value);
+ }
+ modeCase_ = 3;
+ return this;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public Builder clearPartitionedDml() {
+ if (partitionedDmlBuilder_ == null) {
+ if (modeCase_ == 3) {
+ modeCase_ = 0;
+ mode_ = null;
+ onChanged();
+ }
+ } else {
+ if (modeCase_ == 3) {
+ modeCase_ = 0;
+ mode_ = null;
+ }
+ partitionedDmlBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder getPartitionedDmlBuilder() {
+ return getPartitionedDmlFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ public com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder() {
+ if ((modeCase_ == 3) && (partitionedDmlBuilder_ != null)) {
+ return partitionedDmlBuilder_.getMessageOrBuilder();
+ } else {
+ if (modeCase_ == 3) {
+ return (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_;
+ }
+ return com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ }
+ }
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.spanner.v1.TransactionOptions.PartitionedDml, com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder, com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder>
+ getPartitionedDmlFieldBuilder() {
+ if (partitionedDmlBuilder_ == null) {
+ if (!(modeCase_ == 3)) {
+ mode_ = com.google.spanner.v1.TransactionOptions.PartitionedDml.getDefaultInstance();
+ }
+ partitionedDmlBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.spanner.v1.TransactionOptions.PartitionedDml, com.google.spanner.v1.TransactionOptions.PartitionedDml.Builder, com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder>(
+ (com.google.spanner.v1.TransactionOptions.PartitionedDml) mode_,
+ getParentForChildren(),
+ isClean());
+ mode_ = null;
+ }
+ modeCase_ = 3;
+ onChanged();;
+ return partitionedDmlBuilder_;
+ }
+
private com.google.protobuf.SingleFieldBuilderV3<
com.google.spanner.v1.TransactionOptions.ReadOnly, com.google.spanner.v1.TransactionOptions.ReadOnly.Builder, com.google.spanner.v1.TransactionOptions.ReadOnlyOrBuilder> readOnlyBuilder_;
/**
diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptionsOrBuilder.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptionsOrBuilder.java
index 5456c87177ac..1807af45af3d 100644
--- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptionsOrBuilder.java
+++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionOptionsOrBuilder.java
@@ -41,6 +41,40 @@ public interface TransactionOptionsOrBuilder extends
*/
com.google.spanner.v1.TransactionOptions.ReadWriteOrBuilder getReadWriteOrBuilder();
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ boolean hasPartitionedDml();
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ com.google.spanner.v1.TransactionOptions.PartitionedDml getPartitionedDml();
+ /**
+ * + * Partitioned DML transaction. + * Authorization to begin a Partitioned DML transaction requires + * `spanner.databases.beginPartitionedDmlTransaction` permission + * on the `session` resource. + *+ * + *
.google.spanner.v1.TransactionOptions.PartitionedDml partitioned_dml = 3;
+ */
+ com.google.spanner.v1.TransactionOptions.PartitionedDmlOrBuilder getPartitionedDmlOrBuilder();
+
/**
* * Transaction will not write. diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionProto.java b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionProto.java index 7b6500bb2cbb..ef3b3fda954b 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionProto.java +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/java/com/google/spanner/v1/TransactionProto.java @@ -24,6 +24,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_spanner_v1_TransactionOptions_ReadWrite_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor; static final @@ -51,30 +56,32 @@ public static void registerAllExtensions( "\n#google/spanner/v1/transaction.proto\022\021g" + "oogle.spanner.v1\032\034google/api/annotations" + ".proto\032\036google/protobuf/duration.proto\032\037" + - "google/protobuf/timestamp.proto\"\340\003\n\022Tran" + + "google/protobuf/timestamp.proto\"\303\004\n\022Tran" + "sactionOptions\022E\n\nread_write\030\001 \001(\0132/.goo" + "gle.spanner.v1.TransactionOptions.ReadWr" + - "iteH\000\022C\n\tread_only\030\002 \001(\0132..google.spanne" + - "r.v1.TransactionOptions.ReadOnlyH\000\032\013\n\tRe" + - "adWrite\032\250\002\n\010ReadOnly\022\020\n\006strong\030\001 \001(\010H\000\0228" + - "\n\022min_read_timestamp\030\002 \001(\0132\032.google.prot" + - "obuf.TimestampH\000\0222\n\rmax_staleness\030\003 \001(\0132" + - "\031.google.protobuf.DurationH\000\0224\n\016read_tim" + - "estamp\030\004 \001(\0132\032.google.protobuf.Timestamp" + - "H\000\0224\n\017exact_staleness\030\005 \001(\0132\031.google.pro" + - "tobuf.DurationH\000\022\035\n\025return_read_timestam" + - "p\030\006 \001(\010B\021\n\017timestamp_boundB\006\n\004mode\"M\n\013Tr" + - "ansaction\022\n\n\002id\030\001 \001(\014\0222\n\016read_timestamp\030" + - "\002 \001(\0132\032.google.protobuf.Timestamp\"\244\001\n\023Tr" + - "ansactionSelector\022;\n\nsingle_use\030\001 \001(\0132%." + - "google.spanner.v1.TransactionOptionsH\000\022\014" + - "\n\002id\030\002 \001(\014H\000\0226\n\005begin\030\003 \001(\0132%.google.spa" + - "nner.v1.TransactionOptionsH\000B\n\n\010selector" + - "B\231\001\n\025com.google.spanner.v1B\020TransactionP" + - "rotoP\001Z8google.golang.org/genproto/googl" + - "eapis/spanner/v1;spanner\252\002\027Google.Cloud." + - "Spanner.V1\312\002\027Google\\Cloud\\Spanner\\V1b\006pr" + - "oto3" + "iteH\000\022O\n\017partitioned_dml\030\003 \001(\01324.google." + + "spanner.v1.TransactionOptions.Partitione" + + "dDmlH\000\022C\n\tread_only\030\002 \001(\0132..google.spann" + + "er.v1.TransactionOptions.ReadOnlyH\000\032\013\n\tR" + + "eadWrite\032\020\n\016PartitionedDml\032\250\002\n\010ReadOnly\022" + + "\020\n\006strong\030\001 \001(\010H\000\0228\n\022min_read_timestamp\030" + + "\002 \001(\0132\032.google.protobuf.TimestampH\000\0222\n\rm" + + "ax_staleness\030\003 \001(\0132\031.google.protobuf.Dur" + + "ationH\000\0224\n\016read_timestamp\030\004 \001(\0132\032.google" + + ".protobuf.TimestampH\000\0224\n\017exact_staleness" + + "\030\005 \001(\0132\031.google.protobuf.DurationH\000\022\035\n\025r" + + "eturn_read_timestamp\030\006 \001(\010B\021\n\017timestamp_" + + "boundB\006\n\004mode\"M\n\013Transaction\022\n\n\002id\030\001 \001(\014" + + "\0222\n\016read_timestamp\030\002 \001(\0132\032.google.protob" + + "uf.Timestamp\"\244\001\n\023TransactionSelector\022;\n\n" + + "single_use\030\001 \001(\0132%.google.spanner.v1.Tra" + + "nsactionOptionsH\000\022\014\n\002id\030\002 \001(\014H\000\0226\n\005begin" + + "\030\003 \001(\0132%.google.spanner.v1.TransactionOp" + + "tionsH\000B\n\n\010selectorB\231\001\n\025com.google.spann" + + "er.v1B\020TransactionProtoP\001Z8google.golang" + + ".org/genproto/googleapis/spanner/v1;span" + + "ner\252\002\027Google.Cloud.Spanner.V1\312\002\027Google\\C" + + "loud\\Spanner\\V1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { @@ -96,15 +103,21 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( internal_static_google_spanner_v1_TransactionOptions_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_TransactionOptions_descriptor, - new java.lang.String[] { "ReadWrite", "ReadOnly", "Mode", }); + new java.lang.String[] { "ReadWrite", "PartitionedDml", "ReadOnly", "Mode", }); internal_static_google_spanner_v1_TransactionOptions_ReadWrite_descriptor = internal_static_google_spanner_v1_TransactionOptions_descriptor.getNestedTypes().get(0); internal_static_google_spanner_v1_TransactionOptions_ReadWrite_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_TransactionOptions_ReadWrite_descriptor, new java.lang.String[] { }); - internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor = + internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_descriptor = internal_static_google_spanner_v1_TransactionOptions_descriptor.getNestedTypes().get(1); + internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_spanner_v1_TransactionOptions_PartitionedDml_descriptor, + new java.lang.String[] { }); + internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor = + internal_static_google_spanner_v1_TransactionOptions_descriptor.getNestedTypes().get(2); internal_static_google_spanner_v1_TransactionOptions_ReadOnly_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_spanner_v1_TransactionOptions_ReadOnly_descriptor, diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/keys.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/keys.proto index 463fb689cb3c..2078610f310f 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/keys.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/keys.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. diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto index 30ab1e6e7e7d..d4d5354c9965 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/mutation.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. diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto index 44c0dcf4ca43..7e82a404fc42 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/query_plan.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. diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto index ce3b3026f279..152b1368a2ec 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/result_set.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. @@ -45,8 +45,13 @@ message ResultSet { // [here][google.spanner.v1.TypeCode]. repeated google.protobuf.ListValue rows = 2; - // Query plan and execution statistics for the query that produced this - // result set. These can be requested by setting + // Query plan and execution statistics for the SQL statement that + // produced this result set. These can be requested by setting + // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // DML statements always produce stats containing the number of rows + // modified, unless executed using the + // [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. + // Other fields may or may not be populated, based on the // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode]. ResultSetStats stats = 3; } @@ -146,10 +151,12 @@ message PartialResultSet { // same session invalidates the token. bytes resume_token = 4; - // Query plan and execution statistics for the query that produced this + // Query plan and execution statistics for the statement that produced this // streaming result set. These can be requested by setting // [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent // only once with the last response in the stream. + // This field will also be present in the last response for DML + // statements. ResultSetStats stats = 5; } @@ -185,4 +192,14 @@ message ResultSetStats { // "cpu_time": "1.19 secs" // } google.protobuf.Struct query_stats = 2; + + // The number of rows modified by the DML statement. + oneof row_count { + // Standard DML returns an exact count of rows that were modified. + int64 row_count_exact = 3; + + // Partitioned DML does not offer exactly-once semantics, so it + // returns a lower bound of the rows modified. + int64 row_count_lower_bound = 4; + } } diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto index 30eecea9ff27..7d3de6ad771e 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/spanner.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. @@ -88,12 +88,12 @@ service Spanner { }; } - // Executes an SQL query, returning all rows in a single reply. This + // Executes an SQL statement, returning all results in a single reply. This // method cannot be used to return a result set larger than 10 MiB; // if the query yields more data than that, the query fails with // a `FAILED_PRECONDITION` error. // - // Queries inside read-write transactions might return `ABORTED`. If + // Operations inside read-write transactions might return `ABORTED`. If // this occurs, the application should restart the transaction from // the beginning. See [Transaction][google.spanner.v1.Transaction] for more details. // @@ -197,8 +197,11 @@ service Spanner { // of the query result to read. The same session and read-only transaction // must be used by the PartitionQueryRequest used to create the // partition tokens and the ExecuteSqlRequests that use the partition tokens. + // // Partition tokens become invalid when the session used to create them - // is deleted or begins a new transaction. + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it is not possible to resume the query, and + // the whole operation must be restarted from the beginning. rpc PartitionQuery(PartitionQueryRequest) returns (PartitionResponse) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionQuery" @@ -211,9 +214,14 @@ service Spanner { // by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read // result to read. The same session and read-only transaction must be used by // the PartitionReadRequest used to create the partition tokens and the - // ReadRequests that use the partition tokens. + // ReadRequests that use the partition tokens. There are no ordering + // guarantees on rows returned among the returned partition tokens, or even + // within each individual StreamingRead call issued with a partition_token. + // // Partition tokens become invalid when the session used to create them - // is deleted or begins a new transaction. + // is deleted, is idle for too long, begins a new transaction, or becomes too + // old. When any of these happen, it is not possible to resume the read, and + // the whole operation must be restarted from the beginning. rpc PartitionRead(PartitionReadRequest) returns (PartitionResponse) { option (google.api.http) = { post: "/v1/{session=projects/*/instances/*/databases/*/sessions/*}:partitionRead" @@ -309,18 +317,17 @@ message DeleteSessionRequest { // The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and // [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]. message ExecuteSqlRequest { - // Mode in which the query must be processed. + // Mode in which the statement must be processed. enum QueryMode { - // The default mode where only the query result, without any information - // about the query plan is returned. + // The default mode. Only the statement results are returned. NORMAL = 0; - // This mode returns only the query plan, without any result rows or + // This mode returns only the query plan, without any results or // execution statistics information. PLAN = 1; // This mode returns both the query plan and the execution statistics along - // with the result rows. + // with the results. PROFILE = 2; } @@ -329,12 +336,23 @@ message ExecuteSqlRequest { // The transaction to use. If none is provided, the default is a // temporary read-only transaction with strong concurrency. + // + // The transaction to use. + // + // For queries, if none is provided, the default is a temporary read-only + // transaction with strong concurrency. + // + // Standard DML statements require a ReadWrite transaction. Single-use + // transactions are not supported (to avoid replay). The caller must + // either supply an existing transaction ID or begin a new transaction. + // + // Partitioned DML requires an existing PartitionedDml transaction ID. TransactionSelector transaction = 2; - // Required. The SQL query string. + // Required. The SQL string. string sql = 3; - // The SQL query string can contain parameter placeholders. A parameter + // The SQL string can contain parameter placeholders. A parameter // placeholder consists of `'@'` followed by the parameter // name. Parameter names consist of any combination of letters, // numbers, and underscores. @@ -343,7 +361,7 @@ message ExecuteSqlRequest { // parameter name can be used more than once, for example: // `"WHERE id > @msg_id AND id < @msg_id + 100"` // - // It is an error to execute an SQL query with unbound parameters. + // It is an error to execute an SQL statement with unbound parameters. // // Parameter values are specified using `params`, which is a JSON // object whose keys are parameter names, and whose values are the @@ -355,15 +373,15 @@ message ExecuteSqlRequest { // of type `STRING` both appear in [params][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. // // In these cases, `param_types` can be used to specify the exact - // SQL type for some or all of the SQL query parameters. See the + // SQL type for some or all of the SQL statement parameters. See the // definition of [Type][google.spanner.v1.Type] for more information // about SQL types. mapparam_types = 5; - // If this request is resuming a previously interrupted SQL query + // If this request is resuming a previously interrupted SQL statement // execution, `resume_token` should be copied from the last // [PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the interruption. Doing this - // enables the new SQL query execution to resume where the last one left + // enables the new SQL statement execution to resume where the last one left // off. The rest of the request parameters must exactly match the // request that yielded this token. bytes resume_token = 6; @@ -378,6 +396,18 @@ message ExecuteSqlRequest { // match for the values of fields common to this message and the // PartitionQueryRequest message used to create this partition_token. bytes partition_token = 8; + + // A per-transaction sequence number used to identify this request. This + // makes each request idempotent such that if the request is received multiple + // times, at most one will succeed. + // + // The sequence number must be monotonically increasing within the + // transaction. If a request arrives for the first time with an out-of-order + // sequence number, the transaction may be aborted. Replays of previously + // handled requests will yield the same response as the first execution. + // + // Required for DML statements. Ignored for queries. + int64 seqno = 9; } // Options for a PartitionQueryRequest and @@ -417,6 +447,10 @@ message PartitionQueryRequest { // union operator conceptually divides one or more tables into multiple // splits, remotely evaluates a subquery independently on each split, and // then unions all results. + // + // This must not contain DML commands, such as INSERT, UPDATE, or + // DELETE. Use [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] with a + // PartitionedDml transaction for large, partition-friendly DML operations. string sql = 3; // The SQL query string can contain parameter placeholders. A parameter diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto index d4eb7f9565a5..e7fafc0e7655 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/transaction.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. @@ -38,7 +38,7 @@ option php_namespace = "Google\\Cloud\\Spanner\\V1"; // // # Transaction Modes // -// Cloud Spanner supports two transaction modes: +// Cloud Spanner supports three transaction modes: // // 1. Locking read-write. This type of transaction is the only way // to write data into Cloud Spanner. These transactions rely on @@ -52,6 +52,13 @@ option php_namespace = "Google\\Cloud\\Spanner\\V1"; // read at timestamps in the past. Snapshot read-only // transactions do not need to be committed. // +// 3. Partitioned DML. This type of transaction is used to execute +// a single Partitioned DML statement. Partitioned DML partitions +// the key space and runs the DML statement over each partition +// in parallel using separate, internal transactions that commit +// independently. Partitioned DML transactions do not need to be +// committed. +// // For transactions that only read, snapshot read-only transactions // provide simpler semantics and are almost always faster. In // particular, read-only transactions do not take locks, so they do @@ -78,11 +85,8 @@ option php_namespace = "Google\\Cloud\\Spanner\\V1"; // inactivity at the client may cause Cloud Spanner to release a // transaction's locks and abort it. // -// Reads performed within a transaction acquire locks on the data -// being read. Writes can only be done at commit time, after all reads -// have been completed. // Conceptually, a read-write transaction consists of zero or more -// reads or SQL queries followed by +// reads or SQL statements followed by // [Commit][google.spanner.v1.Spanner.Commit]. At any time before // [Commit][google.spanner.v1.Spanner.Commit], the client can send a // [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the @@ -245,6 +249,62 @@ option php_namespace = "Google\\Cloud\\Spanner\\V1"; // restriction also applies to in-progress reads and/or SQL queries whose // timestamp become too old while executing. Reads and SQL queries with // too-old read timestamps fail with the error `FAILED_PRECONDITION`. +// +// ## Partitioned DML Transactions +// +// Partitioned DML transactions are used to execute DML statements with a +// different execution strategy that provides different, and often better, +// scalability properties for large, table-wide operations than DML in a +// ReadWrite transaction. Smaller scoped statements, such as an OLTP workload, +// should prefer using ReadWrite transactions. +// +// Partitioned DML partitions the keyspace and runs the DML statement on each +// partition in separate, internal transactions. These transactions commit +// automatically when complete, and run independently from one another. +// +// To reduce lock contention, this execution strategy only acquires read locks +// on rows that match the WHERE clause of the statement. Additionally, the +// smaller per-partition transactions hold locks for less time. +// +// That said, Partitioned DML is not a drop-in replacement for standard DML used +// in ReadWrite transactions. +// +// - The DML statement must be fully-partitionable. Specifically, the statement +// must be expressible as the union of many statements which each access only +// a single row of the table. +// +// - The statement is not applied atomically to all rows of the table. Rather, +// the statement is applied atomically to partitions of the table, in +// independent transactions. Secondary index rows are updated atomically +// with the base table rows. +// +// - Partitioned DML does not guarantee exactly-once execution semantics +// against a partition. The statement will be applied at least once to each +// partition. It is strongly recommended that the DML statement should be +// idempotent to avoid unexpected results. For instance, it is potentially +// dangerous to run a statement such as +// `UPDATE table SET column = column + 1` as it could be run multiple times +// against some rows. +// +// - The partitions are committed automatically - there is no support for +// Commit or Rollback. If the call returns an error, or if the client issuing +// the ExecuteSql call dies, it is possible that some rows had the statement +// executed on them successfully. It is also possible that statement was +// never executed against other rows. +// +// - Partitioned DML transactions may only contain the execution of a single +// DML statement via ExecuteSql or ExecuteStreamingSql. +// +// - If any error is encountered during the execution of the partitioned DML +// operation (for instance, a UNIQUE INDEX violation, division by zero, or a +// value that cannot be stored due to schema constraints), then the +// operation is stopped at that point and an error is returned. It is +// possible that at this point, some partitions have been committed (or even +// committed multiple times), and other partitions have not been run at all. +// +// Given the above, Partitioned DML is good fit for large, database-wide, +// operations that are idempotent, such as deleting old rows from a very large +// table. message TransactionOptions { // Message type to initiate a read-write transaction. Currently this // transaction type has no options. @@ -252,6 +312,11 @@ message TransactionOptions { } + // Message type to initiate a Partitioned DML transaction. + message PartitionedDml { + + } + // Message type to initiate a read-only transaction. message ReadOnly { // How to choose the timestamp for the read-only transaction. @@ -329,6 +394,13 @@ message TransactionOptions { // on the `session` resource. ReadWrite read_write = 1; + // Partitioned DML transaction. + // + // Authorization to begin a Partitioned DML transaction requires + // `spanner.databases.beginPartitionedDmlTransaction` permission + // on the `session` resource. + PartitionedDml partitioned_dml = 3; + // Transaction will not write. // // Authorization to begin a read-only transaction requires diff --git a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto index 048cc0b076ec..de5203dd5f9f 100644 --- a/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.proto +++ b/google-api-grpc/proto-google-cloud-spanner-v1/src/main/proto/google/spanner/v1/type.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. diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java index 844f33a1f9e3..652a428be167 100644 --- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java @@ -636,7 +636,7 @@ private static Builder initDefaults(Builder builder) { builder .deleteInstanceSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder @@ -661,7 +661,7 @@ private static Builder initDefaults(Builder builder) { builder .deleteClusterSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder diff --git a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java index 3ce8c07eb061..ad6034d6c922 100644 --- a/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable-admin/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStubSettings.java @@ -484,28 +484,6 @@ public static class Builder .setTotalTimeout(Duration.ofMillis(600000L)) .build(); definitions.put("default", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(130000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(130000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) - .build(); - definitions.put("create_table", settings); - settings = - RetrySettings.newBuilder() - .setInitialRetryDelay(Duration.ofMillis(100L)) - .setRetryDelayMultiplier(1.3) - .setMaxRetryDelay(Duration.ofMillis(60000L)) - .setInitialRpcTimeout(Duration.ofMillis(900000L)) - .setRpcTimeoutMultiplier(1.0) - .setMaxRpcTimeout(Duration.ofMillis(900000L)) - .setTotalTimeout(Duration.ofMillis(3600000L)) - .build(); - definitions.put("drop_row_range", settings); RETRY_PARAM_DEFINITIONS = definitions.build(); } @@ -579,7 +557,7 @@ private static Builder initDefaults(Builder builder) { builder .createTableSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("create_table")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .createTableFromSnapshotSettings() @@ -598,7 +576,7 @@ private static Builder initDefaults(Builder builder) { builder .deleteTableSettings() - .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder @@ -609,7 +587,7 @@ private static Builder initDefaults(Builder builder) { builder .dropRowRangeSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) - .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("drop_row_range")); + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); builder .generateConsistencyTokenSettings() diff --git a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java index 9289801b5444..5a2a03039fb3 100644 --- a/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java +++ b/google-cloud-clients/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java @@ -309,11 +309,26 @@ private static Builder createDefault() { private static Builder initDefaults(Builder builder) { + builder + .readRowsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("streaming")); + + builder + .sampleRowKeysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .mutateRowSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .mutateRowsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder .checkAndMutateRowSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java new file mode 100644 index 000000000000..f07fa8298d50 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceClient.java @@ -0,0 +1,347 @@ +/* + * 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.asset.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1beta1.stub.AssetServiceStub; +import com.google.cloud.asset.v1beta1.stub.AssetServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Asset service definition. + * + * 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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED; + * TimeWindow readTimeWindow = TimeWindow.newBuilder().build(); + * BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() + * .setParent(parent.toString()) + * .setContentType(contentType) + * .setReadTimeWindow(readTimeWindow) + * .build(); + * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); + * } + *
+ *Note: close() needs to be called on the assetServiceClient 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: + * + *
+ *
+ * + *- 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. + *
- 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. + *
- 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 AssetServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
+ *+ * + * To customize the endpoint: + * + *+ * AssetServiceSettings assetServiceSettings = + * AssetServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * AssetServiceClient assetServiceClient = + * AssetServiceClient.create(assetServiceSettings); + *
+ *+ *+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssetServiceClient implements BackgroundResource { + private final AssetServiceSettings settings; + private final AssetServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AssetServiceClient with default settings. */ + public static final AssetServiceClient create() throws IOException { + return create(AssetServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AssetServiceClient, 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 AssetServiceClient create(AssetServiceSettings settings) throws IOException { + return new AssetServiceClient(settings); + } + + /** + * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer to use AssetServiceSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AssetServiceClient create(AssetServiceStub stub) { + return new AssetServiceClient(stub); + } + + /** + * Constructs an instance of AssetServiceClient, 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 AssetServiceClient(AssetServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AssetServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AssetServiceClient(AssetServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AssetServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports assets with time and resource types to a given Google Cloud Storage location. The + * output format is newline-delimited JSON. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API allowing users to keep track + * of the export. + * + *+ * AssetServiceSettings assetServiceSettings = + * AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * AssetServiceClient assetServiceClient = + * AssetServiceClient.create(assetServiceSettings); + *
+ *Sample code: + * + *
+ * + * @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 + */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public final OperationFuture+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportAssetsRequest request = ExportAssetsRequest.newBuilder() + * .setParent(parent.toString()) + * .setOutputConfig(outputConfig) + * .build(); + * ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get(); + * } + *
exportAssetsAsync( + ExportAssetsRequest request) { + return exportAssetsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports assets with time and resource types to a given Google Cloud Storage location. The + * output format is newline-delimited JSON. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API allowing users to keep track + * of the export. + * + * Sample code: + * + *
+ */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public final OperationCallable+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportAssetsRequest request = ExportAssetsRequest.newBuilder() + * .setParent(parent.toString()) + * .setOutputConfig(outputConfig) + * .build(); + * OperationFuture<Operation> future = assetServiceClient.exportAssetsOperationCallable().futureCall(request); + * // Do something + * ExportAssetsResponse response = future.get(); + * } + *
+ exportAssetsOperationCallable() { + return stub.exportAssetsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Exports assets with time and resource types to a given Google Cloud Storage location. The + * output format is newline-delimited JSON. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API allowing users to keep track + * of the export. + * + * Sample code: + * + *
+ */ + public final UnaryCallable+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * OutputConfig outputConfig = OutputConfig.newBuilder().build(); + * ExportAssetsRequest request = ExportAssetsRequest.newBuilder() + * .setParent(parent.toString()) + * .setOutputConfig(outputConfig) + * .build(); + * ApiFuture<Operation> future = assetServiceClient.exportAssetsCallable().futureCall(request); + * // Do something + * Operation response = future.get(); + * } + *
exportAssetsCallable() { + return stub.exportAssetsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Batch gets assets update history that overlaps a time window. For RESOURCE content, this API + * outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this + * API only outputs history when asset and its attached IAM POLICY both exist. So there may be + * gaps in the output history. + * + * Sample code: + * + *
+ * + * @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 BatchGetAssetsHistoryResponse batchGetAssetsHistory( + BatchGetAssetsHistoryRequest request) { + return batchGetAssetsHistoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Batch gets assets update history that overlaps a time window. For RESOURCE content, this API + * outputs history with asset in both non-delete or deleted status. For IAM_POLICY content, this + * API only outputs history when asset and its attached IAM POLICY both exist. So there may be + * gaps in the output history. + * + *+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED; + * TimeWindow readTimeWindow = TimeWindow.newBuilder().build(); + * BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() + * .setParent(parent.toString()) + * .setContentType(contentType) + * .setReadTimeWindow(readTimeWindow) + * .build(); + * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); + * } + *
Sample code: + * + *
+ */ + public final UnaryCallable+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED; + * TimeWindow readTimeWindow = TimeWindow.newBuilder().build(); + * BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() + * .setParent(parent.toString()) + * .setContentType(contentType) + * .setReadTimeWindow(readTimeWindow) + * .build(); + * ApiFuture<BatchGetAssetsHistoryResponse> future = assetServiceClient.batchGetAssetsHistoryCallable().futureCall(request); + * // Do something + * BatchGetAssetsHistoryResponse response = future.get(); + * } + *
+ batchGetAssetsHistoryCallable() { + return stub.batchGetAssetsHistoryCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java new file mode 100644 index 000000000000..6f14f233dcf7 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/AssetServiceSettings.java @@ -0,0 +1,205 @@ +/* + * 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.asset.v1beta1; + +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.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.asset.v1beta1.stub.AssetServiceStubSettings; +import com.google.longrunning.Operation; +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 AssetServiceClient}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (cloudasset.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 batchGetAssetsHistory to 30 seconds: + * + *
+ *+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssetServiceSettings extends ClientSettings+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = + * AssetServiceSettings.newBuilder(); + * assetServiceSettingsBuilder.batchGetAssetsHistorySettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)); + * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); + *
+ *{ + /** Returns the object with the settings used for calls to exportAssets. */ + public UnaryCallSettings exportAssetsSettings() { + return ((AssetServiceStubSettings) getStubSettings()).exportAssetsSettings(); + } + + /** Returns the object with the settings used for calls to exportAssets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings + exportAssetsOperationSettings() { + return ((AssetServiceStubSettings) getStubSettings()).exportAssetsOperationSettings(); + } + + /** Returns the object with the settings used for calls to batchGetAssetsHistory. */ + public UnaryCallSettings + batchGetAssetsHistorySettings() { + return ((AssetServiceStubSettings) getStubSettings()).batchGetAssetsHistorySettings(); + } + + public static final AssetServiceSettings create(AssetServiceStubSettings stub) + throws IOException { + return new AssetServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AssetServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AssetServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AssetServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AssetServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AssetServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AssetServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AssetServiceStubSettings.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 AssetServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AssetServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(AssetServiceStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + + protected Builder(AssetServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AssetServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AssetServiceStubSettings.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 exportAssets. */ + public UnaryCallSettings.Builder exportAssetsSettings() { + return getStubSettingsBuilder().exportAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings() { + return getStubSettingsBuilder().exportAssetsOperationSettings(); + } + + /** Returns the builder for the settings used for calls to batchGetAssetsHistory. */ + public UnaryCallSettings.Builder + batchGetAssetsHistorySettings() { + return getStubSettingsBuilder().batchGetAssetsHistorySettings(); + } + + @Override + public AssetServiceSettings build() throws IOException { + return new AssetServiceSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java new file mode 100644 index 000000000000..702ff114f979 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/package-info.java @@ -0,0 +1,44 @@ +/* + * 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 Cloud Asset API. + * + * The interfaces provided are listed below, along with usage samples. + * + *
================== AssetServiceClient ================== + * + *
Service Description: Asset service definition. + * + *
Sample for AssetServiceClient: + * + *
+ *+ */ +package com.google.cloud.asset.v1beta1; diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java new file mode 100644 index 000000000000..4a89a94337ad --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStub.java @@ -0,0 +1,62 @@ +/* + * 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.asset.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1beta1.ExportAssetsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Asset API. + * + *+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ProjectName parent = ProjectName.of("[PROJECT]"); + * ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED; + * TimeWindow readTimeWindow = TimeWindow.newBuilder().build(); + * BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() + * .setParent(parent.toString()) + * .setContentType(contentType) + * .setReadTimeWindow(readTimeWindow) + * .build(); + * BatchGetAssetsHistoryResponse response = assetServiceClient.batchGetAssetsHistory(request); + * } + *
+ *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 AssetServiceStub implements BackgroundResource { + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable
+ exportAssetsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportAssetsOperationCallable()"); + } + + public UnaryCallable exportAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: exportAssetsCallable()"); + } + + public UnaryCallable + batchGetAssetsHistoryCallable() { + throw new UnsupportedOperationException("Not implemented: batchGetAssetsHistoryCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java new file mode 100644 index 000000000000..72cdb5736e06 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/AssetServiceStubSettings.java @@ -0,0 +1,348 @@ +/* + * 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.asset.v1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +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.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1beta1.ExportAssetsResponse; +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.longrunning.Operation; +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 AssetServiceStub}. + * + * The default instance has everything set to sensible defaults: + * + *
+ *
+ * + *- The default service address (cloudasset.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 batchGetAssetsHistory to 30 seconds: + * + *
+ *+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssetServiceStubSettings extends StubSettings+ * AssetServiceStubSettings.Builder assetServiceSettingsBuilder = + * AssetServiceStubSettings.newBuilder(); + * assetServiceSettingsBuilder.batchGetAssetsHistorySettings().getRetrySettings().toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)); + * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build(); + *
+ *{ + /** 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 exportAssetsSettings; + private final OperationCallSettings< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings; + private final UnaryCallSettings + batchGetAssetsHistorySettings; + + /** Returns the object with the settings used for calls to exportAssets. */ + public UnaryCallSettings exportAssetsSettings() { + return exportAssetsSettings; + } + + /** Returns the object with the settings used for calls to exportAssets. */ + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings + exportAssetsOperationSettings() { + return exportAssetsOperationSettings; + } + + /** Returns the object with the settings used for calls to batchGetAssetsHistory. */ + public UnaryCallSettings + batchGetAssetsHistorySettings() { + return batchGetAssetsHistorySettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAssetServiceStub.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 "cloudasset.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(AssetServiceStubSettings.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 AssetServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + exportAssetsSettings = settingsBuilder.exportAssetsSettings().build(); + exportAssetsOperationSettings = settingsBuilder.exportAssetsOperationSettings().build(); + batchGetAssetsHistorySettings = settingsBuilder.batchGetAssetsHistorySettings().build(); + } + + /** Builder for AssetServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList > unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder exportAssetsSettings; + private final OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings; + private final UnaryCallSettings.Builder< + BatchGetAssetsHistoryRequest, BatchGetAssetsHistoryResponse> + batchGetAssetsHistorySettings; + + 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); + + exportAssetsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + exportAssetsOperationSettings = OperationCallSettings.newBuilder(); + + batchGetAssetsHistorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList. >of( + exportAssetsSettings, batchGetAssetsHistorySettings); + + 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 + .exportAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .batchGetAssetsHistorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .exportAssetsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + . newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ExportAssetsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ExportAssetsRequest.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(500L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setInitialRpcTimeout(Duration.ZERO) // ignored + .setRpcTimeoutMultiplier(1.0) // ignored + .setMaxRpcTimeout(Duration.ZERO) // ignored + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + exportAssetsSettings = settings.exportAssetsSettings.toBuilder(); + exportAssetsOperationSettings = settings.exportAssetsOperationSettings.toBuilder(); + batchGetAssetsHistorySettings = settings.batchGetAssetsHistorySettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList. >of( + exportAssetsSettings, batchGetAssetsHistorySettings); + } + + // 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 exportAssets. */ + public UnaryCallSettings.Builder exportAssetsSettings() { + return exportAssetsSettings; + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings() { + return exportAssetsOperationSettings; + } + + /** Returns the builder for the settings used for calls to batchGetAssetsHistory. */ + public UnaryCallSettings.Builder + batchGetAssetsHistorySettings() { + return batchGetAssetsHistorySettings; + } + + @Override + public AssetServiceStubSettings build() throws IOException { + return new AssetServiceStubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.java new file mode 100644 index 000000000000..2125334ffed0 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceCallableFactory.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.asset.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 Cloud Asset 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 GrpcAssetServiceCallableFactory 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-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java new file mode 100644 index 000000000000..e459d1062248 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/main/java/com/google/cloud/asset/v1beta1/stub/GrpcAssetServiceStub.java @@ -0,0 +1,194 @@ +/* + * 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.asset.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryRequest; +import com.google.cloud.asset.v1beta1.BatchGetAssetsHistoryResponse; +import com.google.cloud.asset.v1beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1beta1.ExportAssetsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +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 Cloud Asset 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 GrpcAssetServiceStub extends AssetServiceStub { + + private static final MethodDescriptor
+ exportAssetsMethodDescriptor = + MethodDescriptor. newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1beta1.AssetService/ExportAssets") + .setRequestMarshaller(ProtoUtils.marshaller(ExportAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + private static final MethodDescriptor + batchGetAssetsHistoryMethodDescriptor = + MethodDescriptor. newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1beta1.AssetService/BatchGetAssetsHistory") + .setRequestMarshaller( + ProtoUtils.marshaller(BatchGetAssetsHistoryRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(BatchGetAssetsHistoryResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + + private final UnaryCallable exportAssetsCallable; + private final OperationCallable + exportAssetsOperationCallable; + private final UnaryCallable + batchGetAssetsHistoryCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) + throws IOException { + return new GrpcAssetServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAssetServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcAssetServiceStub(AssetServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAssetServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAssetServiceStub( + AssetServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAssetServiceStub, 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 GrpcAssetServiceStub(AssetServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAssetServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAssetServiceStub, 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 GrpcAssetServiceStub( + AssetServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings exportAssetsTransportSettings = + GrpcCallSettings. newBuilder() + .setMethodDescriptor(exportAssetsMethodDescriptor) + .build(); + GrpcCallSettings + batchGetAssetsHistoryTransportSettings = + GrpcCallSettings + . newBuilder() + .setMethodDescriptor(batchGetAssetsHistoryMethodDescriptor) + .build(); + + this.exportAssetsCallable = + callableFactory.createUnaryCallable( + exportAssetsTransportSettings, settings.exportAssetsSettings(), clientContext); + this.exportAssetsOperationCallable = + callableFactory.createOperationCallable( + exportAssetsTransportSettings, + settings.exportAssetsOperationSettings(), + clientContext, + this.operationsStub); + this.batchGetAssetsHistoryCallable = + callableFactory.createUnaryCallable( + batchGetAssetsHistoryTransportSettings, + settings.batchGetAssetsHistorySettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallable + exportAssetsOperationCallable() { + return exportAssetsOperationCallable; + } + + public UnaryCallable exportAssetsCallable() { + return exportAssetsCallable; + } + + public UnaryCallable + batchGetAssetsHistoryCallable() { + return batchGetAssetsHistoryCallable; + } + + @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-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/AssetServiceClientTest.java b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/AssetServiceClientTest.java new file mode 100644 index 000000000000..0b44b0f28d1a --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/AssetServiceClientTest.java @@ -0,0 +1,65 @@ +/* + * 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.asset.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +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 java.io.IOException; +import java.util.Arrays; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; + +@javax.annotation.Generated("by GAPIC") +public class AssetServiceClientTest { + private static MockAssetService mockAssetService; + private static MockServiceHelper serviceHelper; + private AssetServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAssetService = new MockAssetService(); + serviceHelper = + new MockServiceHelper("in-process-1", Arrays. asList(mockAssetService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AssetServiceSettings settings = + AssetServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AssetServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } +} diff --git a/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetService.java b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetService.java new file mode 100644 index 000000000000..40378803e631 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetService.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.asset.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 MockAssetService implements MockGrpcService { + private final MockAssetServiceImpl serviceImpl; + + public MockAssetService() { + serviceImpl = new MockAssetServiceImpl(); + } + + @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-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetServiceImpl.java b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetServiceImpl.java new file mode 100644 index 000000000000..0e8d5a260f63 --- /dev/null +++ b/google-cloud-clients/google-cloud-cloudasset/src/test/java/com/google/cloud/asset/v1beta1/MockAssetServiceImpl.java @@ -0,0 +1,90 @@ +/* + * 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.asset.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.asset.v1beta1.AssetServiceGrpc.AssetServiceImplBase; +import com.google.longrunning.Operation; +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 MockAssetServiceImpl extends AssetServiceImplBase { + private ArrayList requests; + private Queue