From 8bfe33e2d282dc656c9d69630c54d57c14e5d4cf Mon Sep 17 00:00:00 2001 From: Nex Zhu <4370605+NexZhu@users.noreply.github.com> Date: Mon, 14 Nov 2022 15:40:02 +0800 Subject: [PATCH] feat: update to latest API --- README.md | 2 +- api | 2 +- build.gradle | 2 +- .../java/com/google/api/AnnotationsProto.java | 63 + .../com/google/api/CustomHttpPattern.java | 759 ++++ .../api/CustomHttpPatternOrBuilder.java | 49 + src/main/java/com/google/api/Http.java | 994 ++++++ src/main/java/com/google/api/HttpBody.java | 1199 +++++++ .../com/google/api/HttpBodyOrBuilder.java | 88 + .../java/com/google/api/HttpBodyProto.java | 54 + .../java/com/google/api/HttpOrBuilder.java | 72 + src/main/java/com/google/api/HttpProto.java | 81 + src/main/java/com/google/api/HttpRule.java | 3134 +++++++++++++++++ .../com/google/api/HttpRuleOrBuilder.java | 273 ++ src/main/java/com/google/rpc/BadRequest.java | 1688 +++++++++ .../com/google/rpc/BadRequestOrBuilder.java | 53 + src/main/java/com/google/rpc/Code.java | 550 +++ src/main/java/com/google/rpc/CodeProto.java | 46 + src/main/java/com/google/rpc/DebugInfo.java | 840 +++++ .../com/google/rpc/DebugInfoOrBuilder.java | 70 + .../com/google/rpc/ErrorDetailsProto.java | 205 ++ src/main/java/com/google/rpc/Help.java | 1674 +++++++++ .../java/com/google/rpc/HelpOrBuilder.java | 53 + .../java/com/google/rpc/LocalizedMessage.java | 775 ++++ .../google/rpc/LocalizedMessageOrBuilder.java | 53 + .../com/google/rpc/PreconditionFailure.java | 1914 ++++++++++ .../rpc/PreconditionFailureOrBuilder.java | 53 + .../java/com/google/rpc/QuotaFailure.java | 1749 +++++++++ .../com/google/rpc/QuotaFailureOrBuilder.java | 53 + src/main/java/com/google/rpc/RequestInfo.java | 775 ++++ .../com/google/rpc/RequestInfoOrBuilder.java | 53 + .../java/com/google/rpc/ResourceInfo.java | 1147 ++++++ .../com/google/rpc/ResourceInfoOrBuilder.java | 105 + src/main/java/com/google/rpc/RetryInfo.java | 683 ++++ .../com/google/rpc/RetryInfoOrBuilder.java | 36 + src/main/java/com/google/rpc/Status.java | 1229 +++++++ .../java/com/google/rpc/StatusOrBuilder.java | 92 + src/main/java/com/google/rpc/StatusProto.java | 54 + .../bdledger/api/grpc/pb/CommonProto.java | 382 +- .../bdledger/api/grpc/pb/LedgerGrpc.java | 46 +- .../bdledger/api/grpc/pb/LedgerProto.java | 416 +++ .../bdware/bdledger/api/grpc/pb/NodeGrpc.java | 26 +- .../bdledger/api/grpc/pb/NodeProto.java | 9 + .../bdledger/api/grpc/pb/QueryGrpc.java | 180 +- .../bdledger/api/grpc/pb/QueryProto.java | 1563 +++++++- .../bdware/bdledger/api/grpc/ClientTests.java | 8 +- .../org/bdware/bdledger/api/grpc/Test.java | 30 + 47 files changed, 23152 insertions(+), 230 deletions(-) create mode 100644 src/main/java/com/google/api/AnnotationsProto.java create mode 100644 src/main/java/com/google/api/CustomHttpPattern.java create mode 100644 src/main/java/com/google/api/CustomHttpPatternOrBuilder.java create mode 100644 src/main/java/com/google/api/Http.java create mode 100644 src/main/java/com/google/api/HttpBody.java create mode 100644 src/main/java/com/google/api/HttpBodyOrBuilder.java create mode 100644 src/main/java/com/google/api/HttpBodyProto.java create mode 100644 src/main/java/com/google/api/HttpOrBuilder.java create mode 100644 src/main/java/com/google/api/HttpProto.java create mode 100644 src/main/java/com/google/api/HttpRule.java create mode 100644 src/main/java/com/google/api/HttpRuleOrBuilder.java create mode 100644 src/main/java/com/google/rpc/BadRequest.java create mode 100644 src/main/java/com/google/rpc/BadRequestOrBuilder.java create mode 100644 src/main/java/com/google/rpc/Code.java create mode 100644 src/main/java/com/google/rpc/CodeProto.java create mode 100644 src/main/java/com/google/rpc/DebugInfo.java create mode 100644 src/main/java/com/google/rpc/DebugInfoOrBuilder.java create mode 100644 src/main/java/com/google/rpc/ErrorDetailsProto.java create mode 100644 src/main/java/com/google/rpc/Help.java create mode 100644 src/main/java/com/google/rpc/HelpOrBuilder.java create mode 100644 src/main/java/com/google/rpc/LocalizedMessage.java create mode 100644 src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java create mode 100644 src/main/java/com/google/rpc/PreconditionFailure.java create mode 100644 src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java create mode 100644 src/main/java/com/google/rpc/QuotaFailure.java create mode 100644 src/main/java/com/google/rpc/QuotaFailureOrBuilder.java create mode 100644 src/main/java/com/google/rpc/RequestInfo.java create mode 100644 src/main/java/com/google/rpc/RequestInfoOrBuilder.java create mode 100644 src/main/java/com/google/rpc/ResourceInfo.java create mode 100644 src/main/java/com/google/rpc/ResourceInfoOrBuilder.java create mode 100644 src/main/java/com/google/rpc/RetryInfo.java create mode 100644 src/main/java/com/google/rpc/RetryInfoOrBuilder.java create mode 100644 src/main/java/com/google/rpc/Status.java create mode 100644 src/main/java/com/google/rpc/StatusOrBuilder.java create mode 100644 src/main/java/com/google/rpc/StatusProto.java create mode 100644 src/test/java/org/bdware/bdledger/api/grpc/Test.java diff --git a/README.md b/README.md index 6a7d187..3a4438b 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ with **Maven** ## Distributing ``` -./gradlew jar +./gradlew jar ./gradlew shadowJar ./gradlew javadoc ./gradlew installDist diff --git a/api b/api index 0845a71..b74f3fe 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 0845a71abad8aee67f858f491c715e4a24106865 +Subproject commit b74f3fe89c63fe5ed75b0111f3fb71ec0cf86a2d diff --git a/build.gradle b/build.gradle index 6d5c7a7..47aee1a 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ plugins { } group 'org.bdware' -version 'dev-200922.1278255c' +version 'dev-221113' sourceCompatibility = JavaVersion.VERSION_1_8 diff --git a/src/main/java/com/google/api/AnnotationsProto.java b/src/main/java/com/google/api/AnnotationsProto.java new file mode 100644 index 0000000..5b0494a --- /dev/null +++ b/src/main/java/com/google/api/AnnotationsProto.java @@ -0,0 +1,63 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/annotations.proto + +package com.google.api; + +public final class AnnotationsProto { + private AnnotationsProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + registry.add(com.google.api.AnnotationsProto.http); + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public static final int HTTP_FIELD_NUMBER = 72295728; + /** + *
+   * See `HttpRule`.
+   * 
+ * + * extend .google.protobuf.MethodOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.MethodOptions, + com.google.api.HttpRule> http = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + com.google.api.HttpRule.class, + com.google.api.HttpRule.getDefaultInstance()); + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\034google/api/annotations.proto\022\ngoogle.a" + + "pi\032\025google/api/http.proto\032 google/protob" + + "uf/descriptor.proto:E\n\004http\022\036.google.pro" + + "tobuf.MethodOptions\030\260\312\274\" \001(\0132\024.google.ap" + + "i.HttpRuleBn\n\016com.google.apiB\020Annotation" + + "sProtoP\001ZAgoogle.golang.org/genproto/goo" + + "gleapis/api/annotations;annotations\242\002\004GA" + + "PIb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.HttpProto.getDescriptor(), + com.google.protobuf.DescriptorProtos.getDescriptor(), + }); + http.internalInit(descriptor.getExtensions().get(0)); + com.google.api.HttpProto.getDescriptor(); + com.google.protobuf.DescriptorProtos.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/api/CustomHttpPattern.java b/src/main/java/com/google/api/CustomHttpPattern.java new file mode 100644 index 0000000..a2f9edb --- /dev/null +++ b/src/main/java/com/google/api/CustomHttpPattern.java @@ -0,0 +1,759 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +/** + *
+ * A custom pattern is used for defining custom HTTP verb.
+ * 
+ * + * Protobuf type {@code google.api.CustomHttpPattern} + */ +public final class CustomHttpPattern extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.api.CustomHttpPattern) + CustomHttpPatternOrBuilder { +private static final long serialVersionUID = 0L; + // Use CustomHttpPattern.newBuilder() to construct. + private CustomHttpPattern(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CustomHttpPattern() { + kind_ = ""; + path_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CustomHttpPattern(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CustomHttpPattern( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + kind_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + path_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.api.HttpProto.internal_static_google_api_CustomHttpPattern_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.CustomHttpPattern.class, com.google.api.CustomHttpPattern.Builder.class); + } + + public static final int KIND_FIELD_NUMBER = 1; + private volatile java.lang.Object kind_; + /** + *
+   * The name of this custom HTTP verb.
+   * 
+ * + * string kind = 1; + * @return The kind. + */ + @java.lang.Override + public java.lang.String getKind() { + java.lang.Object ref = kind_; + 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(); + kind_ = s; + return s; + } + } + /** + *
+   * The name of this custom HTTP verb.
+   * 
+ * + * string kind = 1; + * @return The bytes for kind. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATH_FIELD_NUMBER = 2; + private volatile java.lang.Object path_; + /** + *
+   * The path matched by this custom verb.
+   * 
+ * + * string path = 2; + * @return The path. + */ + @java.lang.Override + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } + } + /** + *
+   * The path matched by this custom verb.
+   * 
+ * + * string path = 2; + * @return The bytes for path. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getKindBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kind_); + } + if (!getPathBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, path_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKindBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kind_); + } + if (!getPathBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, path_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.api.CustomHttpPattern)) { + return super.equals(obj); + } + com.google.api.CustomHttpPattern other = (com.google.api.CustomHttpPattern) obj; + + if (!getKind() + .equals(other.getKind())) return false; + if (!getPath() + .equals(other.getPath())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KIND_FIELD_NUMBER; + hash = (53 * hash) + getKind().hashCode(); + hash = (37 * hash) + PATH_FIELD_NUMBER; + hash = (53 * hash) + getPath().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.CustomHttpPattern parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.CustomHttpPattern parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.CustomHttpPattern parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.CustomHttpPattern 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.api.CustomHttpPattern parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.CustomHttpPattern parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.CustomHttpPattern parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.CustomHttpPattern 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.api.CustomHttpPattern parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.api.CustomHttpPattern 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.api.CustomHttpPattern parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.CustomHttpPattern 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.api.CustomHttpPattern 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 custom pattern is used for defining custom HTTP verb.
+   * 
+ * + * Protobuf type {@code google.api.CustomHttpPattern} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.api.CustomHttpPattern) + com.google.api.CustomHttpPatternOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.CustomHttpPattern.class, com.google.api.CustomHttpPattern.Builder.class); + } + + // Construct using com.google.api.CustomHttpPattern.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + kind_ = ""; + + path_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.api.HttpProto.internal_static_google_api_CustomHttpPattern_descriptor; + } + + @java.lang.Override + public com.google.api.CustomHttpPattern getDefaultInstanceForType() { + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.CustomHttpPattern build() { + com.google.api.CustomHttpPattern result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.CustomHttpPattern buildPartial() { + com.google.api.CustomHttpPattern result = new com.google.api.CustomHttpPattern(this); + result.kind_ = kind_; + result.path_ = path_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.CustomHttpPattern) { + return mergeFrom((com.google.api.CustomHttpPattern)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.CustomHttpPattern other) { + if (other == com.google.api.CustomHttpPattern.getDefaultInstance()) return this; + if (!other.getKind().isEmpty()) { + kind_ = other.kind_; + onChanged(); + } + if (!other.getPath().isEmpty()) { + path_ = other.path_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.CustomHttpPattern parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.CustomHttpPattern) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kind_ = ""; + /** + *
+     * The name of this custom HTTP verb.
+     * 
+ * + * string kind = 1; + * @return The kind. + */ + public java.lang.String getKind() { + java.lang.Object ref = kind_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kind_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of this custom HTTP verb.
+     * 
+ * + * string kind = 1; + * @return The bytes for kind. + */ + public com.google.protobuf.ByteString + getKindBytes() { + java.lang.Object ref = kind_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + kind_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of this custom HTTP verb.
+     * 
+ * + * string kind = 1; + * @param value The kind to set. + * @return This builder for chaining. + */ + public Builder setKind( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kind_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of this custom HTTP verb.
+     * 
+ * + * string kind = 1; + * @return This builder for chaining. + */ + public Builder clearKind() { + + kind_ = getDefaultInstance().getKind(); + onChanged(); + return this; + } + /** + *
+     * The name of this custom HTTP verb.
+     * 
+ * + * string kind = 1; + * @param value The bytes for kind to set. + * @return This builder for chaining. + */ + public Builder setKindBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kind_ = value; + onChanged(); + return this; + } + + private java.lang.Object path_ = ""; + /** + *
+     * The path matched by this custom verb.
+     * 
+ * + * string path = 2; + * @return The path. + */ + public java.lang.String getPath() { + java.lang.Object ref = path_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + path_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The path matched by this custom verb.
+     * 
+ * + * string path = 2; + * @return The bytes for path. + */ + public com.google.protobuf.ByteString + getPathBytes() { + java.lang.Object ref = path_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + path_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The path matched by this custom verb.
+     * 
+ * + * string path = 2; + * @param value The path to set. + * @return This builder for chaining. + */ + public Builder setPath( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + path_ = value; + onChanged(); + return this; + } + /** + *
+     * The path matched by this custom verb.
+     * 
+ * + * string path = 2; + * @return This builder for chaining. + */ + public Builder clearPath() { + + path_ = getDefaultInstance().getPath(); + onChanged(); + return this; + } + /** + *
+     * The path matched by this custom verb.
+     * 
+ * + * string path = 2; + * @param value The bytes for path to set. + * @return This builder for chaining. + */ + public Builder setPathBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + path_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.api.CustomHttpPattern) + } + + // @@protoc_insertion_point(class_scope:google.api.CustomHttpPattern) + private static final com.google.api.CustomHttpPattern DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.api.CustomHttpPattern(); + } + + public static com.google.api.CustomHttpPattern getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomHttpPattern parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomHttpPattern(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.CustomHttpPattern getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java b/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java new file mode 100644 index 0000000..542756d --- /dev/null +++ b/src/main/java/com/google/api/CustomHttpPatternOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +public interface CustomHttpPatternOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.api.CustomHttpPattern) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The name of this custom HTTP verb.
+   * 
+ * + * string kind = 1; + * @return The kind. + */ + java.lang.String getKind(); + /** + *
+   * The name of this custom HTTP verb.
+   * 
+ * + * string kind = 1; + * @return The bytes for kind. + */ + com.google.protobuf.ByteString + getKindBytes(); + + /** + *
+   * The path matched by this custom verb.
+   * 
+ * + * string path = 2; + * @return The path. + */ + java.lang.String getPath(); + /** + *
+   * The path matched by this custom verb.
+   * 
+ * + * string path = 2; + * @return The bytes for path. + */ + com.google.protobuf.ByteString + getPathBytes(); +} diff --git a/src/main/java/com/google/api/Http.java b/src/main/java/com/google/api/Http.java new file mode 100644 index 0000000..e8fdbac --- /dev/null +++ b/src/main/java/com/google/api/Http.java @@ -0,0 +1,994 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +/** + *
+ * Defines the HTTP configuration for an API service. It contains a list of
+ * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
+ * to one or more HTTP REST API methods.
+ * 
+ * + * Protobuf type {@code google.api.Http} + */ +public final class Http extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.api.Http) + HttpOrBuilder { +private static final long serialVersionUID = 0L; + // Use Http.newBuilder() to construct. + private Http(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Http() { + rules_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Http(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Http( + 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) != 0)) { + rules_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + rules_.add( + input.readMessage(com.google.api.HttpRule.parser(), extensionRegistry)); + break; + } + case 16: { + + fullyDecodeReservedExpansion_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpProto.internal_static_google_api_Http_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_Http_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.Http.class, com.google.api.Http.Builder.class); + } + + public static final int RULES_FIELD_NUMBER = 1; + private java.util.List rules_; + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + @java.lang.Override + public java.util.List getRulesList() { + return rules_; + } + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + @java.lang.Override + public java.util.List + getRulesOrBuilderList() { + return rules_; + } + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + @java.lang.Override + public int getRulesCount() { + return rules_.size(); + } + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + @java.lang.Override + public com.google.api.HttpRule getRules(int index) { + return rules_.get(index); + } + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + @java.lang.Override + public com.google.api.HttpRuleOrBuilder getRulesOrBuilder( + int index) { + return rules_.get(index); + } + + public static final int FULLY_DECODE_RESERVED_EXPANSION_FIELD_NUMBER = 2; + private boolean fullyDecodeReservedExpansion_; + /** + *
+   * When set to true, URL path parmeters will be fully URI-decoded except in
+   * cases of single segment matches in reserved expansion, where "%2F" will be
+   * left encoded.
+   * The default behavior is to not decode RFC 6570 reserved characters in multi
+   * segment matches.
+   * 
+ * + * bool fully_decode_reserved_expansion = 2; + * @return The fullyDecodeReservedExpansion. + */ + @java.lang.Override + public boolean getFullyDecodeReservedExpansion() { + return fullyDecodeReservedExpansion_; + } + + 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 < rules_.size(); i++) { + output.writeMessage(1, rules_.get(i)); + } + if (fullyDecodeReservedExpansion_ != false) { + output.writeBool(2, fullyDecodeReservedExpansion_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < rules_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, rules_.get(i)); + } + if (fullyDecodeReservedExpansion_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(2, fullyDecodeReservedExpansion_); + } + 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.api.Http)) { + return super.equals(obj); + } + com.google.api.Http other = (com.google.api.Http) obj; + + if (!getRulesList() + .equals(other.getRulesList())) return false; + if (getFullyDecodeReservedExpansion() + != other.getFullyDecodeReservedExpansion()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getRulesCount() > 0) { + hash = (37 * hash) + RULES_FIELD_NUMBER; + hash = (53 * hash) + getRulesList().hashCode(); + } + hash = (37 * hash) + FULLY_DECODE_RESERVED_EXPANSION_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFullyDecodeReservedExpansion()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.Http parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.Http parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.Http parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.Http 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.api.Http parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.Http parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.Http parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.Http 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.api.Http parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.api.Http 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.api.Http parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.Http 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.api.Http 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; + } + /** + *
+   * Defines the HTTP configuration for an API service. It contains a list of
+   * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
+   * to one or more HTTP REST API methods.
+   * 
+ * + * Protobuf type {@code google.api.Http} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.api.Http) + com.google.api.HttpOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpProto.internal_static_google_api_Http_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_Http_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.Http.class, com.google.api.Http.Builder.class); + } + + // Construct using com.google.api.Http.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getRulesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + rulesBuilder_.clear(); + } + fullyDecodeReservedExpansion_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.api.HttpProto.internal_static_google_api_Http_descriptor; + } + + @java.lang.Override + public com.google.api.Http getDefaultInstanceForType() { + return com.google.api.Http.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.Http build() { + com.google.api.Http result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.Http buildPartial() { + com.google.api.Http result = new com.google.api.Http(this); + int from_bitField0_ = bitField0_; + if (rulesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + rules_ = java.util.Collections.unmodifiableList(rules_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.rules_ = rules_; + } else { + result.rules_ = rulesBuilder_.build(); + } + result.fullyDecodeReservedExpansion_ = fullyDecodeReservedExpansion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.Http) { + return mergeFrom((com.google.api.Http)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.Http other) { + if (other == com.google.api.Http.getDefaultInstance()) return this; + if (rulesBuilder_ == null) { + if (!other.rules_.isEmpty()) { + if (rules_.isEmpty()) { + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureRulesIsMutable(); + rules_.addAll(other.rules_); + } + onChanged(); + } + } else { + if (!other.rules_.isEmpty()) { + if (rulesBuilder_.isEmpty()) { + rulesBuilder_.dispose(); + rulesBuilder_ = null; + rules_ = other.rules_; + bitField0_ = (bitField0_ & ~0x00000001); + rulesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getRulesFieldBuilder() : null; + } else { + rulesBuilder_.addAllMessages(other.rules_); + } + } + } + if (other.getFullyDecodeReservedExpansion() != false) { + setFullyDecodeReservedExpansion(other.getFullyDecodeReservedExpansion()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.Http parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.Http) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List rules_ = + java.util.Collections.emptyList(); + private void ensureRulesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + rules_ = new java.util.ArrayList(rules_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> rulesBuilder_; + + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public java.util.List getRulesList() { + if (rulesBuilder_ == null) { + return java.util.Collections.unmodifiableList(rules_); + } else { + return rulesBuilder_.getMessageList(); + } + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public int getRulesCount() { + if (rulesBuilder_ == null) { + return rules_.size(); + } else { + return rulesBuilder_.getCount(); + } + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public com.google.api.HttpRule getRules(int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); + } else { + return rulesBuilder_.getMessage(index); + } + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder setRules( + int index, com.google.api.HttpRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.set(index, value); + onChanged(); + } else { + rulesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder setRules( + int index, com.google.api.HttpRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.set(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder addRules(com.google.api.HttpRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(value); + onChanged(); + } else { + rulesBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder addRules( + int index, com.google.api.HttpRule value) { + if (rulesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureRulesIsMutable(); + rules_.add(index, value); + onChanged(); + } else { + rulesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder addRules( + com.google.api.HttpRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder addRules( + int index, com.google.api.HttpRule.Builder builderForValue) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.add(index, builderForValue.build()); + onChanged(); + } else { + rulesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder addAllRules( + java.lang.Iterable values) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, rules_); + onChanged(); + } else { + rulesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder clearRules() { + if (rulesBuilder_ == null) { + rules_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + rulesBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public Builder removeRules(int index) { + if (rulesBuilder_ == null) { + ensureRulesIsMutable(); + rules_.remove(index); + onChanged(); + } else { + rulesBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public com.google.api.HttpRule.Builder getRulesBuilder( + int index) { + return getRulesFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public com.google.api.HttpRuleOrBuilder getRulesOrBuilder( + int index) { + if (rulesBuilder_ == null) { + return rules_.get(index); } else { + return rulesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public java.util.List + getRulesOrBuilderList() { + if (rulesBuilder_ != null) { + return rulesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(rules_); + } + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public com.google.api.HttpRule.Builder addRulesBuilder() { + return getRulesFieldBuilder().addBuilder( + com.google.api.HttpRule.getDefaultInstance()); + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public com.google.api.HttpRule.Builder addRulesBuilder( + int index) { + return getRulesFieldBuilder().addBuilder( + index, com.google.api.HttpRule.getDefaultInstance()); + } + /** + *
+     * A list of HTTP configuration rules that apply to individual API methods.
+     * **NOTE:** All service configuration rules follow "last one wins" order.
+     * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + public java.util.List + getRulesBuilderList() { + return getRulesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> + getRulesFieldBuilder() { + if (rulesBuilder_ == null) { + rulesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder>( + rules_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + rules_ = null; + } + return rulesBuilder_; + } + + private boolean fullyDecodeReservedExpansion_ ; + /** + *
+     * When set to true, URL path parmeters will be fully URI-decoded except in
+     * cases of single segment matches in reserved expansion, where "%2F" will be
+     * left encoded.
+     * The default behavior is to not decode RFC 6570 reserved characters in multi
+     * segment matches.
+     * 
+ * + * bool fully_decode_reserved_expansion = 2; + * @return The fullyDecodeReservedExpansion. + */ + @java.lang.Override + public boolean getFullyDecodeReservedExpansion() { + return fullyDecodeReservedExpansion_; + } + /** + *
+     * When set to true, URL path parmeters will be fully URI-decoded except in
+     * cases of single segment matches in reserved expansion, where "%2F" will be
+     * left encoded.
+     * The default behavior is to not decode RFC 6570 reserved characters in multi
+     * segment matches.
+     * 
+ * + * bool fully_decode_reserved_expansion = 2; + * @param value The fullyDecodeReservedExpansion to set. + * @return This builder for chaining. + */ + public Builder setFullyDecodeReservedExpansion(boolean value) { + + fullyDecodeReservedExpansion_ = value; + onChanged(); + return this; + } + /** + *
+     * When set to true, URL path parmeters will be fully URI-decoded except in
+     * cases of single segment matches in reserved expansion, where "%2F" will be
+     * left encoded.
+     * The default behavior is to not decode RFC 6570 reserved characters in multi
+     * segment matches.
+     * 
+ * + * bool fully_decode_reserved_expansion = 2; + * @return This builder for chaining. + */ + public Builder clearFullyDecodeReservedExpansion() { + + fullyDecodeReservedExpansion_ = false; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.api.Http) + } + + // @@protoc_insertion_point(class_scope:google.api.Http) + private static final com.google.api.Http DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.api.Http(); + } + + public static com.google.api.Http getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Http parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Http(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.Http getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/api/HttpBody.java b/src/main/java/com/google/api/HttpBody.java new file mode 100644 index 0000000..2cc37b9 --- /dev/null +++ b/src/main/java/com/google/api/HttpBody.java @@ -0,0 +1,1199 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/httpbody.proto + +package com.google.api; + +/** + *
+ * Message that represents an arbitrary HTTP body. It should only be used for
+ * payload formats that can't be represented as JSON, such as raw binary or
+ * an HTML page.
+ * This message can be used both in streaming and non-streaming API methods in
+ * the request as well as the response.
+ * It can be used as a top-level request field, which is convenient if one
+ * wants to extract parameters from either the URL or HTTP template into the
+ * request fields and also want access to the raw HTTP body.
+ * Example:
+ *     message GetResourceRequest {
+ *       // A unique request id.
+ *       string request_id = 1;
+ *       // The raw HTTP body is bound to this field.
+ *       google.api.HttpBody http_body = 2;
+ *     }
+ *     service ResourceService {
+ *       rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
+ *       rpc UpdateResource(google.api.HttpBody) returns
+ *       (google.protobuf.Empty);
+ *     }
+ * Example with streaming methods:
+ *     service CaldavService {
+ *       rpc GetCalendar(stream google.api.HttpBody)
+ *         returns (stream google.api.HttpBody);
+ *       rpc UpdateCalendar(stream google.api.HttpBody)
+ *         returns (stream google.api.HttpBody);
+ *     }
+ * Use of this type only changes how the request and response bodies are
+ * handled, all other features will continue to work unchanged.
+ * 
+ * + * Protobuf type {@code google.api.HttpBody} + */ +public final class HttpBody extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.api.HttpBody) + HttpBodyOrBuilder { +private static final long serialVersionUID = 0L; + // Use HttpBody.newBuilder() to construct. + private HttpBody(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HttpBody() { + contentType_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + extensions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new HttpBody(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HttpBody( + 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(); + + contentType_ = s; + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + extensions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + extensions_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpBody.class, com.google.api.HttpBody.Builder.class); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object contentType_; + /** + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + *
+   * The HTTP request/response body as raw binary.
+   * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int EXTENSIONS_FIELD_NUMBER = 3; + private java.util.List extensions_; + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + @java.lang.Override + public java.util.List getExtensionsList() { + return extensions_; + } + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + @java.lang.Override + public java.util.List + getExtensionsOrBuilderList() { + return extensions_; + } + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + @java.lang.Override + public int getExtensionsCount() { + return extensions_.size(); + } + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + @java.lang.Override + public com.google.protobuf.Any getExtensions(int index) { + return extensions_.get(index); + } + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder( + int index) { + return extensions_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contentType_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + for (int i = 0; i < extensions_.size(); i++) { + output.writeMessage(3, extensions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contentType_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + for (int i = 0; i < extensions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, extensions_.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.api.HttpBody)) { + return super.equals(obj); + } + com.google.api.HttpBody other = (com.google.api.HttpBody) obj; + + if (!getContentType() + .equals(other.getContentType())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!getExtensionsList() + .equals(other.getExtensionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (getExtensionsCount() > 0) { + hash = (37 * hash) + EXTENSIONS_FIELD_NUMBER; + hash = (53 * hash) + getExtensionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.HttpBody parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpBody parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.HttpBody parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpBody 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.api.HttpBody parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpBody parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.HttpBody parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.HttpBody 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.api.HttpBody parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.api.HttpBody 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.api.HttpBody parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.HttpBody 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.api.HttpBody 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 that represents an arbitrary HTTP body. It should only be used for
+   * payload formats that can't be represented as JSON, such as raw binary or
+   * an HTML page.
+   * This message can be used both in streaming and non-streaming API methods in
+   * the request as well as the response.
+   * It can be used as a top-level request field, which is convenient if one
+   * wants to extract parameters from either the URL or HTTP template into the
+   * request fields and also want access to the raw HTTP body.
+   * Example:
+   *     message GetResourceRequest {
+   *       // A unique request id.
+   *       string request_id = 1;
+   *       // The raw HTTP body is bound to this field.
+   *       google.api.HttpBody http_body = 2;
+   *     }
+   *     service ResourceService {
+   *       rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
+   *       rpc UpdateResource(google.api.HttpBody) returns
+   *       (google.protobuf.Empty);
+   *     }
+   * Example with streaming methods:
+   *     service CaldavService {
+   *       rpc GetCalendar(stream google.api.HttpBody)
+   *         returns (stream google.api.HttpBody);
+   *       rpc UpdateCalendar(stream google.api.HttpBody)
+   *         returns (stream google.api.HttpBody);
+   *     }
+   * Use of this type only changes how the request and response bodies are
+   * handled, all other features will continue to work unchanged.
+   * 
+ * + * Protobuf type {@code google.api.HttpBody} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.api.HttpBody) + com.google.api.HttpBodyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpBody.class, com.google.api.HttpBody.Builder.class); + } + + // Construct using com.google.api.HttpBody.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getExtensionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + contentType_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + extensionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.api.HttpBodyProto.internal_static_google_api_HttpBody_descriptor; + } + + @java.lang.Override + public com.google.api.HttpBody getDefaultInstanceForType() { + return com.google.api.HttpBody.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.HttpBody build() { + com.google.api.HttpBody result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.HttpBody buildPartial() { + com.google.api.HttpBody result = new com.google.api.HttpBody(this); + int from_bitField0_ = bitField0_; + result.contentType_ = contentType_; + result.data_ = data_; + if (extensionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + extensions_ = java.util.Collections.unmodifiableList(extensions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.extensions_ = extensions_; + } else { + result.extensions_ = extensionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.HttpBody) { + return mergeFrom((com.google.api.HttpBody)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.HttpBody other) { + if (other == com.google.api.HttpBody.getDefaultInstance()) return this; + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (extensionsBuilder_ == null) { + if (!other.extensions_.isEmpty()) { + if (extensions_.isEmpty()) { + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureExtensionsIsMutable(); + extensions_.addAll(other.extensions_); + } + onChanged(); + } + } else { + if (!other.extensions_.isEmpty()) { + if (extensionsBuilder_.isEmpty()) { + extensionsBuilder_.dispose(); + extensionsBuilder_ = null; + extensions_ = other.extensions_; + bitField0_ = (bitField0_ & ~0x00000001); + extensionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getExtensionsFieldBuilder() : null; + } else { + extensionsBuilder_.addAllMessages(other.extensions_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.HttpBody parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.HttpBody) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object contentType_ = ""; + /** + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + *
+     * The HTTP Content-Type header value specifying the content type of the body.
+     * 
+ * + * string content_type = 1; + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+     * The HTTP request/response body as raw binary.
+     * 
+ * + * bytes data = 2; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.util.List extensions_ = + java.util.Collections.emptyList(); + private void ensureExtensionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + extensions_ = new java.util.ArrayList(extensions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> extensionsBuilder_; + + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List getExtensionsList() { + if (extensionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(extensions_); + } else { + return extensionsBuilder_.getMessageList(); + } + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public int getExtensionsCount() { + if (extensionsBuilder_ == null) { + return extensions_.size(); + } else { + return extensionsBuilder_.getCount(); + } + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any getExtensions(int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); + } else { + return extensionsBuilder_.getMessage(index); + } + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder setExtensions( + int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.set(index, value); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder setExtensions( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.set(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions(com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(value); + onChanged(); + } else { + extensionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions( + int index, com.google.protobuf.Any value) { + if (extensionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureExtensionsIsMutable(); + extensions_.add(index, value); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions( + com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addExtensions( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.add(index, builderForValue.build()); + onChanged(); + } else { + extensionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder addAllExtensions( + java.lang.Iterable values) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, extensions_); + onChanged(); + } else { + extensionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder clearExtensions() { + if (extensionsBuilder_ == null) { + extensions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + extensionsBuilder_.clear(); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public Builder removeExtensions(int index) { + if (extensionsBuilder_ == null) { + ensureExtensionsIsMutable(); + extensions_.remove(index); + onChanged(); + } else { + extensionsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder getExtensionsBuilder( + int index) { + return getExtensionsFieldBuilder().getBuilder(index); + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder( + int index) { + if (extensionsBuilder_ == null) { + return extensions_.get(index); } else { + return extensionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List + getExtensionsOrBuilderList() { + if (extensionsBuilder_ != null) { + return extensionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(extensions_); + } + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder() { + return getExtensionsFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public com.google.protobuf.Any.Builder addExtensionsBuilder( + int index) { + return getExtensionsFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
+     * Application specific response metadata. Must be set in the first response
+     * for streaming APIs.
+     * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + public java.util.List + getExtensionsBuilderList() { + return getExtensionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getExtensionsFieldBuilder() { + if (extensionsBuilder_ == null) { + extensionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + extensions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + extensions_ = null; + } + return extensionsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.api.HttpBody) + } + + // @@protoc_insertion_point(class_scope:google.api.HttpBody) + private static final com.google.api.HttpBody DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.api.HttpBody(); + } + + public static com.google.api.HttpBody getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpBody parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpBody(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.HttpBody getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/api/HttpBodyOrBuilder.java b/src/main/java/com/google/api/HttpBodyOrBuilder.java new file mode 100644 index 0000000..3585042 --- /dev/null +++ b/src/main/java/com/google/api/HttpBodyOrBuilder.java @@ -0,0 +1,88 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/httpbody.proto + +package com.google.api; + +public interface HttpBodyOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.api.HttpBody) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * @return The contentType. + */ + java.lang.String getContentType(); + /** + *
+   * The HTTP Content-Type header value specifying the content type of the body.
+   * 
+ * + * string content_type = 1; + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString + getContentTypeBytes(); + + /** + *
+   * The HTTP request/response body as raw binary.
+   * 
+ * + * bytes data = 2; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + java.util.List + getExtensionsList(); + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + com.google.protobuf.Any getExtensions(int index); + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + int getExtensionsCount(); + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + java.util.List + getExtensionsOrBuilderList(); + /** + *
+   * Application specific response metadata. Must be set in the first response
+   * for streaming APIs.
+   * 
+ * + * repeated .google.protobuf.Any extensions = 3; + */ + com.google.protobuf.AnyOrBuilder getExtensionsOrBuilder( + int index); +} diff --git a/src/main/java/com/google/api/HttpBodyProto.java b/src/main/java/com/google/api/HttpBodyProto.java new file mode 100644 index 0000000..9649c1b --- /dev/null +++ b/src/main/java/com/google/api/HttpBodyProto.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/httpbody.proto + +package com.google.api; + +public final class HttpBodyProto { + private HttpBodyProto() {} + 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_api_HttpBody_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_HttpBody_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\031google/api/httpbody.proto\022\ngoogle.api\032" + + "\031google/protobuf/any.proto\"X\n\010HttpBody\022\024" + + "\n\014content_type\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022(\n\nex" + + "tensions\030\003 \003(\0132\024.google.protobuf.AnyBh\n\016" + + "com.google.apiB\rHttpBodyProtoP\001Z;google." + + "golang.org/genproto/googleapis/api/httpb" + + "ody;httpbody\370\001\001\242\002\004GAPIb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + }); + internal_static_google_api_HttpBody_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_HttpBody_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_HttpBody_descriptor, + new java.lang.String[] { "ContentType", "Data", "Extensions", }); + com.google.protobuf.AnyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/api/HttpOrBuilder.java b/src/main/java/com/google/api/HttpOrBuilder.java new file mode 100644 index 0000000..20c49a5 --- /dev/null +++ b/src/main/java/com/google/api/HttpOrBuilder.java @@ -0,0 +1,72 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +public interface HttpOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.api.Http) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + java.util.List + getRulesList(); + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + com.google.api.HttpRule getRules(int index); + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + int getRulesCount(); + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + java.util.List + getRulesOrBuilderList(); + /** + *
+   * A list of HTTP configuration rules that apply to individual API methods.
+   * **NOTE:** All service configuration rules follow "last one wins" order.
+   * 
+ * + * repeated .google.api.HttpRule rules = 1; + */ + com.google.api.HttpRuleOrBuilder getRulesOrBuilder( + int index); + + /** + *
+   * When set to true, URL path parmeters will be fully URI-decoded except in
+   * cases of single segment matches in reserved expansion, where "%2F" will be
+   * left encoded.
+   * The default behavior is to not decode RFC 6570 reserved characters in multi
+   * segment matches.
+   * 
+ * + * bool fully_decode_reserved_expansion = 2; + * @return The fullyDecodeReservedExpansion. + */ + boolean getFullyDecodeReservedExpansion(); +} diff --git a/src/main/java/com/google/api/HttpProto.java b/src/main/java/com/google/api/HttpProto.java new file mode 100644 index 0000000..834db94 --- /dev/null +++ b/src/main/java/com/google/api/HttpProto.java @@ -0,0 +1,81 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +public final class HttpProto { + private HttpProto() {} + 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_api_Http_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_Http_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_HttpRule_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_HttpRule_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_api_CustomHttpPattern_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_api_CustomHttpPattern_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\025google/api/http.proto\022\ngoogle.api\"T\n\004H" + + "ttp\022#\n\005rules\030\001 \003(\0132\024.google.api.HttpRule" + + "\022\'\n\037fully_decode_reserved_expansion\030\002 \001(" + + "\010\"\201\002\n\010HttpRule\022\020\n\010selector\030\001 \001(\t\022\r\n\003get\030" + + "\002 \001(\tH\000\022\r\n\003put\030\003 \001(\tH\000\022\016\n\004post\030\004 \001(\tH\000\022\020" + + "\n\006delete\030\005 \001(\tH\000\022\017\n\005patch\030\006 \001(\tH\000\022/\n\006cus" + + "tom\030\010 \001(\0132\035.google.api.CustomHttpPattern" + + "H\000\022\014\n\004body\030\007 \001(\t\022\025\n\rresponse_body\030\014 \001(\t\022" + + "1\n\023additional_bindings\030\013 \003(\0132\024.google.ap" + + "i.HttpRuleB\t\n\007pattern\"/\n\021CustomHttpPatte" + + "rn\022\014\n\004kind\030\001 \001(\t\022\014\n\004path\030\002 \001(\tBj\n\016com.go" + + "ogle.apiB\tHttpProtoP\001ZAgoogle.golang.org" + + "/genproto/googleapis/api/annotations;ann" + + "otations\370\001\001\242\002\004GAPIb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_google_api_Http_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_api_Http_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_Http_descriptor, + new java.lang.String[] { "Rules", "FullyDecodeReservedExpansion", }); + internal_static_google_api_HttpRule_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_api_HttpRule_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_HttpRule_descriptor, + new java.lang.String[] { "Selector", "Get", "Put", "Post", "Delete", "Patch", "Custom", "Body", "ResponseBody", "AdditionalBindings", "Pattern", }); + internal_static_google_api_CustomHttpPattern_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_api_CustomHttpPattern_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_api_CustomHttpPattern_descriptor, + new java.lang.String[] { "Kind", "Path", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/api/HttpRule.java b/src/main/java/com/google/api/HttpRule.java new file mode 100644 index 0000000..ce4b8fa --- /dev/null +++ b/src/main/java/com/google/api/HttpRule.java @@ -0,0 +1,3134 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +/** + *
+ * `HttpRule` defines the mapping of an RPC method to one or more HTTP
+ * REST API methods. The mapping specifies how different portions of the RPC
+ * request message are mapped to URL path, URL query parameters, and
+ * HTTP request body. The mapping is typically specified as an
+ * `google.api.http` annotation on the RPC method,
+ * see "google/api/annotations.proto" for details.
+ * The mapping consists of a field specifying the path template and
+ * method kind.  The path template can refer to fields in the request
+ * message, as in the example below which describes a REST GET
+ * operation on a resource collection of messages:
+ *     service Messaging {
+ *       rpc GetMessage(GetMessageRequest) returns (Message) {
+ *         option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
+ *       }
+ *     }
+ *     message GetMessageRequest {
+ *       message SubMessage {
+ *         string subfield = 1;
+ *       }
+ *       string message_id = 1; // mapped to the URL
+ *       SubMessage sub = 2;    // `sub.subfield` is url-mapped
+ *     }
+ *     message Message {
+ *       string text = 1; // content of the resource
+ *     }
+ * The same http annotation can alternatively be expressed inside the
+ * `GRPC API Configuration` YAML file.
+ *     http:
+ *       rules:
+ *         - selector: <proto_package_name>.Messaging.GetMessage
+ *           get: /v1/messages/{message_id}/{sub.subfield}
+ * This definition enables an automatic, bidrectional mapping of HTTP
+ * JSON to RPC. Example:
+ * HTTP | RPC
+ * -----|-----
+ * `GET /v1/messages/123456/foo`  | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
+ * In general, not only fields but also field paths can be referenced
+ * from a path pattern. Fields mapped to the path pattern cannot be
+ * repeated and must have a primitive (non-message) type.
+ * Any fields in the request message which are not bound by the path
+ * pattern automatically become (optional) HTTP query
+ * parameters. Assume the following definition of the request message:
+ *     service Messaging {
+ *       rpc GetMessage(GetMessageRequest) returns (Message) {
+ *         option (google.api.http).get = "/v1/messages/{message_id}";
+ *       }
+ *     }
+ *     message GetMessageRequest {
+ *       message SubMessage {
+ *         string subfield = 1;
+ *       }
+ *       string message_id = 1; // mapped to the URL
+ *       int64 revision = 2;    // becomes a parameter
+ *       SubMessage sub = 3;    // `sub.subfield` becomes a parameter
+ *     }
+ * This enables a HTTP JSON to RPC mapping as below:
+ * HTTP | RPC
+ * -----|-----
+ * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
+ * Note that fields which are mapped to HTTP parameters must have a
+ * primitive type or a repeated primitive type. Message types are not
+ * allowed. In the case of a repeated type, the parameter can be
+ * repeated in the URL, as in `...?param=A&param=B`.
+ * For HTTP method kinds which allow a request body, the `body` field
+ * specifies the mapping. Consider a REST update method on the
+ * message resource collection:
+ *     service Messaging {
+ *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
+ *         option (google.api.http) = {
+ *           put: "/v1/messages/{message_id}"
+ *           body: "message"
+ *         };
+ *       }
+ *     }
+ *     message UpdateMessageRequest {
+ *       string message_id = 1; // mapped to the URL
+ *       Message message = 2;   // mapped to the body
+ *     }
+ * The following HTTP JSON to RPC mapping is enabled, where the
+ * representation of the JSON in the request body is determined by
+ * protos JSON encoding:
+ * HTTP | RPC
+ * -----|-----
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
+ * The special name `*` can be used in the body mapping to define that
+ * every field not bound by the path template should be mapped to the
+ * request body.  This enables the following alternative definition of
+ * the update method:
+ *     service Messaging {
+ *       rpc UpdateMessage(Message) returns (Message) {
+ *         option (google.api.http) = {
+ *           put: "/v1/messages/{message_id}"
+ *           body: "*"
+ *         };
+ *       }
+ *     }
+ *     message Message {
+ *       string message_id = 1;
+ *       string text = 2;
+ *     }
+ * The following HTTP JSON to RPC mapping is enabled:
+ * HTTP | RPC
+ * -----|-----
+ * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
+ * Note that when using `*` in the body mapping, it is not possible to
+ * have HTTP parameters, as all fields not bound by the path end in
+ * the body. This makes this option more rarely used in practice of
+ * defining REST APIs. The common usage of `*` is in custom methods
+ * which don't use the URL at all for transferring data.
+ * It is possible to define multiple HTTP methods for one RPC by using
+ * the `additional_bindings` option. Example:
+ *     service Messaging {
+ *       rpc GetMessage(GetMessageRequest) returns (Message) {
+ *         option (google.api.http) = {
+ *           get: "/v1/messages/{message_id}"
+ *           additional_bindings {
+ *             get: "/v1/users/{user_id}/messages/{message_id}"
+ *           }
+ *         };
+ *       }
+ *     }
+ *     message GetMessageRequest {
+ *       string message_id = 1;
+ *       string user_id = 2;
+ *     }
+ * This enables the following two alternative HTTP JSON to RPC
+ * mappings:
+ * HTTP | RPC
+ * -----|-----
+ * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
+ * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
+ * # Rules for HTTP mapping
+ * The rules for mapping HTTP path, query parameters, and body fields
+ * to the request message are as follows:
+ * 1. The `body` field specifies either `*` or a field path, or is
+ *    omitted. If omitted, it indicates there is no HTTP request body.
+ * 2. Leaf fields (recursive expansion of nested messages in the
+ *    request) can be classified into three types:
+ *     (a) Matched in the URL template.
+ *     (b) Covered by body (if body is `*`, everything except (a) fields;
+ *         else everything under the body field)
+ *     (c) All other fields.
+ * 3. URL query parameters found in the HTTP request are mapped to (c) fields.
+ * 4. Any body sent with an HTTP request can contain only (b) fields.
+ * The syntax of the path template is as follows:
+ *     Template = "/" Segments [ Verb ] ;
+ *     Segments = Segment { "/" Segment } ;
+ *     Segment  = "*" | "**" | LITERAL | Variable ;
+ *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
+ *     FieldPath = IDENT { "." IDENT } ;
+ *     Verb     = ":" LITERAL ;
+ * The syntax `*` matches a single path segment. The syntax `**` matches zero
+ * or more path segments, which must be the last part of the path except the
+ * `Verb`. The syntax `LITERAL` matches literal text in the path.
+ * The syntax `Variable` matches part of the URL path as specified by its
+ * template. A variable template must not contain other variables. If a variable
+ * matches a single path segment, its template may be omitted, e.g. `{var}`
+ * is equivalent to `{var=*}`.
+ * If a variable contains exactly one path segment, such as `"{var}"` or
+ * `"{var=*}"`, when such a variable is expanded into a URL path, all characters
+ * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
+ * Discovery Document as `{var}`.
+ * If a variable contains one or more path segments, such as `"{var=foo/*}"`
+ * or `"{var=**}"`, when such a variable is expanded into a URL path, all
+ * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
+ * show up in the Discovery Document as `{+var}`.
+ * NOTE: While the single segment variable matches the semantics of
+ * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
+ * Simple String Expansion, the multi segment variable **does not** match
+ * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
+ * does not expand special characters like `?` and `#`, which would lead
+ * to invalid URLs.
+ * NOTE: the field paths in variables and in the `body` must not refer to
+ * repeated fields or map fields.
+ * 
+ * + * Protobuf type {@code google.api.HttpRule} + */ +public final class HttpRule extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.api.HttpRule) + HttpRuleOrBuilder { +private static final long serialVersionUID = 0L; + // Use HttpRule.newBuilder() to construct. + private HttpRule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HttpRule() { + selector_ = ""; + body_ = ""; + responseBody_ = ""; + additionalBindings_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new HttpRule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HttpRule( + 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(); + + selector_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + patternCase_ = 2; + pattern_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + patternCase_ = 3; + pattern_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + patternCase_ = 4; + pattern_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + patternCase_ = 5; + pattern_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + patternCase_ = 6; + pattern_ = s; + break; + } + case 58: { + java.lang.String s = input.readStringRequireUtf8(); + + body_ = s; + break; + } + case 66: { + com.google.api.CustomHttpPattern.Builder subBuilder = null; + if (patternCase_ == 8) { + subBuilder = ((com.google.api.CustomHttpPattern) pattern_).toBuilder(); + } + pattern_ = + input.readMessage(com.google.api.CustomHttpPattern.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.api.CustomHttpPattern) pattern_); + pattern_ = subBuilder.buildPartial(); + } + patternCase_ = 8; + break; + } + case 90: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + additionalBindings_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + additionalBindings_.add( + input.readMessage(com.google.api.HttpRule.parser(), extensionRegistry)); + break; + } + case 98: { + java.lang.String s = input.readStringRequireUtf8(); + + responseBody_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + additionalBindings_ = java.util.Collections.unmodifiableList(additionalBindings_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpRule.class, com.google.api.HttpRule.Builder.class); + } + + private int patternCase_ = 0; + private java.lang.Object pattern_; + public enum PatternCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GET(2), + PUT(3), + POST(4), + DELETE(5), + PATCH(6), + CUSTOM(8), + PATTERN_NOT_SET(0); + private final int value; + private PatternCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PatternCase valueOf(int value) { + return forNumber(value); + } + + public static PatternCase forNumber(int value) { + switch (value) { + case 2: return GET; + case 3: return PUT; + case 4: return POST; + case 5: return DELETE; + case 6: return PATCH; + case 8: return CUSTOM; + case 0: return PATTERN_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public PatternCase + getPatternCase() { + return PatternCase.forNumber( + patternCase_); + } + + public static final int SELECTOR_FIELD_NUMBER = 1; + private volatile java.lang.Object selector_; + /** + *
+   * Selects methods to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * @return The selector. + */ + @java.lang.Override + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + 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(); + selector_ = s; + return s; + } + } + /** + *
+   * Selects methods to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * @return The bytes for selector. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GET_FIELD_NUMBER = 2; + /** + *
+   * Used for listing and getting information about resources.
+   * 
+ * + * string get = 2; + * @return The get. + */ + public java.lang.String getGet() { + java.lang.Object ref = ""; + if (patternCase_ == 2) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 2) { + pattern_ = s; + } + return s; + } + } + /** + *
+   * Used for listing and getting information about resources.
+   * 
+ * + * string get = 2; + * @return The bytes for get. + */ + public com.google.protobuf.ByteString + getGetBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 2) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 2) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUT_FIELD_NUMBER = 3; + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string put = 3; + * @return The put. + */ + public java.lang.String getPut() { + java.lang.Object ref = ""; + if (patternCase_ == 3) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 3) { + pattern_ = s; + } + return s; + } + } + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string put = 3; + * @return The bytes for put. + */ + public com.google.protobuf.ByteString + getPutBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 3) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 3) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int POST_FIELD_NUMBER = 4; + /** + *
+   * Used for creating a resource.
+   * 
+ * + * string post = 4; + * @return The post. + */ + public java.lang.String getPost() { + java.lang.Object ref = ""; + if (patternCase_ == 4) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 4) { + pattern_ = s; + } + return s; + } + } + /** + *
+   * Used for creating a resource.
+   * 
+ * + * string post = 4; + * @return The bytes for post. + */ + public com.google.protobuf.ByteString + getPostBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 4) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 4) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DELETE_FIELD_NUMBER = 5; + /** + *
+   * Used for deleting a resource.
+   * 
+ * + * string delete = 5; + * @return The delete. + */ + public java.lang.String getDelete() { + java.lang.Object ref = ""; + if (patternCase_ == 5) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 5) { + pattern_ = s; + } + return s; + } + } + /** + *
+   * Used for deleting a resource.
+   * 
+ * + * string delete = 5; + * @return The bytes for delete. + */ + public com.google.protobuf.ByteString + getDeleteBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 5) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 5) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PATCH_FIELD_NUMBER = 6; + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string patch = 6; + * @return The patch. + */ + public java.lang.String getPatch() { + java.lang.Object ref = ""; + if (patternCase_ == 6) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 6) { + pattern_ = s; + } + return s; + } + } + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string patch = 6; + * @return The bytes for patch. + */ + public com.google.protobuf.ByteString + getPatchBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 6) { + ref = pattern_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 6) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_FIELD_NUMBER = 8; + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return patternCase_ == 8; + } + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return The custom. + */ + @java.lang.Override + public com.google.api.CustomHttpPattern getCustom() { + if (patternCase_ == 8) { + return (com.google.api.CustomHttpPattern) pattern_; + } + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + @java.lang.Override + public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { + if (patternCase_ == 8) { + return (com.google.api.CustomHttpPattern) pattern_; + } + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } + + public static final int BODY_FIELD_NUMBER = 7; + private volatile java.lang.Object body_; + /** + *
+   * The name of the request field whose value is mapped to the HTTP body, or
+   * `*` for mapping all fields not captured by the path pattern to the HTTP
+   * body. NOTE: the referred field must not be a repeated field and must be
+   * present at the top-level of request message type.
+   * 
+ * + * string body = 7; + * @return The body. + */ + @java.lang.Override + public java.lang.String getBody() { + java.lang.Object ref = body_; + 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(); + body_ = s; + return s; + } + } + /** + *
+   * The name of the request field whose value is mapped to the HTTP body, or
+   * `*` for mapping all fields not captured by the path pattern to the HTTP
+   * body. NOTE: the referred field must not be a repeated field and must be
+   * present at the top-level of request message type.
+   * 
+ * + * string body = 7; + * @return The bytes for body. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSE_BODY_FIELD_NUMBER = 12; + private volatile java.lang.Object responseBody_; + /** + *
+   * Optional. The name of the response field whose value is mapped to the HTTP
+   * body of response. Other response fields are ignored. When
+   * not set, the response message will be used as HTTP body of response.
+   * 
+ * + * string response_body = 12; + * @return The responseBody. + */ + @java.lang.Override + public java.lang.String getResponseBody() { + java.lang.Object ref = responseBody_; + 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(); + responseBody_ = s; + return s; + } + } + /** + *
+   * Optional. The name of the response field whose value is mapped to the HTTP
+   * body of response. Other response fields are ignored. When
+   * not set, the response message will be used as HTTP body of response.
+   * 
+ * + * string response_body = 12; + * @return The bytes for responseBody. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResponseBodyBytes() { + java.lang.Object ref = responseBody_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + responseBody_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDITIONAL_BINDINGS_FIELD_NUMBER = 11; + private java.util.List additionalBindings_; + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + @java.lang.Override + public java.util.List getAdditionalBindingsList() { + return additionalBindings_; + } + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + @java.lang.Override + public java.util.List + getAdditionalBindingsOrBuilderList() { + return additionalBindings_; + } + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + @java.lang.Override + public int getAdditionalBindingsCount() { + return additionalBindings_.size(); + } + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + @java.lang.Override + public com.google.api.HttpRule getAdditionalBindings(int index) { + return additionalBindings_.get(index); + } + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + @java.lang.Override + public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder( + int index) { + return additionalBindings_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSelectorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, selector_); + } + if (patternCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pattern_); + } + if (patternCase_ == 3) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pattern_); + } + if (patternCase_ == 4) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pattern_); + } + if (patternCase_ == 5) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, pattern_); + } + if (patternCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pattern_); + } + if (!getBodyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, body_); + } + if (patternCase_ == 8) { + output.writeMessage(8, (com.google.api.CustomHttpPattern) pattern_); + } + for (int i = 0; i < additionalBindings_.size(); i++) { + output.writeMessage(11, additionalBindings_.get(i)); + } + if (!getResponseBodyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, responseBody_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSelectorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, selector_); + } + if (patternCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pattern_); + } + if (patternCase_ == 3) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pattern_); + } + if (patternCase_ == 4) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pattern_); + } + if (patternCase_ == 5) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, pattern_); + } + if (patternCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pattern_); + } + if (!getBodyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, body_); + } + if (patternCase_ == 8) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, (com.google.api.CustomHttpPattern) pattern_); + } + for (int i = 0; i < additionalBindings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(11, additionalBindings_.get(i)); + } + if (!getResponseBodyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, responseBody_); + } + 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.api.HttpRule)) { + return super.equals(obj); + } + com.google.api.HttpRule other = (com.google.api.HttpRule) obj; + + if (!getSelector() + .equals(other.getSelector())) return false; + if (!getBody() + .equals(other.getBody())) return false; + if (!getResponseBody() + .equals(other.getResponseBody())) return false; + if (!getAdditionalBindingsList() + .equals(other.getAdditionalBindingsList())) return false; + if (!getPatternCase().equals(other.getPatternCase())) return false; + switch (patternCase_) { + case 2: + if (!getGet() + .equals(other.getGet())) return false; + break; + case 3: + if (!getPut() + .equals(other.getPut())) return false; + break; + case 4: + if (!getPost() + .equals(other.getPost())) return false; + break; + case 5: + if (!getDelete() + .equals(other.getDelete())) return false; + break; + case 6: + if (!getPatch() + .equals(other.getPatch())) return false; + break; + case 8: + if (!getCustom() + .equals(other.getCustom())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SELECTOR_FIELD_NUMBER; + hash = (53 * hash) + getSelector().hashCode(); + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (37 * hash) + RESPONSE_BODY_FIELD_NUMBER; + hash = (53 * hash) + getResponseBody().hashCode(); + if (getAdditionalBindingsCount() > 0) { + hash = (37 * hash) + ADDITIONAL_BINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getAdditionalBindingsList().hashCode(); + } + switch (patternCase_) { + case 2: + hash = (37 * hash) + GET_FIELD_NUMBER; + hash = (53 * hash) + getGet().hashCode(); + break; + case 3: + hash = (37 * hash) + PUT_FIELD_NUMBER; + hash = (53 * hash) + getPut().hashCode(); + break; + case 4: + hash = (37 * hash) + POST_FIELD_NUMBER; + hash = (53 * hash) + getPost().hashCode(); + break; + case 5: + hash = (37 * hash) + DELETE_FIELD_NUMBER; + hash = (53 * hash) + getDelete().hashCode(); + break; + case 6: + hash = (37 * hash) + PATCH_FIELD_NUMBER; + hash = (53 * hash) + getPatch().hashCode(); + break; + case 8: + hash = (37 * hash) + CUSTOM_FIELD_NUMBER; + hash = (53 * hash) + getCustom().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.api.HttpRule parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpRule parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.HttpRule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpRule 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.api.HttpRule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.api.HttpRule parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.api.HttpRule parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.HttpRule 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.api.HttpRule parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.api.HttpRule 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.api.HttpRule parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.api.HttpRule 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.api.HttpRule 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; + } + /** + *
+   * `HttpRule` defines the mapping of an RPC method to one or more HTTP
+   * REST API methods. The mapping specifies how different portions of the RPC
+   * request message are mapped to URL path, URL query parameters, and
+   * HTTP request body. The mapping is typically specified as an
+   * `google.api.http` annotation on the RPC method,
+   * see "google/api/annotations.proto" for details.
+   * The mapping consists of a field specifying the path template and
+   * method kind.  The path template can refer to fields in the request
+   * message, as in the example below which describes a REST GET
+   * operation on a resource collection of messages:
+   *     service Messaging {
+   *       rpc GetMessage(GetMessageRequest) returns (Message) {
+   *         option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
+   *       }
+   *     }
+   *     message GetMessageRequest {
+   *       message SubMessage {
+   *         string subfield = 1;
+   *       }
+   *       string message_id = 1; // mapped to the URL
+   *       SubMessage sub = 2;    // `sub.subfield` is url-mapped
+   *     }
+   *     message Message {
+   *       string text = 1; // content of the resource
+   *     }
+   * The same http annotation can alternatively be expressed inside the
+   * `GRPC API Configuration` YAML file.
+   *     http:
+   *       rules:
+   *         - selector: <proto_package_name>.Messaging.GetMessage
+   *           get: /v1/messages/{message_id}/{sub.subfield}
+   * This definition enables an automatic, bidrectional mapping of HTTP
+   * JSON to RPC. Example:
+   * HTTP | RPC
+   * -----|-----
+   * `GET /v1/messages/123456/foo`  | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
+   * In general, not only fields but also field paths can be referenced
+   * from a path pattern. Fields mapped to the path pattern cannot be
+   * repeated and must have a primitive (non-message) type.
+   * Any fields in the request message which are not bound by the path
+   * pattern automatically become (optional) HTTP query
+   * parameters. Assume the following definition of the request message:
+   *     service Messaging {
+   *       rpc GetMessage(GetMessageRequest) returns (Message) {
+   *         option (google.api.http).get = "/v1/messages/{message_id}";
+   *       }
+   *     }
+   *     message GetMessageRequest {
+   *       message SubMessage {
+   *         string subfield = 1;
+   *       }
+   *       string message_id = 1; // mapped to the URL
+   *       int64 revision = 2;    // becomes a parameter
+   *       SubMessage sub = 3;    // `sub.subfield` becomes a parameter
+   *     }
+   * This enables a HTTP JSON to RPC mapping as below:
+   * HTTP | RPC
+   * -----|-----
+   * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
+   * Note that fields which are mapped to HTTP parameters must have a
+   * primitive type or a repeated primitive type. Message types are not
+   * allowed. In the case of a repeated type, the parameter can be
+   * repeated in the URL, as in `...?param=A&param=B`.
+   * For HTTP method kinds which allow a request body, the `body` field
+   * specifies the mapping. Consider a REST update method on the
+   * message resource collection:
+   *     service Messaging {
+   *       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
+   *         option (google.api.http) = {
+   *           put: "/v1/messages/{message_id}"
+   *           body: "message"
+   *         };
+   *       }
+   *     }
+   *     message UpdateMessageRequest {
+   *       string message_id = 1; // mapped to the URL
+   *       Message message = 2;   // mapped to the body
+   *     }
+   * The following HTTP JSON to RPC mapping is enabled, where the
+   * representation of the JSON in the request body is determined by
+   * protos JSON encoding:
+   * HTTP | RPC
+   * -----|-----
+   * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
+   * The special name `*` can be used in the body mapping to define that
+   * every field not bound by the path template should be mapped to the
+   * request body.  This enables the following alternative definition of
+   * the update method:
+   *     service Messaging {
+   *       rpc UpdateMessage(Message) returns (Message) {
+   *         option (google.api.http) = {
+   *           put: "/v1/messages/{message_id}"
+   *           body: "*"
+   *         };
+   *       }
+   *     }
+   *     message Message {
+   *       string message_id = 1;
+   *       string text = 2;
+   *     }
+   * The following HTTP JSON to RPC mapping is enabled:
+   * HTTP | RPC
+   * -----|-----
+   * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
+   * Note that when using `*` in the body mapping, it is not possible to
+   * have HTTP parameters, as all fields not bound by the path end in
+   * the body. This makes this option more rarely used in practice of
+   * defining REST APIs. The common usage of `*` is in custom methods
+   * which don't use the URL at all for transferring data.
+   * It is possible to define multiple HTTP methods for one RPC by using
+   * the `additional_bindings` option. Example:
+   *     service Messaging {
+   *       rpc GetMessage(GetMessageRequest) returns (Message) {
+   *         option (google.api.http) = {
+   *           get: "/v1/messages/{message_id}"
+   *           additional_bindings {
+   *             get: "/v1/users/{user_id}/messages/{message_id}"
+   *           }
+   *         };
+   *       }
+   *     }
+   *     message GetMessageRequest {
+   *       string message_id = 1;
+   *       string user_id = 2;
+   *     }
+   * This enables the following two alternative HTTP JSON to RPC
+   * mappings:
+   * HTTP | RPC
+   * -----|-----
+   * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
+   * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
+   * # Rules for HTTP mapping
+   * The rules for mapping HTTP path, query parameters, and body fields
+   * to the request message are as follows:
+   * 1. The `body` field specifies either `*` or a field path, or is
+   *    omitted. If omitted, it indicates there is no HTTP request body.
+   * 2. Leaf fields (recursive expansion of nested messages in the
+   *    request) can be classified into three types:
+   *     (a) Matched in the URL template.
+   *     (b) Covered by body (if body is `*`, everything except (a) fields;
+   *         else everything under the body field)
+   *     (c) All other fields.
+   * 3. URL query parameters found in the HTTP request are mapped to (c) fields.
+   * 4. Any body sent with an HTTP request can contain only (b) fields.
+   * The syntax of the path template is as follows:
+   *     Template = "/" Segments [ Verb ] ;
+   *     Segments = Segment { "/" Segment } ;
+   *     Segment  = "*" | "**" | LITERAL | Variable ;
+   *     Variable = "{" FieldPath [ "=" Segments ] "}" ;
+   *     FieldPath = IDENT { "." IDENT } ;
+   *     Verb     = ":" LITERAL ;
+   * The syntax `*` matches a single path segment. The syntax `**` matches zero
+   * or more path segments, which must be the last part of the path except the
+   * `Verb`. The syntax `LITERAL` matches literal text in the path.
+   * The syntax `Variable` matches part of the URL path as specified by its
+   * template. A variable template must not contain other variables. If a variable
+   * matches a single path segment, its template may be omitted, e.g. `{var}`
+   * is equivalent to `{var=*}`.
+   * If a variable contains exactly one path segment, such as `"{var}"` or
+   * `"{var=*}"`, when such a variable is expanded into a URL path, all characters
+   * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
+   * Discovery Document as `{var}`.
+   * If a variable contains one or more path segments, such as `"{var=foo/*}"`
+   * or `"{var=**}"`, when such a variable is expanded into a URL path, all
+   * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
+   * show up in the Discovery Document as `{+var}`.
+   * NOTE: While the single segment variable matches the semantics of
+   * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
+   * Simple String Expansion, the multi segment variable **does not** match
+   * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
+   * does not expand special characters like `?` and `#`, which would lead
+   * to invalid URLs.
+   * NOTE: the field paths in variables and in the `body` must not refer to
+   * repeated fields or map fields.
+   * 
+ * + * Protobuf type {@code google.api.HttpRule} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.api.HttpRule) + com.google.api.HttpRuleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.api.HttpProto.internal_static_google_api_HttpRule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.api.HttpRule.class, com.google.api.HttpRule.Builder.class); + } + + // Construct using com.google.api.HttpRule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getAdditionalBindingsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + selector_ = ""; + + body_ = ""; + + responseBody_ = ""; + + if (additionalBindingsBuilder_ == null) { + additionalBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + additionalBindingsBuilder_.clear(); + } + patternCase_ = 0; + pattern_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.api.HttpProto.internal_static_google_api_HttpRule_descriptor; + } + + @java.lang.Override + public com.google.api.HttpRule getDefaultInstanceForType() { + return com.google.api.HttpRule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.api.HttpRule build() { + com.google.api.HttpRule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.api.HttpRule buildPartial() { + com.google.api.HttpRule result = new com.google.api.HttpRule(this); + int from_bitField0_ = bitField0_; + result.selector_ = selector_; + if (patternCase_ == 2) { + result.pattern_ = pattern_; + } + if (patternCase_ == 3) { + result.pattern_ = pattern_; + } + if (patternCase_ == 4) { + result.pattern_ = pattern_; + } + if (patternCase_ == 5) { + result.pattern_ = pattern_; + } + if (patternCase_ == 6) { + result.pattern_ = pattern_; + } + if (patternCase_ == 8) { + if (customBuilder_ == null) { + result.pattern_ = pattern_; + } else { + result.pattern_ = customBuilder_.build(); + } + } + result.body_ = body_; + result.responseBody_ = responseBody_; + if (additionalBindingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + additionalBindings_ = java.util.Collections.unmodifiableList(additionalBindings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.additionalBindings_ = additionalBindings_; + } else { + result.additionalBindings_ = additionalBindingsBuilder_.build(); + } + result.patternCase_ = patternCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.api.HttpRule) { + return mergeFrom((com.google.api.HttpRule)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.api.HttpRule other) { + if (other == com.google.api.HttpRule.getDefaultInstance()) return this; + if (!other.getSelector().isEmpty()) { + selector_ = other.selector_; + onChanged(); + } + if (!other.getBody().isEmpty()) { + body_ = other.body_; + onChanged(); + } + if (!other.getResponseBody().isEmpty()) { + responseBody_ = other.responseBody_; + onChanged(); + } + if (additionalBindingsBuilder_ == null) { + if (!other.additionalBindings_.isEmpty()) { + if (additionalBindings_.isEmpty()) { + additionalBindings_ = other.additionalBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAdditionalBindingsIsMutable(); + additionalBindings_.addAll(other.additionalBindings_); + } + onChanged(); + } + } else { + if (!other.additionalBindings_.isEmpty()) { + if (additionalBindingsBuilder_.isEmpty()) { + additionalBindingsBuilder_.dispose(); + additionalBindingsBuilder_ = null; + additionalBindings_ = other.additionalBindings_; + bitField0_ = (bitField0_ & ~0x00000001); + additionalBindingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getAdditionalBindingsFieldBuilder() : null; + } else { + additionalBindingsBuilder_.addAllMessages(other.additionalBindings_); + } + } + } + switch (other.getPatternCase()) { + case GET: { + patternCase_ = 2; + pattern_ = other.pattern_; + onChanged(); + break; + } + case PUT: { + patternCase_ = 3; + pattern_ = other.pattern_; + onChanged(); + break; + } + case POST: { + patternCase_ = 4; + pattern_ = other.pattern_; + onChanged(); + break; + } + case DELETE: { + patternCase_ = 5; + pattern_ = other.pattern_; + onChanged(); + break; + } + case PATCH: { + patternCase_ = 6; + pattern_ = other.pattern_; + onChanged(); + break; + } + case CUSTOM: { + mergeCustom(other.getCustom()); + break; + } + case PATTERN_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.api.HttpRule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.api.HttpRule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int patternCase_ = 0; + private java.lang.Object pattern_; + public PatternCase + getPatternCase() { + return PatternCase.forNumber( + patternCase_); + } + + public Builder clearPattern() { + patternCase_ = 0; + pattern_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private java.lang.Object selector_ = ""; + /** + *
+     * Selects methods to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * @return The selector. + */ + public java.lang.String getSelector() { + java.lang.Object ref = selector_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + selector_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Selects methods to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * @return The bytes for selector. + */ + public com.google.protobuf.ByteString + getSelectorBytes() { + java.lang.Object ref = selector_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + selector_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Selects methods to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * @param value The selector to set. + * @return This builder for chaining. + */ + public Builder setSelector( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + selector_ = value; + onChanged(); + return this; + } + /** + *
+     * Selects methods to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * @return This builder for chaining. + */ + public Builder clearSelector() { + + selector_ = getDefaultInstance().getSelector(); + onChanged(); + return this; + } + /** + *
+     * Selects methods to which this rule applies.
+     * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+     * 
+ * + * string selector = 1; + * @param value The bytes for selector to set. + * @return This builder for chaining. + */ + public Builder setSelectorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + selector_ = value; + onChanged(); + return this; + } + + /** + *
+     * Used for listing and getting information about resources.
+     * 
+ * + * string get = 2; + * @return The get. + */ + @java.lang.Override + public java.lang.String getGet() { + java.lang.Object ref = ""; + if (patternCase_ == 2) { + ref = pattern_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 2) { + pattern_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Used for listing and getting information about resources.
+     * 
+ * + * string get = 2; + * @return The bytes for get. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGetBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 2) { + ref = pattern_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 2) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Used for listing and getting information about resources.
+     * 
+ * + * string get = 2; + * @param value The get to set. + * @return This builder for chaining. + */ + public Builder setGet( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + patternCase_ = 2; + pattern_ = value; + onChanged(); + return this; + } + /** + *
+     * Used for listing and getting information about resources.
+     * 
+ * + * string get = 2; + * @return This builder for chaining. + */ + public Builder clearGet() { + if (patternCase_ == 2) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Used for listing and getting information about resources.
+     * 
+ * + * string get = 2; + * @param value The bytes for get to set. + * @return This builder for chaining. + */ + public Builder setGetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + patternCase_ = 2; + pattern_ = value; + onChanged(); + return this; + } + + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string put = 3; + * @return The put. + */ + @java.lang.Override + public java.lang.String getPut() { + java.lang.Object ref = ""; + if (patternCase_ == 3) { + ref = pattern_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 3) { + pattern_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string put = 3; + * @return The bytes for put. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPutBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 3) { + ref = pattern_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 3) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string put = 3; + * @param value The put to set. + * @return This builder for chaining. + */ + public Builder setPut( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + patternCase_ = 3; + pattern_ = value; + onChanged(); + return this; + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string put = 3; + * @return This builder for chaining. + */ + public Builder clearPut() { + if (patternCase_ == 3) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string put = 3; + * @param value The bytes for put to set. + * @return This builder for chaining. + */ + public Builder setPutBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + patternCase_ = 3; + pattern_ = value; + onChanged(); + return this; + } + + /** + *
+     * Used for creating a resource.
+     * 
+ * + * string post = 4; + * @return The post. + */ + @java.lang.Override + public java.lang.String getPost() { + java.lang.Object ref = ""; + if (patternCase_ == 4) { + ref = pattern_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 4) { + pattern_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Used for creating a resource.
+     * 
+ * + * string post = 4; + * @return The bytes for post. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPostBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 4) { + ref = pattern_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 4) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Used for creating a resource.
+     * 
+ * + * string post = 4; + * @param value The post to set. + * @return This builder for chaining. + */ + public Builder setPost( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + patternCase_ = 4; + pattern_ = value; + onChanged(); + return this; + } + /** + *
+     * Used for creating a resource.
+     * 
+ * + * string post = 4; + * @return This builder for chaining. + */ + public Builder clearPost() { + if (patternCase_ == 4) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Used for creating a resource.
+     * 
+ * + * string post = 4; + * @param value The bytes for post to set. + * @return This builder for chaining. + */ + public Builder setPostBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + patternCase_ = 4; + pattern_ = value; + onChanged(); + return this; + } + + /** + *
+     * Used for deleting a resource.
+     * 
+ * + * string delete = 5; + * @return The delete. + */ + @java.lang.Override + public java.lang.String getDelete() { + java.lang.Object ref = ""; + if (patternCase_ == 5) { + ref = pattern_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 5) { + pattern_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Used for deleting a resource.
+     * 
+ * + * string delete = 5; + * @return The bytes for delete. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDeleteBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 5) { + ref = pattern_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 5) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Used for deleting a resource.
+     * 
+ * + * string delete = 5; + * @param value The delete to set. + * @return This builder for chaining. + */ + public Builder setDelete( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + patternCase_ = 5; + pattern_ = value; + onChanged(); + return this; + } + /** + *
+     * Used for deleting a resource.
+     * 
+ * + * string delete = 5; + * @return This builder for chaining. + */ + public Builder clearDelete() { + if (patternCase_ == 5) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Used for deleting a resource.
+     * 
+ * + * string delete = 5; + * @param value The bytes for delete to set. + * @return This builder for chaining. + */ + public Builder setDeleteBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + patternCase_ = 5; + pattern_ = value; + onChanged(); + return this; + } + + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string patch = 6; + * @return The patch. + */ + @java.lang.Override + public java.lang.String getPatch() { + java.lang.Object ref = ""; + if (patternCase_ == 6) { + ref = pattern_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (patternCase_ == 6) { + pattern_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string patch = 6; + * @return The bytes for patch. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPatchBytes() { + java.lang.Object ref = ""; + if (patternCase_ == 6) { + ref = pattern_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (patternCase_ == 6) { + pattern_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string patch = 6; + * @param value The patch to set. + * @return This builder for chaining. + */ + public Builder setPatch( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + patternCase_ = 6; + pattern_ = value; + onChanged(); + return this; + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string patch = 6; + * @return This builder for chaining. + */ + public Builder clearPatch() { + if (patternCase_ == 6) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + return this; + } + /** + *
+     * Used for updating a resource.
+     * 
+ * + * string patch = 6; + * @param value The bytes for patch to set. + * @return This builder for chaining. + */ + public Builder setPatchBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + patternCase_ = 6; + pattern_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder> customBuilder_; + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return Whether the custom field is set. + */ + @java.lang.Override + public boolean hasCustom() { + return patternCase_ == 8; + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return The custom. + */ + @java.lang.Override + public com.google.api.CustomHttpPattern getCustom() { + if (customBuilder_ == null) { + if (patternCase_ == 8) { + return (com.google.api.CustomHttpPattern) pattern_; + } + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } else { + if (patternCase_ == 8) { + return customBuilder_.getMessage(); + } + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + public Builder setCustom(com.google.api.CustomHttpPattern value) { + if (customBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pattern_ = value; + onChanged(); + } else { + customBuilder_.setMessage(value); + } + patternCase_ = 8; + return this; + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + public Builder setCustom( + com.google.api.CustomHttpPattern.Builder builderForValue) { + if (customBuilder_ == null) { + pattern_ = builderForValue.build(); + onChanged(); + } else { + customBuilder_.setMessage(builderForValue.build()); + } + patternCase_ = 8; + return this; + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + public Builder mergeCustom(com.google.api.CustomHttpPattern value) { + if (customBuilder_ == null) { + if (patternCase_ == 8 && + pattern_ != com.google.api.CustomHttpPattern.getDefaultInstance()) { + pattern_ = com.google.api.CustomHttpPattern.newBuilder((com.google.api.CustomHttpPattern) pattern_) + .mergeFrom(value).buildPartial(); + } else { + pattern_ = value; + } + onChanged(); + } else { + if (patternCase_ == 8) { + customBuilder_.mergeFrom(value); + } + customBuilder_.setMessage(value); + } + patternCase_ = 8; + return this; + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + public Builder clearCustom() { + if (customBuilder_ == null) { + if (patternCase_ == 8) { + patternCase_ = 0; + pattern_ = null; + onChanged(); + } + } else { + if (patternCase_ == 8) { + patternCase_ = 0; + pattern_ = null; + } + customBuilder_.clear(); + } + return this; + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + public com.google.api.CustomHttpPattern.Builder getCustomBuilder() { + return getCustomFieldBuilder().getBuilder(); + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + @java.lang.Override + public com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder() { + if ((patternCase_ == 8) && (customBuilder_ != null)) { + return customBuilder_.getMessageOrBuilder(); + } else { + if (patternCase_ == 8) { + return (com.google.api.CustomHttpPattern) pattern_; + } + return com.google.api.CustomHttpPattern.getDefaultInstance(); + } + } + /** + *
+     * The custom pattern is used for specifying an HTTP method that is not
+     * included in the `pattern` field, such as HEAD, or "*" to leave the
+     * HTTP method unspecified for this rule. The wild-card rule is useful
+     * for services that provide content to Web (HTML) clients.
+     * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder> + getCustomFieldBuilder() { + if (customBuilder_ == null) { + if (!(patternCase_ == 8)) { + pattern_ = com.google.api.CustomHttpPattern.getDefaultInstance(); + } + customBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.api.CustomHttpPattern, com.google.api.CustomHttpPattern.Builder, com.google.api.CustomHttpPatternOrBuilder>( + (com.google.api.CustomHttpPattern) pattern_, + getParentForChildren(), + isClean()); + pattern_ = null; + } + patternCase_ = 8; + onChanged();; + return customBuilder_; + } + + private java.lang.Object body_ = ""; + /** + *
+     * The name of the request field whose value is mapped to the HTTP body, or
+     * `*` for mapping all fields not captured by the path pattern to the HTTP
+     * body. NOTE: the referred field must not be a repeated field and must be
+     * present at the top-level of request message type.
+     * 
+ * + * string body = 7; + * @return The body. + */ + public java.lang.String getBody() { + java.lang.Object ref = body_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + body_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the request field whose value is mapped to the HTTP body, or
+     * `*` for mapping all fields not captured by the path pattern to the HTTP
+     * body. NOTE: the referred field must not be a repeated field and must be
+     * present at the top-level of request message type.
+     * 
+ * + * string body = 7; + * @return The bytes for body. + */ + public com.google.protobuf.ByteString + getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the request field whose value is mapped to the HTTP body, or
+     * `*` for mapping all fields not captured by the path pattern to the HTTP
+     * body. NOTE: the referred field must not be a repeated field and must be
+     * present at the top-level of request message type.
+     * 
+ * + * string body = 7; + * @param value The body to set. + * @return This builder for chaining. + */ + public Builder setBody( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the request field whose value is mapped to the HTTP body, or
+     * `*` for mapping all fields not captured by the path pattern to the HTTP
+     * body. NOTE: the referred field must not be a repeated field and must be
+     * present at the top-level of request message type.
+     * 
+ * + * string body = 7; + * @return This builder for chaining. + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + /** + *
+     * The name of the request field whose value is mapped to the HTTP body, or
+     * `*` for mapping all fields not captured by the path pattern to the HTTP
+     * body. NOTE: the referred field must not be a repeated field and must be
+     * present at the top-level of request message type.
+     * 
+ * + * string body = 7; + * @param value The bytes for body to set. + * @return This builder for chaining. + */ + public Builder setBodyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + body_ = value; + onChanged(); + return this; + } + + private java.lang.Object responseBody_ = ""; + /** + *
+     * Optional. The name of the response field whose value is mapped to the HTTP
+     * body of response. Other response fields are ignored. When
+     * not set, the response message will be used as HTTP body of response.
+     * 
+ * + * string response_body = 12; + * @return The responseBody. + */ + public java.lang.String getResponseBody() { + java.lang.Object ref = responseBody_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + responseBody_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. The name of the response field whose value is mapped to the HTTP
+     * body of response. Other response fields are ignored. When
+     * not set, the response message will be used as HTTP body of response.
+     * 
+ * + * string response_body = 12; + * @return The bytes for responseBody. + */ + public com.google.protobuf.ByteString + getResponseBodyBytes() { + java.lang.Object ref = responseBody_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + responseBody_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. The name of the response field whose value is mapped to the HTTP
+     * body of response. Other response fields are ignored. When
+     * not set, the response message will be used as HTTP body of response.
+     * 
+ * + * string response_body = 12; + * @param value The responseBody to set. + * @return This builder for chaining. + */ + public Builder setResponseBody( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + responseBody_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. The name of the response field whose value is mapped to the HTTP
+     * body of response. Other response fields are ignored. When
+     * not set, the response message will be used as HTTP body of response.
+     * 
+ * + * string response_body = 12; + * @return This builder for chaining. + */ + public Builder clearResponseBody() { + + responseBody_ = getDefaultInstance().getResponseBody(); + onChanged(); + return this; + } + /** + *
+     * Optional. The name of the response field whose value is mapped to the HTTP
+     * body of response. Other response fields are ignored. When
+     * not set, the response message will be used as HTTP body of response.
+     * 
+ * + * string response_body = 12; + * @param value The bytes for responseBody to set. + * @return This builder for chaining. + */ + public Builder setResponseBodyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + responseBody_ = value; + onChanged(); + return this; + } + + private java.util.List additionalBindings_ = + java.util.Collections.emptyList(); + private void ensureAdditionalBindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + additionalBindings_ = new java.util.ArrayList(additionalBindings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> additionalBindingsBuilder_; + + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public java.util.List getAdditionalBindingsList() { + if (additionalBindingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(additionalBindings_); + } else { + return additionalBindingsBuilder_.getMessageList(); + } + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public int getAdditionalBindingsCount() { + if (additionalBindingsBuilder_ == null) { + return additionalBindings_.size(); + } else { + return additionalBindingsBuilder_.getCount(); + } + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public com.google.api.HttpRule getAdditionalBindings(int index) { + if (additionalBindingsBuilder_ == null) { + return additionalBindings_.get(index); + } else { + return additionalBindingsBuilder_.getMessage(index); + } + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder setAdditionalBindings( + int index, com.google.api.HttpRule value) { + if (additionalBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalBindingsIsMutable(); + additionalBindings_.set(index, value); + onChanged(); + } else { + additionalBindingsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder setAdditionalBindings( + int index, com.google.api.HttpRule.Builder builderForValue) { + if (additionalBindingsBuilder_ == null) { + ensureAdditionalBindingsIsMutable(); + additionalBindings_.set(index, builderForValue.build()); + onChanged(); + } else { + additionalBindingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder addAdditionalBindings(com.google.api.HttpRule value) { + if (additionalBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalBindingsIsMutable(); + additionalBindings_.add(value); + onChanged(); + } else { + additionalBindingsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder addAdditionalBindings( + int index, com.google.api.HttpRule value) { + if (additionalBindingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAdditionalBindingsIsMutable(); + additionalBindings_.add(index, value); + onChanged(); + } else { + additionalBindingsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder addAdditionalBindings( + com.google.api.HttpRule.Builder builderForValue) { + if (additionalBindingsBuilder_ == null) { + ensureAdditionalBindingsIsMutable(); + additionalBindings_.add(builderForValue.build()); + onChanged(); + } else { + additionalBindingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder addAdditionalBindings( + int index, com.google.api.HttpRule.Builder builderForValue) { + if (additionalBindingsBuilder_ == null) { + ensureAdditionalBindingsIsMutable(); + additionalBindings_.add(index, builderForValue.build()); + onChanged(); + } else { + additionalBindingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder addAllAdditionalBindings( + java.lang.Iterable values) { + if (additionalBindingsBuilder_ == null) { + ensureAdditionalBindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, additionalBindings_); + onChanged(); + } else { + additionalBindingsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder clearAdditionalBindings() { + if (additionalBindingsBuilder_ == null) { + additionalBindings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + additionalBindingsBuilder_.clear(); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public Builder removeAdditionalBindings(int index) { + if (additionalBindingsBuilder_ == null) { + ensureAdditionalBindingsIsMutable(); + additionalBindings_.remove(index); + onChanged(); + } else { + additionalBindingsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public com.google.api.HttpRule.Builder getAdditionalBindingsBuilder( + int index) { + return getAdditionalBindingsFieldBuilder().getBuilder(index); + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder( + int index) { + if (additionalBindingsBuilder_ == null) { + return additionalBindings_.get(index); } else { + return additionalBindingsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public java.util.List + getAdditionalBindingsOrBuilderList() { + if (additionalBindingsBuilder_ != null) { + return additionalBindingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(additionalBindings_); + } + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder() { + return getAdditionalBindingsFieldBuilder().addBuilder( + com.google.api.HttpRule.getDefaultInstance()); + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public com.google.api.HttpRule.Builder addAdditionalBindingsBuilder( + int index) { + return getAdditionalBindingsFieldBuilder().addBuilder( + index, com.google.api.HttpRule.getDefaultInstance()); + } + /** + *
+     * Additional HTTP bindings for the selector. Nested bindings must
+     * not contain an `additional_bindings` field themselves (that is,
+     * the nesting may only be one level deep).
+     * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + public java.util.List + getAdditionalBindingsBuilderList() { + return getAdditionalBindingsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder> + getAdditionalBindingsFieldBuilder() { + if (additionalBindingsBuilder_ == null) { + additionalBindingsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.api.HttpRule, com.google.api.HttpRule.Builder, com.google.api.HttpRuleOrBuilder>( + additionalBindings_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + additionalBindings_ = null; + } + return additionalBindingsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.api.HttpRule) + } + + // @@protoc_insertion_point(class_scope:google.api.HttpRule) + private static final com.google.api.HttpRule DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.api.HttpRule(); + } + + public static com.google.api.HttpRule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HttpRule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HttpRule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.api.HttpRule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/api/HttpRuleOrBuilder.java b/src/main/java/com/google/api/HttpRuleOrBuilder.java new file mode 100644 index 0000000..5106916 --- /dev/null +++ b/src/main/java/com/google/api/HttpRuleOrBuilder.java @@ -0,0 +1,273 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/api/http.proto + +package com.google.api; + +public interface HttpRuleOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.api.HttpRule) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Selects methods to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * @return The selector. + */ + java.lang.String getSelector(); + /** + *
+   * Selects methods to which this rule applies.
+   * Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
+   * 
+ * + * string selector = 1; + * @return The bytes for selector. + */ + com.google.protobuf.ByteString + getSelectorBytes(); + + /** + *
+   * Used for listing and getting information about resources.
+   * 
+ * + * string get = 2; + * @return The get. + */ + java.lang.String getGet(); + /** + *
+   * Used for listing and getting information about resources.
+   * 
+ * + * string get = 2; + * @return The bytes for get. + */ + com.google.protobuf.ByteString + getGetBytes(); + + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string put = 3; + * @return The put. + */ + java.lang.String getPut(); + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string put = 3; + * @return The bytes for put. + */ + com.google.protobuf.ByteString + getPutBytes(); + + /** + *
+   * Used for creating a resource.
+   * 
+ * + * string post = 4; + * @return The post. + */ + java.lang.String getPost(); + /** + *
+   * Used for creating a resource.
+   * 
+ * + * string post = 4; + * @return The bytes for post. + */ + com.google.protobuf.ByteString + getPostBytes(); + + /** + *
+   * Used for deleting a resource.
+   * 
+ * + * string delete = 5; + * @return The delete. + */ + java.lang.String getDelete(); + /** + *
+   * Used for deleting a resource.
+   * 
+ * + * string delete = 5; + * @return The bytes for delete. + */ + com.google.protobuf.ByteString + getDeleteBytes(); + + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string patch = 6; + * @return The patch. + */ + java.lang.String getPatch(); + /** + *
+   * Used for updating a resource.
+   * 
+ * + * string patch = 6; + * @return The bytes for patch. + */ + com.google.protobuf.ByteString + getPatchBytes(); + + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return Whether the custom field is set. + */ + boolean hasCustom(); + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + * @return The custom. + */ + com.google.api.CustomHttpPattern getCustom(); + /** + *
+   * The custom pattern is used for specifying an HTTP method that is not
+   * included in the `pattern` field, such as HEAD, or "*" to leave the
+   * HTTP method unspecified for this rule. The wild-card rule is useful
+   * for services that provide content to Web (HTML) clients.
+   * 
+ * + * .google.api.CustomHttpPattern custom = 8; + */ + com.google.api.CustomHttpPatternOrBuilder getCustomOrBuilder(); + + /** + *
+   * The name of the request field whose value is mapped to the HTTP body, or
+   * `*` for mapping all fields not captured by the path pattern to the HTTP
+   * body. NOTE: the referred field must not be a repeated field and must be
+   * present at the top-level of request message type.
+   * 
+ * + * string body = 7; + * @return The body. + */ + java.lang.String getBody(); + /** + *
+   * The name of the request field whose value is mapped to the HTTP body, or
+   * `*` for mapping all fields not captured by the path pattern to the HTTP
+   * body. NOTE: the referred field must not be a repeated field and must be
+   * present at the top-level of request message type.
+   * 
+ * + * string body = 7; + * @return The bytes for body. + */ + com.google.protobuf.ByteString + getBodyBytes(); + + /** + *
+   * Optional. The name of the response field whose value is mapped to the HTTP
+   * body of response. Other response fields are ignored. When
+   * not set, the response message will be used as HTTP body of response.
+   * 
+ * + * string response_body = 12; + * @return The responseBody. + */ + java.lang.String getResponseBody(); + /** + *
+   * Optional. The name of the response field whose value is mapped to the HTTP
+   * body of response. Other response fields are ignored. When
+   * not set, the response message will be used as HTTP body of response.
+   * 
+ * + * string response_body = 12; + * @return The bytes for responseBody. + */ + com.google.protobuf.ByteString + getResponseBodyBytes(); + + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + java.util.List + getAdditionalBindingsList(); + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + com.google.api.HttpRule getAdditionalBindings(int index); + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + int getAdditionalBindingsCount(); + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + java.util.List + getAdditionalBindingsOrBuilderList(); + /** + *
+   * Additional HTTP bindings for the selector. Nested bindings must
+   * not contain an `additional_bindings` field themselves (that is,
+   * the nesting may only be one level deep).
+   * 
+ * + * repeated .google.api.HttpRule additional_bindings = 11; + */ + com.google.api.HttpRuleOrBuilder getAdditionalBindingsOrBuilder( + int index); + + public com.google.api.HttpRule.PatternCase getPatternCase(); +} diff --git a/src/main/java/com/google/rpc/BadRequest.java b/src/main/java/com/google/rpc/BadRequest.java new file mode 100644 index 0000000..90b1a02 --- /dev/null +++ b/src/main/java/com/google/rpc/BadRequest.java @@ -0,0 +1,1688 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes violations in a client request. This error type focuses on the
+ * syntactic aspects of the request.
+ * 
+ * + * Protobuf type {@code google.rpc.BadRequest} + */ +public final class BadRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.BadRequest) + BadRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use BadRequest.newBuilder() to construct. + private BadRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BadRequest() { + fieldViolations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BadRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BadRequest( + 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) != 0)) { + fieldViolations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fieldViolations_.add( + input.readMessage(com.google.rpc.BadRequest.FieldViolation.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + fieldViolations_ = java.util.Collections.unmodifiableList(fieldViolations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.BadRequest.class, com.google.rpc.BadRequest.Builder.class); + } + + public interface FieldViolationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.BadRequest.FieldViolation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * A path leading to a field in the request body. The value will be a
+     * sequence of dot-separated identifiers that identify a protocol buffer
+     * field. E.g., "field_violations.field" would identify this field.
+     * 
+ * + * string field = 1; + * @return The field. + */ + java.lang.String getField(); + /** + *
+     * A path leading to a field in the request body. The value will be a
+     * sequence of dot-separated identifiers that identify a protocol buffer
+     * field. E.g., "field_violations.field" would identify this field.
+     * 
+ * + * string field = 1; + * @return The bytes for field. + */ + com.google.protobuf.ByteString + getFieldBytes(); + + /** + *
+     * A description of why the request element is bad.
+     * 
+ * + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+     * A description of why the request element is bad.
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
+   * A message type used to describe a single bad request field.
+   * 
+ * + * Protobuf type {@code google.rpc.BadRequest.FieldViolation} + */ + public static final class FieldViolation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.BadRequest.FieldViolation) + FieldViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use FieldViolation.newBuilder() to construct. + private FieldViolation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FieldViolation() { + field_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FieldViolation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FieldViolation( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + field_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_FieldViolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.BadRequest.FieldViolation.class, com.google.rpc.BadRequest.FieldViolation.Builder.class); + } + + public static final int FIELD_FIELD_NUMBER = 1; + private volatile java.lang.Object field_; + /** + *
+     * A path leading to a field in the request body. The value will be a
+     * sequence of dot-separated identifiers that identify a protocol buffer
+     * field. E.g., "field_violations.field" would identify this field.
+     * 
+ * + * string field = 1; + * @return The field. + */ + @java.lang.Override + public java.lang.String getField() { + java.lang.Object ref = field_; + 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(); + field_ = s; + return s; + } + } + /** + *
+     * A path leading to a field in the request body. The value will be a
+     * sequence of dot-separated identifiers that identify a protocol buffer
+     * field. E.g., "field_violations.field" would identify this field.
+     * 
+ * + * string field = 1; + * @return The bytes for field. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+     * A description of why the request element is bad.
+     * 
+ * + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * A description of why the request element is bad.
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getFieldBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, field_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFieldBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, field_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.BadRequest.FieldViolation)) { + return super.equals(obj); + } + com.google.rpc.BadRequest.FieldViolation other = (com.google.rpc.BadRequest.FieldViolation) obj; + + if (!getField() + .equals(other.getField())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FIELD_FIELD_NUMBER; + hash = (53 * hash) + getField().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.BadRequest.FieldViolation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest.FieldViolation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.BadRequest.FieldViolation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest.FieldViolation 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.rpc.BadRequest.FieldViolation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest.FieldViolation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.BadRequest.FieldViolation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest.FieldViolation 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.rpc.BadRequest.FieldViolation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest.FieldViolation 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.rpc.BadRequest.FieldViolation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest.FieldViolation 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.rpc.BadRequest.FieldViolation 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 message type used to describe a single bad request field.
+     * 
+ * + * Protobuf type {@code google.rpc.BadRequest.FieldViolation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.BadRequest.FieldViolation) + com.google.rpc.BadRequest.FieldViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_FieldViolation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.BadRequest.FieldViolation.class, com.google.rpc.BadRequest.FieldViolation.Builder.class); + } + + // Construct using com.google.rpc.BadRequest.FieldViolation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + field_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_FieldViolation_descriptor; + } + + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolation getDefaultInstanceForType() { + return com.google.rpc.BadRequest.FieldViolation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolation build() { + com.google.rpc.BadRequest.FieldViolation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolation buildPartial() { + com.google.rpc.BadRequest.FieldViolation result = new com.google.rpc.BadRequest.FieldViolation(this); + result.field_ = field_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.BadRequest.FieldViolation) { + return mergeFrom((com.google.rpc.BadRequest.FieldViolation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.BadRequest.FieldViolation other) { + if (other == com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()) return this; + if (!other.getField().isEmpty()) { + field_ = other.field_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.BadRequest.FieldViolation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.BadRequest.FieldViolation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object field_ = ""; + /** + *
+       * A path leading to a field in the request body. The value will be a
+       * sequence of dot-separated identifiers that identify a protocol buffer
+       * field. E.g., "field_violations.field" would identify this field.
+       * 
+ * + * string field = 1; + * @return The field. + */ + public java.lang.String getField() { + java.lang.Object ref = field_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + field_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A path leading to a field in the request body. The value will be a
+       * sequence of dot-separated identifiers that identify a protocol buffer
+       * field. E.g., "field_violations.field" would identify this field.
+       * 
+ * + * string field = 1; + * @return The bytes for field. + */ + public com.google.protobuf.ByteString + getFieldBytes() { + java.lang.Object ref = field_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + field_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A path leading to a field in the request body. The value will be a
+       * sequence of dot-separated identifiers that identify a protocol buffer
+       * field. E.g., "field_violations.field" would identify this field.
+       * 
+ * + * string field = 1; + * @param value The field to set. + * @return This builder for chaining. + */ + public Builder setField( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + field_ = value; + onChanged(); + return this; + } + /** + *
+       * A path leading to a field in the request body. The value will be a
+       * sequence of dot-separated identifiers that identify a protocol buffer
+       * field. E.g., "field_violations.field" would identify this field.
+       * 
+ * + * string field = 1; + * @return This builder for chaining. + */ + public Builder clearField() { + + field_ = getDefaultInstance().getField(); + onChanged(); + return this; + } + /** + *
+       * A path leading to a field in the request body. The value will be a
+       * sequence of dot-separated identifiers that identify a protocol buffer
+       * field. E.g., "field_violations.field" would identify this field.
+       * 
+ * + * string field = 1; + * @param value The bytes for field to set. + * @return This builder for chaining. + */ + public Builder setFieldBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + field_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * A description of why the request element is bad.
+       * 
+ * + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A description of why the request element is bad.
+       * 
+ * + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A description of why the request element is bad.
+       * 
+ * + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * A description of why the request element is bad.
+       * 
+ * + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * A description of why the request element is bad.
+       * 
+ * + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.BadRequest.FieldViolation) + } + + // @@protoc_insertion_point(class_scope:google.rpc.BadRequest.FieldViolation) + private static final com.google.rpc.BadRequest.FieldViolation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.BadRequest.FieldViolation(); + } + + public static com.google.rpc.BadRequest.FieldViolation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FieldViolation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FieldViolation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int FIELD_VIOLATIONS_FIELD_NUMBER = 1; + private java.util.List fieldViolations_; + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + @java.lang.Override + public java.util.List getFieldViolationsList() { + return fieldViolations_; + } + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + @java.lang.Override + public java.util.List + getFieldViolationsOrBuilderList() { + return fieldViolations_; + } + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + @java.lang.Override + public int getFieldViolationsCount() { + return fieldViolations_.size(); + } + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index) { + return fieldViolations_.get(index); + } + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + @java.lang.Override + public com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBuilder( + int index) { + return fieldViolations_.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 < fieldViolations_.size(); i++) { + output.writeMessage(1, fieldViolations_.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 < fieldViolations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, fieldViolations_.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.rpc.BadRequest)) { + return super.equals(obj); + } + com.google.rpc.BadRequest other = (com.google.rpc.BadRequest) obj; + + if (!getFieldViolationsList() + .equals(other.getFieldViolationsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFieldViolationsCount() > 0) { + hash = (37 * hash) + FIELD_VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getFieldViolationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.BadRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.BadRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest 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.rpc.BadRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.BadRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.BadRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest 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.rpc.BadRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest 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.rpc.BadRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.BadRequest 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.rpc.BadRequest 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; + } + /** + *
+   * Describes violations in a client request. This error type focuses on the
+   * syntactic aspects of the request.
+   * 
+ * + * Protobuf type {@code google.rpc.BadRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.BadRequest) + com.google.rpc.BadRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.BadRequest.class, com.google.rpc.BadRequest.Builder.class); + } + + // Construct using com.google.rpc.BadRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFieldViolationsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (fieldViolationsBuilder_ == null) { + fieldViolations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + fieldViolationsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_BadRequest_descriptor; + } + + @java.lang.Override + public com.google.rpc.BadRequest getDefaultInstanceForType() { + return com.google.rpc.BadRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.BadRequest build() { + com.google.rpc.BadRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.BadRequest buildPartial() { + com.google.rpc.BadRequest result = new com.google.rpc.BadRequest(this); + int from_bitField0_ = bitField0_; + if (fieldViolationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + fieldViolations_ = java.util.Collections.unmodifiableList(fieldViolations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fieldViolations_ = fieldViolations_; + } else { + result.fieldViolations_ = fieldViolationsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.BadRequest) { + return mergeFrom((com.google.rpc.BadRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.BadRequest other) { + if (other == com.google.rpc.BadRequest.getDefaultInstance()) return this; + if (fieldViolationsBuilder_ == null) { + if (!other.fieldViolations_.isEmpty()) { + if (fieldViolations_.isEmpty()) { + fieldViolations_ = other.fieldViolations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldViolationsIsMutable(); + fieldViolations_.addAll(other.fieldViolations_); + } + onChanged(); + } + } else { + if (!other.fieldViolations_.isEmpty()) { + if (fieldViolationsBuilder_.isEmpty()) { + fieldViolationsBuilder_.dispose(); + fieldViolationsBuilder_ = null; + fieldViolations_ = other.fieldViolations_; + bitField0_ = (bitField0_ & ~0x00000001); + fieldViolationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFieldViolationsFieldBuilder() : null; + } else { + fieldViolationsBuilder_.addAllMessages(other.fieldViolations_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.BadRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.BadRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List fieldViolations_ = + java.util.Collections.emptyList(); + private void ensureFieldViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fieldViolations_ = new java.util.ArrayList(fieldViolations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder> fieldViolationsBuilder_; + + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public java.util.List getFieldViolationsList() { + if (fieldViolationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(fieldViolations_); + } else { + return fieldViolationsBuilder_.getMessageList(); + } + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public int getFieldViolationsCount() { + if (fieldViolationsBuilder_ == null) { + return fieldViolations_.size(); + } else { + return fieldViolationsBuilder_.getCount(); + } + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index) { + if (fieldViolationsBuilder_ == null) { + return fieldViolations_.get(index); + } else { + return fieldViolationsBuilder_.getMessage(index); + } + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder setFieldViolations( + int index, com.google.rpc.BadRequest.FieldViolation value) { + if (fieldViolationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldViolationsIsMutable(); + fieldViolations_.set(index, value); + onChanged(); + } else { + fieldViolationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder setFieldViolations( + int index, com.google.rpc.BadRequest.FieldViolation.Builder builderForValue) { + if (fieldViolationsBuilder_ == null) { + ensureFieldViolationsIsMutable(); + fieldViolations_.set(index, builderForValue.build()); + onChanged(); + } else { + fieldViolationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder addFieldViolations(com.google.rpc.BadRequest.FieldViolation value) { + if (fieldViolationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldViolationsIsMutable(); + fieldViolations_.add(value); + onChanged(); + } else { + fieldViolationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder addFieldViolations( + int index, com.google.rpc.BadRequest.FieldViolation value) { + if (fieldViolationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldViolationsIsMutable(); + fieldViolations_.add(index, value); + onChanged(); + } else { + fieldViolationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder addFieldViolations( + com.google.rpc.BadRequest.FieldViolation.Builder builderForValue) { + if (fieldViolationsBuilder_ == null) { + ensureFieldViolationsIsMutable(); + fieldViolations_.add(builderForValue.build()); + onChanged(); + } else { + fieldViolationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder addFieldViolations( + int index, com.google.rpc.BadRequest.FieldViolation.Builder builderForValue) { + if (fieldViolationsBuilder_ == null) { + ensureFieldViolationsIsMutable(); + fieldViolations_.add(index, builderForValue.build()); + onChanged(); + } else { + fieldViolationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder addAllFieldViolations( + java.lang.Iterable values) { + if (fieldViolationsBuilder_ == null) { + ensureFieldViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, fieldViolations_); + onChanged(); + } else { + fieldViolationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder clearFieldViolations() { + if (fieldViolationsBuilder_ == null) { + fieldViolations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + fieldViolationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public Builder removeFieldViolations(int index) { + if (fieldViolationsBuilder_ == null) { + ensureFieldViolationsIsMutable(); + fieldViolations_.remove(index); + onChanged(); + } else { + fieldViolationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public com.google.rpc.BadRequest.FieldViolation.Builder getFieldViolationsBuilder( + int index) { + return getFieldViolationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBuilder( + int index) { + if (fieldViolationsBuilder_ == null) { + return fieldViolations_.get(index); } else { + return fieldViolationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public java.util.List + getFieldViolationsOrBuilderList() { + if (fieldViolationsBuilder_ != null) { + return fieldViolationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(fieldViolations_); + } + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilder() { + return getFieldViolationsFieldBuilder().addBuilder( + com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()); + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public com.google.rpc.BadRequest.FieldViolation.Builder addFieldViolationsBuilder( + int index) { + return getFieldViolationsFieldBuilder().addBuilder( + index, com.google.rpc.BadRequest.FieldViolation.getDefaultInstance()); + } + /** + *
+     * Describes all violations in a client request.
+     * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + public java.util.List + getFieldViolationsBuilderList() { + return getFieldViolationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder> + getFieldViolationsFieldBuilder() { + if (fieldViolationsBuilder_ == null) { + fieldViolationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.BadRequest.FieldViolation, com.google.rpc.BadRequest.FieldViolation.Builder, com.google.rpc.BadRequest.FieldViolationOrBuilder>( + fieldViolations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + fieldViolations_ = null; + } + return fieldViolationsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.BadRequest) + } + + // @@protoc_insertion_point(class_scope:google.rpc.BadRequest) + private static final com.google.rpc.BadRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.BadRequest(); + } + + public static com.google.rpc.BadRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BadRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BadRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.BadRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/BadRequestOrBuilder.java b/src/main/java/com/google/rpc/BadRequestOrBuilder.java new file mode 100644 index 0000000..d1a7f39 --- /dev/null +++ b/src/main/java/com/google/rpc/BadRequestOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface BadRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.BadRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + java.util.List + getFieldViolationsList(); + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + com.google.rpc.BadRequest.FieldViolation getFieldViolations(int index); + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + int getFieldViolationsCount(); + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + java.util.List + getFieldViolationsOrBuilderList(); + /** + *
+   * Describes all violations in a client request.
+   * 
+ * + * repeated .google.rpc.BadRequest.FieldViolation field_violations = 1; + */ + com.google.rpc.BadRequest.FieldViolationOrBuilder getFieldViolationsOrBuilder( + int index); +} diff --git a/src/main/java/com/google/rpc/Code.java b/src/main/java/com/google/rpc/Code.java new file mode 100644 index 0000000..ba676b7 --- /dev/null +++ b/src/main/java/com/google/rpc/Code.java @@ -0,0 +1,550 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/code.proto + +package com.google.rpc; + +/** + *
+ * The canonical error codes for Google APIs.
+ * Sometimes multiple error codes may apply.  Services should return
+ * the most specific error code that applies.  For example, prefer
+ * `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply.
+ * Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`.
+ * 
+ * + * Protobuf enum {@code google.rpc.Code} + */ +public enum Code + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Not an error; returned on success
+   * HTTP Mapping: 200 OK
+   * 
+ * + * OK = 0; + */ + OK(0), + /** + *
+   * The operation was cancelled, typically by the caller.
+   * HTTP Mapping: 499 Client Closed Request
+   * 
+ * + * CANCELLED = 1; + */ + CANCELLED(1), + /** + *
+   * Unknown error.  For example, this error may be returned when
+   * a `Status` value received from another address space belongs to
+   * an error space that is not known in this address space.  Also
+   * errors raised by APIs that do not return enough error information
+   * may be converted to this error.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * UNKNOWN = 2; + */ + UNKNOWN(2), + /** + *
+   * The client specified an invalid argument.  Note that this differs
+   * from `FAILED_PRECONDITION`.  `INVALID_ARGUMENT` indicates arguments
+   * that are problematic regardless of the state of the system
+   * (e.g., a malformed file name).
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * INVALID_ARGUMENT = 3; + */ + INVALID_ARGUMENT(3), + /** + *
+   * The deadline expired before the operation could complete. For operations
+   * that change the state of the system, this error may be returned
+   * even if the operation has completed successfully.  For example, a
+   * successful response from a server could have been delayed long
+   * enough for the deadline to expire.
+   * HTTP Mapping: 504 Gateway Timeout
+   * 
+ * + * DEADLINE_EXCEEDED = 4; + */ + DEADLINE_EXCEEDED(4), + /** + *
+   * Some requested entity (e.g., file or directory) was not found.
+   * Note to server developers: if a request is denied for an entire class
+   * of users, such as gradual feature rollout or undocumented whitelist,
+   * `NOT_FOUND` may be used. If a request is denied for some users within
+   * a class of users, such as user-based access control, `PERMISSION_DENIED`
+   * must be used.
+   * HTTP Mapping: 404 Not Found
+   * 
+ * + * NOT_FOUND = 5; + */ + NOT_FOUND(5), + /** + *
+   * The entity that a client attempted to create (e.g., file or directory)
+   * already exists.
+   * HTTP Mapping: 409 Conflict
+   * 
+ * + * ALREADY_EXISTS = 6; + */ + ALREADY_EXISTS(6), + /** + *
+   * The caller does not have permission to execute the specified
+   * operation. `PERMISSION_DENIED` must not be used for rejections
+   * caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
+   * instead for those errors). `PERMISSION_DENIED` must not be
+   * used if the caller can not be identified (use `UNAUTHENTICATED`
+   * instead for those errors). This error code does not imply the
+   * request is valid or the requested entity exists or satisfies
+   * other pre-conditions.
+   * HTTP Mapping: 403 Forbidden
+   * 
+ * + * PERMISSION_DENIED = 7; + */ + PERMISSION_DENIED(7), + /** + *
+   * The request does not have valid authentication credentials for the
+   * operation.
+   * HTTP Mapping: 401 Unauthorized
+   * 
+ * + * UNAUTHENTICATED = 16; + */ + UNAUTHENTICATED(16), + /** + *
+   * Some resource has been exhausted, perhaps a per-user quota, or
+   * perhaps the entire file system is out of space.
+   * HTTP Mapping: 429 Too Many Requests
+   * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + RESOURCE_EXHAUSTED(8), + /** + *
+   * The operation was rejected because the system is not in a state
+   * required for the operation's execution.  For example, the directory
+   * to be deleted is non-empty, an rmdir operation is applied to
+   * a non-directory, etc.
+   * Service implementors can use the following guidelines to decide
+   * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
+   *  (a) Use `UNAVAILABLE` if the client can retry just the failing call.
+   *  (b) Use `ABORTED` if the client should retry at a higher level
+   *      (e.g., when a client-specified test-and-set fails, indicating the
+   *      client should restart a read-modify-write sequence).
+   *  (c) Use `FAILED_PRECONDITION` if the client should not retry until
+   *      the system state has been explicitly fixed.  E.g., if an "rmdir"
+   *      fails because the directory is non-empty, `FAILED_PRECONDITION`
+   *      should be returned since the client should not retry unless
+   *      the files are deleted from the directory.
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * FAILED_PRECONDITION = 9; + */ + FAILED_PRECONDITION(9), + /** + *
+   * The operation was aborted, typically due to a concurrency issue such as
+   * a sequencer check failure or transaction abort.
+   * See the guidelines above for deciding between `FAILED_PRECONDITION`,
+   * `ABORTED`, and `UNAVAILABLE`.
+   * HTTP Mapping: 409 Conflict
+   * 
+ * + * ABORTED = 10; + */ + ABORTED(10), + /** + *
+   * The operation was attempted past the valid range.  E.g., seeking or
+   * reading past end-of-file.
+   * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
+   * be fixed if the system state changes. For example, a 32-bit file
+   * system will generate `INVALID_ARGUMENT` if asked to read at an
+   * offset that is not in the range [0,2^32-1], but it will generate
+   * `OUT_OF_RANGE` if asked to read from an offset past the current
+   * file size.
+   * There is a fair bit of overlap between `FAILED_PRECONDITION` and
+   * `OUT_OF_RANGE`.  We recommend using `OUT_OF_RANGE` (the more specific
+   * error) when it applies so that callers who are iterating through
+   * a space can easily look for an `OUT_OF_RANGE` error to detect when
+   * they are done.
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * OUT_OF_RANGE = 11; + */ + OUT_OF_RANGE(11), + /** + *
+   * The operation is not implemented or is not supported/enabled in this
+   * service.
+   * HTTP Mapping: 501 Not Implemented
+   * 
+ * + * UNIMPLEMENTED = 12; + */ + UNIMPLEMENTED(12), + /** + *
+   * Internal errors.  This means that some invariants expected by the
+   * underlying system have been broken.  This error code is reserved
+   * for serious errors.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * INTERNAL = 13; + */ + INTERNAL(13), + /** + *
+   * The service is currently unavailable.  This is most likely a
+   * transient condition, which can be corrected by retrying with
+   * a backoff.
+   * See the guidelines above for deciding between `FAILED_PRECONDITION`,
+   * `ABORTED`, and `UNAVAILABLE`.
+   * HTTP Mapping: 503 Service Unavailable
+   * 
+ * + * UNAVAILABLE = 14; + */ + UNAVAILABLE(14), + /** + *
+   * Unrecoverable data loss or corruption.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * DATA_LOSS = 15; + */ + DATA_LOSS(15), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Not an error; returned on success
+   * HTTP Mapping: 200 OK
+   * 
+ * + * OK = 0; + */ + public static final int OK_VALUE = 0; + /** + *
+   * The operation was cancelled, typically by the caller.
+   * HTTP Mapping: 499 Client Closed Request
+   * 
+ * + * CANCELLED = 1; + */ + public static final int CANCELLED_VALUE = 1; + /** + *
+   * Unknown error.  For example, this error may be returned when
+   * a `Status` value received from another address space belongs to
+   * an error space that is not known in this address space.  Also
+   * errors raised by APIs that do not return enough error information
+   * may be converted to this error.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * UNKNOWN = 2; + */ + public static final int UNKNOWN_VALUE = 2; + /** + *
+   * The client specified an invalid argument.  Note that this differs
+   * from `FAILED_PRECONDITION`.  `INVALID_ARGUMENT` indicates arguments
+   * that are problematic regardless of the state of the system
+   * (e.g., a malformed file name).
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * INVALID_ARGUMENT = 3; + */ + public static final int INVALID_ARGUMENT_VALUE = 3; + /** + *
+   * The deadline expired before the operation could complete. For operations
+   * that change the state of the system, this error may be returned
+   * even if the operation has completed successfully.  For example, a
+   * successful response from a server could have been delayed long
+   * enough for the deadline to expire.
+   * HTTP Mapping: 504 Gateway Timeout
+   * 
+ * + * DEADLINE_EXCEEDED = 4; + */ + public static final int DEADLINE_EXCEEDED_VALUE = 4; + /** + *
+   * Some requested entity (e.g., file or directory) was not found.
+   * Note to server developers: if a request is denied for an entire class
+   * of users, such as gradual feature rollout or undocumented whitelist,
+   * `NOT_FOUND` may be used. If a request is denied for some users within
+   * a class of users, such as user-based access control, `PERMISSION_DENIED`
+   * must be used.
+   * HTTP Mapping: 404 Not Found
+   * 
+ * + * NOT_FOUND = 5; + */ + public static final int NOT_FOUND_VALUE = 5; + /** + *
+   * The entity that a client attempted to create (e.g., file or directory)
+   * already exists.
+   * HTTP Mapping: 409 Conflict
+   * 
+ * + * ALREADY_EXISTS = 6; + */ + public static final int ALREADY_EXISTS_VALUE = 6; + /** + *
+   * The caller does not have permission to execute the specified
+   * operation. `PERMISSION_DENIED` must not be used for rejections
+   * caused by exhausting some resource (use `RESOURCE_EXHAUSTED`
+   * instead for those errors). `PERMISSION_DENIED` must not be
+   * used if the caller can not be identified (use `UNAUTHENTICATED`
+   * instead for those errors). This error code does not imply the
+   * request is valid or the requested entity exists or satisfies
+   * other pre-conditions.
+   * HTTP Mapping: 403 Forbidden
+   * 
+ * + * PERMISSION_DENIED = 7; + */ + public static final int PERMISSION_DENIED_VALUE = 7; + /** + *
+   * The request does not have valid authentication credentials for the
+   * operation.
+   * HTTP Mapping: 401 Unauthorized
+   * 
+ * + * UNAUTHENTICATED = 16; + */ + public static final int UNAUTHENTICATED_VALUE = 16; + /** + *
+   * Some resource has been exhausted, perhaps a per-user quota, or
+   * perhaps the entire file system is out of space.
+   * HTTP Mapping: 429 Too Many Requests
+   * 
+ * + * RESOURCE_EXHAUSTED = 8; + */ + public static final int RESOURCE_EXHAUSTED_VALUE = 8; + /** + *
+   * The operation was rejected because the system is not in a state
+   * required for the operation's execution.  For example, the directory
+   * to be deleted is non-empty, an rmdir operation is applied to
+   * a non-directory, etc.
+   * Service implementors can use the following guidelines to decide
+   * between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`:
+   *  (a) Use `UNAVAILABLE` if the client can retry just the failing call.
+   *  (b) Use `ABORTED` if the client should retry at a higher level
+   *      (e.g., when a client-specified test-and-set fails, indicating the
+   *      client should restart a read-modify-write sequence).
+   *  (c) Use `FAILED_PRECONDITION` if the client should not retry until
+   *      the system state has been explicitly fixed.  E.g., if an "rmdir"
+   *      fails because the directory is non-empty, `FAILED_PRECONDITION`
+   *      should be returned since the client should not retry unless
+   *      the files are deleted from the directory.
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * FAILED_PRECONDITION = 9; + */ + public static final int FAILED_PRECONDITION_VALUE = 9; + /** + *
+   * The operation was aborted, typically due to a concurrency issue such as
+   * a sequencer check failure or transaction abort.
+   * See the guidelines above for deciding between `FAILED_PRECONDITION`,
+   * `ABORTED`, and `UNAVAILABLE`.
+   * HTTP Mapping: 409 Conflict
+   * 
+ * + * ABORTED = 10; + */ + public static final int ABORTED_VALUE = 10; + /** + *
+   * The operation was attempted past the valid range.  E.g., seeking or
+   * reading past end-of-file.
+   * Unlike `INVALID_ARGUMENT`, this error indicates a problem that may
+   * be fixed if the system state changes. For example, a 32-bit file
+   * system will generate `INVALID_ARGUMENT` if asked to read at an
+   * offset that is not in the range [0,2^32-1], but it will generate
+   * `OUT_OF_RANGE` if asked to read from an offset past the current
+   * file size.
+   * There is a fair bit of overlap between `FAILED_PRECONDITION` and
+   * `OUT_OF_RANGE`.  We recommend using `OUT_OF_RANGE` (the more specific
+   * error) when it applies so that callers who are iterating through
+   * a space can easily look for an `OUT_OF_RANGE` error to detect when
+   * they are done.
+   * HTTP Mapping: 400 Bad Request
+   * 
+ * + * OUT_OF_RANGE = 11; + */ + public static final int OUT_OF_RANGE_VALUE = 11; + /** + *
+   * The operation is not implemented or is not supported/enabled in this
+   * service.
+   * HTTP Mapping: 501 Not Implemented
+   * 
+ * + * UNIMPLEMENTED = 12; + */ + public static final int UNIMPLEMENTED_VALUE = 12; + /** + *
+   * Internal errors.  This means that some invariants expected by the
+   * underlying system have been broken.  This error code is reserved
+   * for serious errors.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * INTERNAL = 13; + */ + public static final int INTERNAL_VALUE = 13; + /** + *
+   * The service is currently unavailable.  This is most likely a
+   * transient condition, which can be corrected by retrying with
+   * a backoff.
+   * See the guidelines above for deciding between `FAILED_PRECONDITION`,
+   * `ABORTED`, and `UNAVAILABLE`.
+   * HTTP Mapping: 503 Service Unavailable
+   * 
+ * + * UNAVAILABLE = 14; + */ + public static final int UNAVAILABLE_VALUE = 14; + /** + *
+   * Unrecoverable data loss or corruption.
+   * HTTP Mapping: 500 Internal Server Error
+   * 
+ * + * DATA_LOSS = 15; + */ + public static final int DATA_LOSS_VALUE = 15; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: return OK; + case 1: return CANCELLED; + case 2: return UNKNOWN; + case 3: return INVALID_ARGUMENT; + case 4: return DEADLINE_EXCEEDED; + case 5: return NOT_FOUND; + case 6: return ALREADY_EXISTS; + case 7: return PERMISSION_DENIED; + case 16: return UNAUTHENTICATED; + case 8: return RESOURCE_EXHAUSTED; + case 9: return FAILED_PRECONDITION; + case 10: return ABORTED; + case 11: return OUT_OF_RANGE; + case 12: return UNIMPLEMENTED; + case 13: return INTERNAL; + case 14: return UNAVAILABLE; + case 15: return DATA_LOSS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Code> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return com.google.rpc.CodeProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Code[] VALUES = values(); + + public static Code valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.rpc.Code) +} + diff --git a/src/main/java/com/google/rpc/CodeProto.java b/src/main/java/com/google/rpc/CodeProto.java new file mode 100644 index 0000000..229bcfe --- /dev/null +++ b/src/main/java/com/google/rpc/CodeProto.java @@ -0,0 +1,46 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/code.proto + +package com.google.rpc; + +public final class CodeProto { + private CodeProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\025google/rpc/code.proto\022\ngoogle.rpc*\267\002\n\004" + + "Code\022\006\n\002OK\020\000\022\r\n\tCANCELLED\020\001\022\013\n\007UNKNOWN\020\002" + + "\022\024\n\020INVALID_ARGUMENT\020\003\022\025\n\021DEADLINE_EXCEE" + + "DED\020\004\022\r\n\tNOT_FOUND\020\005\022\022\n\016ALREADY_EXISTS\020\006" + + "\022\025\n\021PERMISSION_DENIED\020\007\022\023\n\017UNAUTHENTICAT" + + "ED\020\020\022\026\n\022RESOURCE_EXHAUSTED\020\010\022\027\n\023FAILED_P" + + "RECONDITION\020\t\022\013\n\007ABORTED\020\n\022\020\n\014OUT_OF_RAN" + + "GE\020\013\022\021\n\rUNIMPLEMENTED\020\014\022\014\n\010INTERNAL\020\r\022\017\n" + + "\013UNAVAILABLE\020\016\022\r\n\tDATA_LOSS\020\017BX\n\016com.goo" + + "gle.rpcB\tCodeProtoP\001Z3google.golang.org/" + + "genproto/googleapis/rpc/code;code\242\002\003RPCb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/rpc/DebugInfo.java b/src/main/java/com/google/rpc/DebugInfo.java new file mode 100644 index 0000000..4045b38 --- /dev/null +++ b/src/main/java/com/google/rpc/DebugInfo.java @@ -0,0 +1,840 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes additional debugging info.
+ * 
+ * + * Protobuf type {@code google.rpc.DebugInfo} + */ +public final class DebugInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.DebugInfo) + DebugInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use DebugInfo.newBuilder() to construct. + private DebugInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DebugInfo() { + stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + detail_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DebugInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DebugInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stackEntries_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stackEntries_.add(s); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + detail_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stackEntries_ = stackEntries_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.DebugInfo.class, com.google.rpc.DebugInfo.Builder.class); + } + + public static final int STACK_ENTRIES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList stackEntries_; + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @return A list containing the stackEntries. + */ + public com.google.protobuf.ProtocolStringList + getStackEntriesList() { + return stackEntries_; + } + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @return The count of stackEntries. + */ + public int getStackEntriesCount() { + return stackEntries_.size(); + } + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the element to return. + * @return The stackEntries at the given index. + */ + public java.lang.String getStackEntries(int index) { + return stackEntries_.get(index); + } + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the value to return. + * @return The bytes of the stackEntries at the given index. + */ + public com.google.protobuf.ByteString + getStackEntriesBytes(int index) { + return stackEntries_.getByteString(index); + } + + public static final int DETAIL_FIELD_NUMBER = 2; + private volatile java.lang.Object detail_; + /** + *
+   * Additional debugging information provided by the server.
+   * 
+ * + * string detail = 2; + * @return The detail. + */ + @java.lang.Override + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + 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(); + detail_ = s; + return s; + } + } + /** + *
+   * Additional debugging information provided by the server.
+   * 
+ * + * string detail = 2; + * @return The bytes for detail. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < stackEntries_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stackEntries_.getRaw(i)); + } + if (!getDetailBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, detail_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < stackEntries_.size(); i++) { + dataSize += computeStringSizeNoTag(stackEntries_.getRaw(i)); + } + size += dataSize; + size += 1 * getStackEntriesList().size(); + } + if (!getDetailBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, detail_); + } + 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.rpc.DebugInfo)) { + return super.equals(obj); + } + com.google.rpc.DebugInfo other = (com.google.rpc.DebugInfo) obj; + + if (!getStackEntriesList() + .equals(other.getStackEntriesList())) return false; + if (!getDetail() + .equals(other.getDetail())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getStackEntriesCount() > 0) { + hash = (37 * hash) + STACK_ENTRIES_FIELD_NUMBER; + hash = (53 * hash) + getStackEntriesList().hashCode(); + } + hash = (37 * hash) + DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getDetail().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.DebugInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.DebugInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.DebugInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.DebugInfo 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.rpc.DebugInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.DebugInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.DebugInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.DebugInfo 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.rpc.DebugInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.DebugInfo 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.rpc.DebugInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.DebugInfo 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.rpc.DebugInfo 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; + } + /** + *
+   * Describes additional debugging info.
+   * 
+ * + * Protobuf type {@code google.rpc.DebugInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.DebugInfo) + com.google.rpc.DebugInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.DebugInfo.class, com.google.rpc.DebugInfo.Builder.class); + } + + // Construct using com.google.rpc.DebugInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + detail_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_DebugInfo_descriptor; + } + + @java.lang.Override + public com.google.rpc.DebugInfo getDefaultInstanceForType() { + return com.google.rpc.DebugInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.DebugInfo build() { + com.google.rpc.DebugInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.DebugInfo buildPartial() { + com.google.rpc.DebugInfo result = new com.google.rpc.DebugInfo(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + stackEntries_ = stackEntries_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stackEntries_ = stackEntries_; + result.detail_ = detail_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.DebugInfo) { + return mergeFrom((com.google.rpc.DebugInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.DebugInfo other) { + if (other == com.google.rpc.DebugInfo.getDefaultInstance()) return this; + if (!other.stackEntries_.isEmpty()) { + if (stackEntries_.isEmpty()) { + stackEntries_ = other.stackEntries_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStackEntriesIsMutable(); + stackEntries_.addAll(other.stackEntries_); + } + onChanged(); + } + if (!other.getDetail().isEmpty()) { + detail_ = other.detail_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.DebugInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.DebugInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureStackEntriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stackEntries_ = new com.google.protobuf.LazyStringArrayList(stackEntries_); + bitField0_ |= 0x00000001; + } + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @return A list containing the stackEntries. + */ + public com.google.protobuf.ProtocolStringList + getStackEntriesList() { + return stackEntries_.getUnmodifiableView(); + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @return The count of stackEntries. + */ + public int getStackEntriesCount() { + return stackEntries_.size(); + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the element to return. + * @return The stackEntries at the given index. + */ + public java.lang.String getStackEntries(int index) { + return stackEntries_.get(index); + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the value to return. + * @return The bytes of the stackEntries at the given index. + */ + public com.google.protobuf.ByteString + getStackEntriesBytes(int index) { + return stackEntries_.getByteString(index); + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param index The index to set the value at. + * @param value The stackEntries to set. + * @return This builder for chaining. + */ + public Builder setStackEntries( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStackEntriesIsMutable(); + stackEntries_.set(index, value); + onChanged(); + return this; + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param value The stackEntries to add. + * @return This builder for chaining. + */ + public Builder addStackEntries( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStackEntriesIsMutable(); + stackEntries_.add(value); + onChanged(); + return this; + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param values The stackEntries to add. + * @return This builder for chaining. + */ + public Builder addAllStackEntries( + java.lang.Iterable values) { + ensureStackEntriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, stackEntries_); + onChanged(); + return this; + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @return This builder for chaining. + */ + public Builder clearStackEntries() { + stackEntries_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+     * The stack trace entries indicating where the error occurred.
+     * 
+ * + * repeated string stack_entries = 1; + * @param value The bytes of the stackEntries to add. + * @return This builder for chaining. + */ + public Builder addStackEntriesBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStackEntriesIsMutable(); + stackEntries_.add(value); + onChanged(); + return this; + } + + private java.lang.Object detail_ = ""; + /** + *
+     * Additional debugging information provided by the server.
+     * 
+ * + * string detail = 2; + * @return The detail. + */ + public java.lang.String getDetail() { + java.lang.Object ref = detail_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + detail_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Additional debugging information provided by the server.
+     * 
+ * + * string detail = 2; + * @return The bytes for detail. + */ + public com.google.protobuf.ByteString + getDetailBytes() { + java.lang.Object ref = detail_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + detail_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Additional debugging information provided by the server.
+     * 
+ * + * string detail = 2; + * @param value The detail to set. + * @return This builder for chaining. + */ + public Builder setDetail( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + detail_ = value; + onChanged(); + return this; + } + /** + *
+     * Additional debugging information provided by the server.
+     * 
+ * + * string detail = 2; + * @return This builder for chaining. + */ + public Builder clearDetail() { + + detail_ = getDefaultInstance().getDetail(); + onChanged(); + return this; + } + /** + *
+     * Additional debugging information provided by the server.
+     * 
+ * + * string detail = 2; + * @param value The bytes for detail to set. + * @return This builder for chaining. + */ + public Builder setDetailBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + detail_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.DebugInfo) + } + + // @@protoc_insertion_point(class_scope:google.rpc.DebugInfo) + private static final com.google.rpc.DebugInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.DebugInfo(); + } + + public static com.google.rpc.DebugInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DebugInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DebugInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.DebugInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/DebugInfoOrBuilder.java b/src/main/java/com/google/rpc/DebugInfoOrBuilder.java new file mode 100644 index 0000000..0cef307 --- /dev/null +++ b/src/main/java/com/google/rpc/DebugInfoOrBuilder.java @@ -0,0 +1,70 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface DebugInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.DebugInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @return A list containing the stackEntries. + */ + java.util.List + getStackEntriesList(); + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @return The count of stackEntries. + */ + int getStackEntriesCount(); + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the element to return. + * @return The stackEntries at the given index. + */ + java.lang.String getStackEntries(int index); + /** + *
+   * The stack trace entries indicating where the error occurred.
+   * 
+ * + * repeated string stack_entries = 1; + * @param index The index of the value to return. + * @return The bytes of the stackEntries at the given index. + */ + com.google.protobuf.ByteString + getStackEntriesBytes(int index); + + /** + *
+   * Additional debugging information provided by the server.
+   * 
+ * + * string detail = 2; + * @return The detail. + */ + java.lang.String getDetail(); + /** + *
+   * Additional debugging information provided by the server.
+   * 
+ * + * string detail = 2; + * @return The bytes for detail. + */ + com.google.protobuf.ByteString + getDetailBytes(); +} diff --git a/src/main/java/com/google/rpc/ErrorDetailsProto.java b/src/main/java/com/google/rpc/ErrorDetailsProto.java new file mode 100644 index 0000000..b4e2fb7 --- /dev/null +++ b/src/main/java/com/google/rpc/ErrorDetailsProto.java @@ -0,0 +1,205 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public final class ErrorDetailsProto { + private ErrorDetailsProto() {} + 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_rpc_RetryInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_RetryInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_DebugInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_DebugInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_QuotaFailure_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_QuotaFailure_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_QuotaFailure_Violation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_PreconditionFailure_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_PreconditionFailure_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_PreconditionFailure_Violation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_BadRequest_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_BadRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_BadRequest_FieldViolation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_RequestInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_RequestInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_ResourceInfo_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_ResourceInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_Help_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_Help_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_Help_Link_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_Help_Link_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_rpc_LocalizedMessage_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_LocalizedMessage_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\036google/rpc/error_details.proto\022\ngoogle" + + ".rpc\032\036google/protobuf/duration.proto\";\n\t" + + "RetryInfo\022.\n\013retry_delay\030\001 \001(\0132\031.google." + + "protobuf.Duration\"2\n\tDebugInfo\022\025\n\rstack_" + + "entries\030\001 \003(\t\022\016\n\006detail\030\002 \001(\t\"y\n\014QuotaFa" + + "ilure\0226\n\nviolations\030\001 \003(\0132\".google.rpc.Q" + + "uotaFailure.Violation\0321\n\tViolation\022\017\n\007su" + + "bject\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\"\225\001\n\023Pre" + + "conditionFailure\022=\n\nviolations\030\001 \003(\0132).g" + + "oogle.rpc.PreconditionFailure.Violation\032" + + "?\n\tViolation\022\014\n\004type\030\001 \001(\t\022\017\n\007subject\030\002 " + + "\001(\t\022\023\n\013description\030\003 \001(\t\"\203\001\n\nBadRequest\022" + + "?\n\020field_violations\030\001 \003(\0132%.google.rpc.B" + + "adRequest.FieldViolation\0324\n\016FieldViolati" + + "on\022\r\n\005field\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\"7" + + "\n\013RequestInfo\022\022\n\nrequest_id\030\001 \001(\t\022\024\n\014ser" + + "ving_data\030\002 \001(\t\"`\n\014ResourceInfo\022\025\n\rresou" + + "rce_type\030\001 \001(\t\022\025\n\rresource_name\030\002 \001(\t\022\r\n" + + "\005owner\030\003 \001(\t\022\023\n\013description\030\004 \001(\t\"V\n\004Hel" + + "p\022$\n\005links\030\001 \003(\0132\025.google.rpc.Help.Link\032" + + "(\n\004Link\022\023\n\013description\030\001 \001(\t\022\013\n\003url\030\002 \001(" + + "\t\"3\n\020LocalizedMessage\022\016\n\006locale\030\001 \001(\t\022\017\n" + + "\007message\030\002 \001(\tBl\n\016com.google.rpcB\021ErrorD" + + "etailsProtoP\001Z?google.golang.org/genprot" + + "o/googleapis/rpc/errdetails;errdetails\242\002" + + "\003RPCb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.DurationProto.getDescriptor(), + }); + internal_static_google_rpc_RetryInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_rpc_RetryInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_RetryInfo_descriptor, + new java.lang.String[] { "RetryDelay", }); + internal_static_google_rpc_DebugInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_rpc_DebugInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_DebugInfo_descriptor, + new java.lang.String[] { "StackEntries", "Detail", }); + internal_static_google_rpc_QuotaFailure_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_rpc_QuotaFailure_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_QuotaFailure_descriptor, + new java.lang.String[] { "Violations", }); + internal_static_google_rpc_QuotaFailure_Violation_descriptor = + internal_static_google_rpc_QuotaFailure_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_QuotaFailure_Violation_descriptor, + new java.lang.String[] { "Subject", "Description", }); + internal_static_google_rpc_PreconditionFailure_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_rpc_PreconditionFailure_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_PreconditionFailure_descriptor, + new java.lang.String[] { "Violations", }); + internal_static_google_rpc_PreconditionFailure_Violation_descriptor = + internal_static_google_rpc_PreconditionFailure_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_PreconditionFailure_Violation_descriptor, + new java.lang.String[] { "Type", "Subject", "Description", }); + internal_static_google_rpc_BadRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_rpc_BadRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_BadRequest_descriptor, + new java.lang.String[] { "FieldViolations", }); + internal_static_google_rpc_BadRequest_FieldViolation_descriptor = + internal_static_google_rpc_BadRequest_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_BadRequest_FieldViolation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_BadRequest_FieldViolation_descriptor, + new java.lang.String[] { "Field", "Description", }); + internal_static_google_rpc_RequestInfo_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_rpc_RequestInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_RequestInfo_descriptor, + new java.lang.String[] { "RequestId", "ServingData", }); + internal_static_google_rpc_ResourceInfo_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_rpc_ResourceInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_ResourceInfo_descriptor, + new java.lang.String[] { "ResourceType", "ResourceName", "Owner", "Description", }); + internal_static_google_rpc_Help_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_rpc_Help_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_Help_descriptor, + new java.lang.String[] { "Links", }); + internal_static_google_rpc_Help_Link_descriptor = + internal_static_google_rpc_Help_descriptor.getNestedTypes().get(0); + internal_static_google_rpc_Help_Link_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_Help_Link_descriptor, + new java.lang.String[] { "Description", "Url", }); + internal_static_google_rpc_LocalizedMessage_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_rpc_LocalizedMessage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_LocalizedMessage_descriptor, + new java.lang.String[] { "Locale", "Message", }); + com.google.protobuf.DurationProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/rpc/Help.java b/src/main/java/com/google/rpc/Help.java new file mode 100644 index 0000000..1d4c233 --- /dev/null +++ b/src/main/java/com/google/rpc/Help.java @@ -0,0 +1,1674 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Provides links to documentation or for performing an out of band action.
+ * For example, if a quota check failed with an error indicating the calling
+ * project hasn't enabled the accessed service, this can contain a URL pointing
+ * directly to the right place in the developer console to flip the bit.
+ * 
+ * + * Protobuf type {@code google.rpc.Help} + */ +public final class Help extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.Help) + HelpOrBuilder { +private static final long serialVersionUID = 0L; + // Use Help.newBuilder() to construct. + private Help(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Help() { + links_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Help(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Help( + 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) != 0)) { + links_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + links_.add( + input.readMessage(com.google.rpc.Help.Link.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Help.class, com.google.rpc.Help.Builder.class); + } + + public interface LinkOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.Help.Link) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Describes what the link offers.
+     * 
+ * + * string description = 1; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+     * Describes what the link offers.
+     * 
+ * + * string description = 1; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + + /** + *
+     * The URL of the link.
+     * 
+ * + * string url = 2; + * @return The url. + */ + java.lang.String getUrl(); + /** + *
+     * The URL of the link.
+     * 
+ * + * string url = 2; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + } + /** + *
+   * Describes a URL link.
+   * 
+ * + * Protobuf type {@code google.rpc.Help.Link} + */ + public static final class Link extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.Help.Link) + LinkOrBuilder { + private static final long serialVersionUID = 0L; + // Use Link.newBuilder() to construct. + private Link(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Link() { + description_ = ""; + url_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Link(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Link( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Help.Link.class, com.google.rpc.Help.Link.Builder.class); + } + + public static final int DESCRIPTION_FIELD_NUMBER = 1; + private volatile java.lang.Object description_; + /** + *
+     * Describes what the link offers.
+     * 
+ * + * string description = 1; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * Describes what the link offers.
+     * 
+ * + * string description = 1; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 2; + private volatile java.lang.Object url_; + /** + *
+     * The URL of the link.
+     * 
+ * + * string url = 2; + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + *
+     * The URL of the link.
+     * 
+ * + * string url = 2; + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, description_); + } + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, description_); + } + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.Help.Link)) { + return super.equals(obj); + } + com.google.rpc.Help.Link other = (com.google.rpc.Help.Link) obj; + + if (!getDescription() + .equals(other.getDescription())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.Help.Link parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help.Link parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Help.Link parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help.Link 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.rpc.Help.Link parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help.Link parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Help.Link parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Help.Link 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.rpc.Help.Link parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.Help.Link 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.rpc.Help.Link parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Help.Link 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.rpc.Help.Link 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; + } + /** + *
+     * Describes a URL link.
+     * 
+ * + * Protobuf type {@code google.rpc.Help.Link} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.Help.Link) + com.google.rpc.Help.LinkOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Help.Link.class, com.google.rpc.Help.Link.Builder.class); + } + + // Construct using com.google.rpc.Help.Link.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + description_ = ""; + + url_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_Link_descriptor; + } + + @java.lang.Override + public com.google.rpc.Help.Link getDefaultInstanceForType() { + return com.google.rpc.Help.Link.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.Help.Link build() { + com.google.rpc.Help.Link result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.Help.Link buildPartial() { + com.google.rpc.Help.Link result = new com.google.rpc.Help.Link(this); + result.description_ = description_; + result.url_ = url_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.Help.Link) { + return mergeFrom((com.google.rpc.Help.Link)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.Help.Link other) { + if (other == com.google.rpc.Help.Link.getDefaultInstance()) return this; + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.Help.Link parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.Help.Link) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * Describes what the link offers.
+       * 
+ * + * string description = 1; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Describes what the link offers.
+       * 
+ * + * string description = 1; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Describes what the link offers.
+       * 
+ * + * string description = 1; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * Describes what the link offers.
+       * 
+ * + * string description = 1; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * Describes what the link offers.
+       * 
+ * + * string description = 1; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + *
+       * The URL of the link.
+       * 
+ * + * string url = 2; + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The URL of the link.
+       * 
+ * + * string url = 2; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The URL of the link.
+       * 
+ * + * string url = 2; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + *
+       * The URL of the link.
+       * 
+ * + * string url = 2; + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + *
+       * The URL of the link.
+       * 
+ * + * string url = 2; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.Help.Link) + } + + // @@protoc_insertion_point(class_scope:google.rpc.Help.Link) + private static final com.google.rpc.Help.Link DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.Help.Link(); + } + + public static com.google.rpc.Help.Link getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Link parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Link(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.Help.Link getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int LINKS_FIELD_NUMBER = 1; + private java.util.List links_; + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + @java.lang.Override + public java.util.List getLinksList() { + return links_; + } + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + @java.lang.Override + public java.util.List + getLinksOrBuilderList() { + return links_; + } + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + @java.lang.Override + public int getLinksCount() { + return links_.size(); + } + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + @java.lang.Override + public com.google.rpc.Help.Link getLinks(int index) { + return links_.get(index); + } + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + @java.lang.Override + public com.google.rpc.Help.LinkOrBuilder getLinksOrBuilder( + int index) { + return links_.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 < links_.size(); i++) { + output.writeMessage(1, links_.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 < links_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, links_.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.rpc.Help)) { + return super.equals(obj); + } + com.google.rpc.Help other = (com.google.rpc.Help) obj; + + if (!getLinksList() + .equals(other.getLinksList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLinksCount() > 0) { + hash = (37 * hash) + LINKS_FIELD_NUMBER; + hash = (53 * hash) + getLinksList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.Help parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Help parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help 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.rpc.Help parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Help parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Help parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Help 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.rpc.Help parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.Help 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.rpc.Help parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Help 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.rpc.Help prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides links to documentation or for performing an out of band action.
+   * For example, if a quota check failed with an error indicating the calling
+   * project hasn't enabled the accessed service, this can contain a URL pointing
+   * directly to the right place in the developer console to flip the bit.
+   * 
+ * + * Protobuf type {@code google.rpc.Help} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.Help) + com.google.rpc.HelpOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Help.class, com.google.rpc.Help.Builder.class); + } + + // Construct using com.google.rpc.Help.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinksFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linksBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_Help_descriptor; + } + + @java.lang.Override + public com.google.rpc.Help getDefaultInstanceForType() { + return com.google.rpc.Help.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.Help build() { + com.google.rpc.Help result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.Help buildPartial() { + com.google.rpc.Help result = new com.google.rpc.Help(this); + int from_bitField0_ = bitField0_; + if (linksBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + links_ = java.util.Collections.unmodifiableList(links_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.links_ = links_; + } else { + result.links_ = linksBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.Help) { + return mergeFrom((com.google.rpc.Help)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.Help other) { + if (other == com.google.rpc.Help.getDefaultInstance()) return this; + if (linksBuilder_ == null) { + if (!other.links_.isEmpty()) { + if (links_.isEmpty()) { + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinksIsMutable(); + links_.addAll(other.links_); + } + onChanged(); + } + } else { + if (!other.links_.isEmpty()) { + if (linksBuilder_.isEmpty()) { + linksBuilder_.dispose(); + linksBuilder_ = null; + links_ = other.links_; + bitField0_ = (bitField0_ & ~0x00000001); + linksBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinksFieldBuilder() : null; + } else { + linksBuilder_.addAllMessages(other.links_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.Help parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.Help) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List links_ = + java.util.Collections.emptyList(); + private void ensureLinksIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + links_ = new java.util.ArrayList(links_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Help.Link, com.google.rpc.Help.Link.Builder, com.google.rpc.Help.LinkOrBuilder> linksBuilder_; + + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public java.util.List getLinksList() { + if (linksBuilder_ == null) { + return java.util.Collections.unmodifiableList(links_); + } else { + return linksBuilder_.getMessageList(); + } + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public int getLinksCount() { + if (linksBuilder_ == null) { + return links_.size(); + } else { + return linksBuilder_.getCount(); + } + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public com.google.rpc.Help.Link getLinks(int index) { + if (linksBuilder_ == null) { + return links_.get(index); + } else { + return linksBuilder_.getMessage(index); + } + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder setLinks( + int index, com.google.rpc.Help.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.set(index, value); + onChanged(); + } else { + linksBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder setLinks( + int index, com.google.rpc.Help.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.set(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder addLinks(com.google.rpc.Help.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(value); + onChanged(); + } else { + linksBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder addLinks( + int index, com.google.rpc.Help.Link value) { + if (linksBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinksIsMutable(); + links_.add(index, value); + onChanged(); + } else { + linksBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder addLinks( + com.google.rpc.Help.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder addLinks( + int index, com.google.rpc.Help.Link.Builder builderForValue) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.add(index, builderForValue.build()); + onChanged(); + } else { + linksBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder addAllLinks( + java.lang.Iterable values) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, links_); + onChanged(); + } else { + linksBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder clearLinks() { + if (linksBuilder_ == null) { + links_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linksBuilder_.clear(); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public Builder removeLinks(int index) { + if (linksBuilder_ == null) { + ensureLinksIsMutable(); + links_.remove(index); + onChanged(); + } else { + linksBuilder_.remove(index); + } + return this; + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public com.google.rpc.Help.Link.Builder getLinksBuilder( + int index) { + return getLinksFieldBuilder().getBuilder(index); + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public com.google.rpc.Help.LinkOrBuilder getLinksOrBuilder( + int index) { + if (linksBuilder_ == null) { + return links_.get(index); } else { + return linksBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public java.util.List + getLinksOrBuilderList() { + if (linksBuilder_ != null) { + return linksBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(links_); + } + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public com.google.rpc.Help.Link.Builder addLinksBuilder() { + return getLinksFieldBuilder().addBuilder( + com.google.rpc.Help.Link.getDefaultInstance()); + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public com.google.rpc.Help.Link.Builder addLinksBuilder( + int index) { + return getLinksFieldBuilder().addBuilder( + index, com.google.rpc.Help.Link.getDefaultInstance()); + } + /** + *
+     * URL(s) pointing to additional information on handling the current error.
+     * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + public java.util.List + getLinksBuilderList() { + return getLinksFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Help.Link, com.google.rpc.Help.Link.Builder, com.google.rpc.Help.LinkOrBuilder> + getLinksFieldBuilder() { + if (linksBuilder_ == null) { + linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.Help.Link, com.google.rpc.Help.Link.Builder, com.google.rpc.Help.LinkOrBuilder>( + links_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + links_ = null; + } + return linksBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.Help) + } + + // @@protoc_insertion_point(class_scope:google.rpc.Help) + private static final com.google.rpc.Help DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.Help(); + } + + public static com.google.rpc.Help getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Help parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Help(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.Help getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/HelpOrBuilder.java b/src/main/java/com/google/rpc/HelpOrBuilder.java new file mode 100644 index 0000000..6b63a66 --- /dev/null +++ b/src/main/java/com/google/rpc/HelpOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface HelpOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.Help) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + java.util.List + getLinksList(); + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + com.google.rpc.Help.Link getLinks(int index); + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + int getLinksCount(); + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + java.util.List + getLinksOrBuilderList(); + /** + *
+   * URL(s) pointing to additional information on handling the current error.
+   * 
+ * + * repeated .google.rpc.Help.Link links = 1; + */ + com.google.rpc.Help.LinkOrBuilder getLinksOrBuilder( + int index); +} diff --git a/src/main/java/com/google/rpc/LocalizedMessage.java b/src/main/java/com/google/rpc/LocalizedMessage.java new file mode 100644 index 0000000..e1dfa7a --- /dev/null +++ b/src/main/java/com/google/rpc/LocalizedMessage.java @@ -0,0 +1,775 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Provides a localized error message that is safe to return to the user
+ * which can be attached to an RPC error.
+ * 
+ * + * Protobuf type {@code google.rpc.LocalizedMessage} + */ +public final class LocalizedMessage extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.LocalizedMessage) + LocalizedMessageOrBuilder { +private static final long serialVersionUID = 0L; + // Use LocalizedMessage.newBuilder() to construct. + private LocalizedMessage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LocalizedMessage() { + locale_ = ""; + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new LocalizedMessage(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private LocalizedMessage( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + locale_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.LocalizedMessage.class, com.google.rpc.LocalizedMessage.Builder.class); + } + + public static final int LOCALE_FIELD_NUMBER = 1; + private volatile java.lang.Object locale_; + /** + *
+   * The locale used following the specification defined at
+   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+   * Examples are: "en-US", "fr-CH", "es-MX"
+   * 
+ * + * string locale = 1; + * @return The locale. + */ + @java.lang.Override + public java.lang.String getLocale() { + java.lang.Object ref = locale_; + 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(); + locale_ = s; + return s; + } + } + /** + *
+   * The locale used following the specification defined at
+   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+   * Examples are: "en-US", "fr-CH", "es-MX"
+   * 
+ * + * string locale = 1; + * @return The bytes for locale. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLocaleBytes() { + java.lang.Object ref = locale_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + *
+   * The localized error message in the above locale.
+   * 
+ * + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + *
+   * The localized error message in the above locale.
+   * 
+ * + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = 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 (!getLocaleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, locale_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLocaleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, locale_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + 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.rpc.LocalizedMessage)) { + return super.equals(obj); + } + com.google.rpc.LocalizedMessage other = (com.google.rpc.LocalizedMessage) obj; + + if (!getLocale() + .equals(other.getLocale())) return false; + if (!getMessage() + .equals(other.getMessage())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOCALE_FIELD_NUMBER; + hash = (53 * hash) + getLocale().hashCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.LocalizedMessage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.LocalizedMessage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.LocalizedMessage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.LocalizedMessage 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.rpc.LocalizedMessage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.LocalizedMessage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.LocalizedMessage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.LocalizedMessage 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.rpc.LocalizedMessage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.LocalizedMessage 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.rpc.LocalizedMessage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.LocalizedMessage 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.rpc.LocalizedMessage prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Provides a localized error message that is safe to return to the user
+   * which can be attached to an RPC error.
+   * 
+ * + * Protobuf type {@code google.rpc.LocalizedMessage} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.LocalizedMessage) + com.google.rpc.LocalizedMessageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.LocalizedMessage.class, com.google.rpc.LocalizedMessage.Builder.class); + } + + // Construct using com.google.rpc.LocalizedMessage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + locale_ = ""; + + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_LocalizedMessage_descriptor; + } + + @java.lang.Override + public com.google.rpc.LocalizedMessage getDefaultInstanceForType() { + return com.google.rpc.LocalizedMessage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.LocalizedMessage build() { + com.google.rpc.LocalizedMessage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.LocalizedMessage buildPartial() { + com.google.rpc.LocalizedMessage result = new com.google.rpc.LocalizedMessage(this); + result.locale_ = locale_; + result.message_ = message_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.LocalizedMessage) { + return mergeFrom((com.google.rpc.LocalizedMessage)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.LocalizedMessage other) { + if (other == com.google.rpc.LocalizedMessage.getDefaultInstance()) return this; + if (!other.getLocale().isEmpty()) { + locale_ = other.locale_; + onChanged(); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.LocalizedMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.LocalizedMessage) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object locale_ = ""; + /** + *
+     * The locale used following the specification defined at
+     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+     * Examples are: "en-US", "fr-CH", "es-MX"
+     * 
+ * + * string locale = 1; + * @return The locale. + */ + public java.lang.String getLocale() { + java.lang.Object ref = locale_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + locale_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The locale used following the specification defined at
+     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+     * Examples are: "en-US", "fr-CH", "es-MX"
+     * 
+ * + * string locale = 1; + * @return The bytes for locale. + */ + public com.google.protobuf.ByteString + getLocaleBytes() { + java.lang.Object ref = locale_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + locale_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The locale used following the specification defined at
+     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+     * Examples are: "en-US", "fr-CH", "es-MX"
+     * 
+ * + * string locale = 1; + * @param value The locale to set. + * @return This builder for chaining. + */ + public Builder setLocale( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + locale_ = value; + onChanged(); + return this; + } + /** + *
+     * The locale used following the specification defined at
+     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+     * Examples are: "en-US", "fr-CH", "es-MX"
+     * 
+ * + * string locale = 1; + * @return This builder for chaining. + */ + public Builder clearLocale() { + + locale_ = getDefaultInstance().getLocale(); + onChanged(); + return this; + } + /** + *
+     * The locale used following the specification defined at
+     * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+     * Examples are: "en-US", "fr-CH", "es-MX"
+     * 
+ * + * string locale = 1; + * @param value The bytes for locale to set. + * @return This builder for chaining. + */ + public Builder setLocaleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + locale_ = value; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + *
+     * The localized error message in the above locale.
+     * 
+ * + * string message = 2; + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The localized error message in the above locale.
+     * 
+ * + * string message = 2; + * @return The bytes for message. + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The localized error message in the above locale.
+     * 
+ * + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + *
+     * The localized error message in the above locale.
+     * 
+ * + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + *
+     * The localized error message in the above locale.
+     * 
+ * + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.LocalizedMessage) + } + + // @@protoc_insertion_point(class_scope:google.rpc.LocalizedMessage) + private static final com.google.rpc.LocalizedMessage DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.LocalizedMessage(); + } + + public static com.google.rpc.LocalizedMessage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LocalizedMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LocalizedMessage(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.LocalizedMessage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java b/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java new file mode 100644 index 0000000..6de4318 --- /dev/null +++ b/src/main/java/com/google/rpc/LocalizedMessageOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface LocalizedMessageOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.LocalizedMessage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The locale used following the specification defined at
+   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+   * Examples are: "en-US", "fr-CH", "es-MX"
+   * 
+ * + * string locale = 1; + * @return The locale. + */ + java.lang.String getLocale(); + /** + *
+   * The locale used following the specification defined at
+   * http://www.rfc-editor.org/rfc/bcp/bcp47.txt.
+   * Examples are: "en-US", "fr-CH", "es-MX"
+   * 
+ * + * string locale = 1; + * @return The bytes for locale. + */ + com.google.protobuf.ByteString + getLocaleBytes(); + + /** + *
+   * The localized error message in the above locale.
+   * 
+ * + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + *
+   * The localized error message in the above locale.
+   * 
+ * + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); +} diff --git a/src/main/java/com/google/rpc/PreconditionFailure.java b/src/main/java/com/google/rpc/PreconditionFailure.java new file mode 100644 index 0000000..74e1fd5 --- /dev/null +++ b/src/main/java/com/google/rpc/PreconditionFailure.java @@ -0,0 +1,1914 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes what preconditions have failed.
+ * For example, if an RPC failed because it required the Terms of Service to be
+ * acknowledged, it could list the terms of service violation in the
+ * PreconditionFailure message.
+ * 
+ * + * Protobuf type {@code google.rpc.PreconditionFailure} + */ +public final class PreconditionFailure extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure) + PreconditionFailureOrBuilder { +private static final long serialVersionUID = 0L; + // Use PreconditionFailure.newBuilder() to construct. + private PreconditionFailure(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PreconditionFailure() { + violations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PreconditionFailure(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PreconditionFailure( + 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) != 0)) { + violations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + violations_.add( + input.readMessage(com.google.rpc.PreconditionFailure.Violation.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.PreconditionFailure.class, com.google.rpc.PreconditionFailure.Builder.class); + } + + public interface ViolationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.PreconditionFailure.Violation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The type of PreconditionFailure. We recommend using a service-specific
+     * enum type to define the supported precondition violation types. For
+     * example, "TOS" for "Terms of Service violation".
+     * 
+ * + * string type = 1; + * @return The type. + */ + java.lang.String getType(); + /** + *
+     * The type of PreconditionFailure. We recommend using a service-specific
+     * enum type to define the supported precondition violation types. For
+     * example, "TOS" for "Terms of Service violation".
+     * 
+ * + * string type = 1; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
+     * The subject, relative to the type, that failed.
+     * For example, "google.com/cloud" relative to the "TOS" type would
+     * indicate which terms of service is being referenced.
+     * 
+ * + * string subject = 2; + * @return The subject. + */ + java.lang.String getSubject(); + /** + *
+     * The subject, relative to the type, that failed.
+     * For example, "google.com/cloud" relative to the "TOS" type would
+     * indicate which terms of service is being referenced.
+     * 
+ * + * string subject = 2; + * @return The bytes for subject. + */ + com.google.protobuf.ByteString + getSubjectBytes(); + + /** + *
+     * A description of how the precondition failed. Developers can use this
+     * description to understand how to fix the failure.
+     * For example: "Terms of service not accepted".
+     * 
+ * + * string description = 3; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+     * A description of how the precondition failed. Developers can use this
+     * description to understand how to fix the failure.
+     * For example: "Terms of service not accepted".
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
+   * A message type used to describe a single precondition failure.
+   * 
+ * + * Protobuf type {@code google.rpc.PreconditionFailure.Violation} + */ + public static final class Violation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.PreconditionFailure.Violation) + ViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Violation.newBuilder() to construct. + private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Violation() { + type_ = ""; + subject_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Violation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Violation( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + subject_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.PreconditionFailure.Violation.class, com.google.rpc.PreconditionFailure.Violation.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object type_; + /** + *
+     * The type of PreconditionFailure. We recommend using a service-specific
+     * enum type to define the supported precondition violation types. For
+     * example, "TOS" for "Terms of Service violation".
+     * 
+ * + * string type = 1; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } + } + /** + *
+     * The type of PreconditionFailure. We recommend using a service-specific
+     * enum type to define the supported precondition violation types. For
+     * example, "TOS" for "Terms of Service violation".
+     * 
+ * + * string type = 1; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SUBJECT_FIELD_NUMBER = 2; + private volatile java.lang.Object subject_; + /** + *
+     * The subject, relative to the type, that failed.
+     * For example, "google.com/cloud" relative to the "TOS" type would
+     * indicate which terms of service is being referenced.
+     * 
+ * + * string subject = 2; + * @return The subject. + */ + @java.lang.Override + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + 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(); + subject_ = s; + return s; + } + } + /** + *
+     * The subject, relative to the type, that failed.
+     * For example, "google.com/cloud" relative to the "TOS" type would
+     * indicate which terms of service is being referenced.
+     * 
+ * + * string subject = 2; + * @return The bytes for subject. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 3; + private volatile java.lang.Object description_; + /** + *
+     * A description of how the precondition failed. Developers can use this
+     * description to understand how to fix the failure.
+     * For example: "Terms of service not accepted".
+     * 
+ * + * string description = 3; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * A description of how the precondition failed. Developers can use this
+     * description to understand how to fix the failure.
+     * For example: "Terms of service not accepted".
+     * 
+ * + * string description = 3; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); + } + if (!getSubjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); + } + if (!getSubjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.PreconditionFailure.Violation)) { + return super.equals(obj); + } + com.google.rpc.PreconditionFailure.Violation other = (com.google.rpc.PreconditionFailure.Violation) obj; + + if (!getType() + .equals(other.getType())) return false; + if (!getSubject() + .equals(other.getSubject())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.PreconditionFailure.Violation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure.Violation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.PreconditionFailure.Violation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure.Violation 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.rpc.PreconditionFailure.Violation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure.Violation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.PreconditionFailure.Violation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure.Violation 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.rpc.PreconditionFailure.Violation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure.Violation 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.rpc.PreconditionFailure.Violation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure.Violation 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.rpc.PreconditionFailure.Violation 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 message type used to describe a single precondition failure.
+     * 
+ * + * Protobuf type {@code google.rpc.PreconditionFailure.Violation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure.Violation) + com.google.rpc.PreconditionFailure.ViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.PreconditionFailure.Violation.class, com.google.rpc.PreconditionFailure.Violation.Builder.class); + } + + // Construct using com.google.rpc.PreconditionFailure.Violation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + type_ = ""; + + subject_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_Violation_descriptor; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure.Violation getDefaultInstanceForType() { + return com.google.rpc.PreconditionFailure.Violation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure.Violation build() { + com.google.rpc.PreconditionFailure.Violation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure.Violation buildPartial() { + com.google.rpc.PreconditionFailure.Violation result = new com.google.rpc.PreconditionFailure.Violation(this); + result.type_ = type_; + result.subject_ = subject_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.PreconditionFailure.Violation) { + return mergeFrom((com.google.rpc.PreconditionFailure.Violation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.PreconditionFailure.Violation other) { + if (other == com.google.rpc.PreconditionFailure.Violation.getDefaultInstance()) return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getSubject().isEmpty()) { + subject_ = other.subject_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.PreconditionFailure.Violation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.PreconditionFailure.Violation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + *
+       * The type of PreconditionFailure. We recommend using a service-specific
+       * enum type to define the supported precondition violation types. For
+       * example, "TOS" for "Terms of Service violation".
+       * 
+ * + * string type = 1; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The type of PreconditionFailure. We recommend using a service-specific
+       * enum type to define the supported precondition violation types. For
+       * example, "TOS" for "Terms of Service violation".
+       * 
+ * + * string type = 1; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The type of PreconditionFailure. We recommend using a service-specific
+       * enum type to define the supported precondition violation types. For
+       * example, "TOS" for "Terms of Service violation".
+       * 
+ * + * string type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * The type of PreconditionFailure. We recommend using a service-specific
+       * enum type to define the supported precondition violation types. For
+       * example, "TOS" for "Terms of Service violation".
+       * 
+ * + * string type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + *
+       * The type of PreconditionFailure. We recommend using a service-specific
+       * enum type to define the supported precondition violation types. For
+       * example, "TOS" for "Terms of Service violation".
+       * 
+ * + * string type = 1; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object subject_ = ""; + /** + *
+       * The subject, relative to the type, that failed.
+       * For example, "google.com/cloud" relative to the "TOS" type would
+       * indicate which terms of service is being referenced.
+       * 
+ * + * string subject = 2; + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The subject, relative to the type, that failed.
+       * For example, "google.com/cloud" relative to the "TOS" type would
+       * indicate which terms of service is being referenced.
+       * 
+ * + * string subject = 2; + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString + getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The subject, relative to the type, that failed.
+       * For example, "google.com/cloud" relative to the "TOS" type would
+       * indicate which terms of service is being referenced.
+       * 
+ * + * string subject = 2; + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subject_ = value; + onChanged(); + return this; + } + /** + *
+       * The subject, relative to the type, that failed.
+       * For example, "google.com/cloud" relative to the "TOS" type would
+       * indicate which terms of service is being referenced.
+       * 
+ * + * string subject = 2; + * @return This builder for chaining. + */ + public Builder clearSubject() { + + subject_ = getDefaultInstance().getSubject(); + onChanged(); + return this; + } + /** + *
+       * The subject, relative to the type, that failed.
+       * For example, "google.com/cloud" relative to the "TOS" type would
+       * indicate which terms of service is being referenced.
+       * 
+ * + * string subject = 2; + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subject_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * A description of how the precondition failed. Developers can use this
+       * description to understand how to fix the failure.
+       * For example: "Terms of service not accepted".
+       * 
+ * + * string description = 3; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A description of how the precondition failed. Developers can use this
+       * description to understand how to fix the failure.
+       * For example: "Terms of service not accepted".
+       * 
+ * + * string description = 3; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A description of how the precondition failed. Developers can use this
+       * description to understand how to fix the failure.
+       * For example: "Terms of service not accepted".
+       * 
+ * + * string description = 3; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * A description of how the precondition failed. Developers can use this
+       * description to understand how to fix the failure.
+       * For example: "Terms of service not accepted".
+       * 
+ * + * string description = 3; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * A description of how the precondition failed. Developers can use this
+       * description to understand how to fix the failure.
+       * For example: "Terms of service not accepted".
+       * 
+ * + * string description = 3; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.PreconditionFailure.Violation) + } + + // @@protoc_insertion_point(class_scope:google.rpc.PreconditionFailure.Violation) + private static final com.google.rpc.PreconditionFailure.Violation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.PreconditionFailure.Violation(); + } + + public static com.google.rpc.PreconditionFailure.Violation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Violation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Violation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure.Violation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int VIOLATIONS_FIELD_NUMBER = 1; + private java.util.List violations_; + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + @java.lang.Override + public java.util.List getViolationsList() { + return violations_; + } + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsOrBuilderList() { + return violations_; + } + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + @java.lang.Override + public int getViolationsCount() { + return violations_.size(); + } + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + @java.lang.Override + public com.google.rpc.PreconditionFailure.Violation getViolations(int index) { + return violations_.get(index); + } + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + @java.lang.Override + public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuilder( + int index) { + return violations_.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 < violations_.size(); i++) { + output.writeMessage(1, violations_.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 < violations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, violations_.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.rpc.PreconditionFailure)) { + return super.equals(obj); + } + com.google.rpc.PreconditionFailure other = (com.google.rpc.PreconditionFailure) obj; + + if (!getViolationsList() + .equals(other.getViolationsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getViolationsCount() > 0) { + hash = (37 * hash) + VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getViolationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.PreconditionFailure parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.PreconditionFailure parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure 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.rpc.PreconditionFailure parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.PreconditionFailure parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.PreconditionFailure parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure 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.rpc.PreconditionFailure parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure 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.rpc.PreconditionFailure parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.PreconditionFailure 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.rpc.PreconditionFailure 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; + } + /** + *
+   * Describes what preconditions have failed.
+   * For example, if an RPC failed because it required the Terms of Service to be
+   * acknowledged, it could list the terms of service violation in the
+   * PreconditionFailure message.
+   * 
+ * + * Protobuf type {@code google.rpc.PreconditionFailure} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.PreconditionFailure) + com.google.rpc.PreconditionFailureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.PreconditionFailure.class, com.google.rpc.PreconditionFailure.Builder.class); + } + + // Construct using com.google.rpc.PreconditionFailure.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getViolationsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + violationsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_PreconditionFailure_descriptor; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure getDefaultInstanceForType() { + return com.google.rpc.PreconditionFailure.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure build() { + com.google.rpc.PreconditionFailure result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure buildPartial() { + com.google.rpc.PreconditionFailure result = new com.google.rpc.PreconditionFailure(this); + int from_bitField0_ = bitField0_; + if (violationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.violations_ = violations_; + } else { + result.violations_ = violationsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.PreconditionFailure) { + return mergeFrom((com.google.rpc.PreconditionFailure)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.PreconditionFailure other) { + if (other == com.google.rpc.PreconditionFailure.getDefaultInstance()) return this; + if (violationsBuilder_ == null) { + if (!other.violations_.isEmpty()) { + if (violations_.isEmpty()) { + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViolationsIsMutable(); + violations_.addAll(other.violations_); + } + onChanged(); + } + } else { + if (!other.violations_.isEmpty()) { + if (violationsBuilder_.isEmpty()) { + violationsBuilder_.dispose(); + violationsBuilder_ = null; + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + violationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getViolationsFieldBuilder() : null; + } else { + violationsBuilder_.addAllMessages(other.violations_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.PreconditionFailure parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.PreconditionFailure) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List violations_ = + java.util.Collections.emptyList(); + private void ensureViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + violations_ = new java.util.ArrayList(violations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.PreconditionFailure.Violation, com.google.rpc.PreconditionFailure.Violation.Builder, com.google.rpc.PreconditionFailure.ViolationOrBuilder> violationsBuilder_; + + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public java.util.List getViolationsList() { + if (violationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(violations_); + } else { + return violationsBuilder_.getMessageList(); + } + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public int getViolationsCount() { + if (violationsBuilder_ == null) { + return violations_.size(); + } else { + return violationsBuilder_.getCount(); + } + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public com.google.rpc.PreconditionFailure.Violation getViolations(int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessage(index); + } + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.rpc.PreconditionFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.set(index, value); + onChanged(); + } else { + violationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.set(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder addViolations(com.google.rpc.PreconditionFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(value); + onChanged(); + } else { + violationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.rpc.PreconditionFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(index, value); + onChanged(); + } else { + violationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder addViolations( + com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.rpc.PreconditionFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder addAllViolations( + java.lang.Iterable values) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, violations_); + onChanged(); + } else { + violationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder clearViolations() { + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + violationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public Builder removeViolations(int index) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.remove(index); + onChanged(); + } else { + violationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public com.google.rpc.PreconditionFailure.Violation.Builder getViolationsBuilder( + int index) { + return getViolationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuilder( + int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); } else { + return violationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public java.util.List + getViolationsOrBuilderList() { + if (violationsBuilder_ != null) { + return violationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violations_); + } + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder() { + return getViolationsFieldBuilder().addBuilder( + com.google.rpc.PreconditionFailure.Violation.getDefaultInstance()); + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public com.google.rpc.PreconditionFailure.Violation.Builder addViolationsBuilder( + int index) { + return getViolationsFieldBuilder().addBuilder( + index, com.google.rpc.PreconditionFailure.Violation.getDefaultInstance()); + } + /** + *
+     * Describes all precondition violations.
+     * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + public java.util.List + getViolationsBuilderList() { + return getViolationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.PreconditionFailure.Violation, com.google.rpc.PreconditionFailure.Violation.Builder, com.google.rpc.PreconditionFailure.ViolationOrBuilder> + getViolationsFieldBuilder() { + if (violationsBuilder_ == null) { + violationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.PreconditionFailure.Violation, com.google.rpc.PreconditionFailure.Violation.Builder, com.google.rpc.PreconditionFailure.ViolationOrBuilder>( + violations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + violations_ = null; + } + return violationsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.PreconditionFailure) + } + + // @@protoc_insertion_point(class_scope:google.rpc.PreconditionFailure) + private static final com.google.rpc.PreconditionFailure DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.PreconditionFailure(); + } + + public static com.google.rpc.PreconditionFailure getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PreconditionFailure parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PreconditionFailure(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.PreconditionFailure getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java b/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java new file mode 100644 index 0000000..d128a3f --- /dev/null +++ b/src/main/java/com/google/rpc/PreconditionFailureOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface PreconditionFailureOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.PreconditionFailure) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + java.util.List + getViolationsList(); + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + com.google.rpc.PreconditionFailure.Violation getViolations(int index); + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + int getViolationsCount(); + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + java.util.List + getViolationsOrBuilderList(); + /** + *
+   * Describes all precondition violations.
+   * 
+ * + * repeated .google.rpc.PreconditionFailure.Violation violations = 1; + */ + com.google.rpc.PreconditionFailure.ViolationOrBuilder getViolationsOrBuilder( + int index); +} diff --git a/src/main/java/com/google/rpc/QuotaFailure.java b/src/main/java/com/google/rpc/QuotaFailure.java new file mode 100644 index 0000000..61ba732 --- /dev/null +++ b/src/main/java/com/google/rpc/QuotaFailure.java @@ -0,0 +1,1749 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes how a quota check failed.
+ * For example if a daily limit was exceeded for the calling project,
+ * a service could respond with a QuotaFailure detail containing the project
+ * id and the description of the quota limit that was exceeded.  If the
+ * calling project hasn't enabled the service in the developer console, then
+ * a service could respond with the project id and set `service_disabled`
+ * to true.
+ * Also see RetryDetail and Help types for other details about handling a
+ * quota failure.
+ * 
+ * + * Protobuf type {@code google.rpc.QuotaFailure} + */ +public final class QuotaFailure extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.QuotaFailure) + QuotaFailureOrBuilder { +private static final long serialVersionUID = 0L; + // Use QuotaFailure.newBuilder() to construct. + private QuotaFailure(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private QuotaFailure() { + violations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new QuotaFailure(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private QuotaFailure( + 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) != 0)) { + violations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + violations_.add( + input.readMessage(com.google.rpc.QuotaFailure.Violation.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.QuotaFailure.class, com.google.rpc.QuotaFailure.Builder.class); + } + + public interface ViolationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.QuotaFailure.Violation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The subject on which the quota check failed.
+     * For example, "clientip:<ip address of client>" or "project:<Google
+     * developer project id>".
+     * 
+ * + * string subject = 1; + * @return The subject. + */ + java.lang.String getSubject(); + /** + *
+     * The subject on which the quota check failed.
+     * For example, "clientip:<ip address of client>" or "project:<Google
+     * developer project id>".
+     * 
+ * + * string subject = 1; + * @return The bytes for subject. + */ + com.google.protobuf.ByteString + getSubjectBytes(); + + /** + *
+     * A description of how the quota check failed. Clients can use this
+     * description to find more about the quota configuration in the service's
+     * public documentation, or find the relevant quota limit to adjust through
+     * developer console.
+     * For example: "Service disabled" or "Daily Limit for read operations
+     * exceeded".
+     * 
+ * + * string description = 2; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+     * A description of how the quota check failed. Clients can use this
+     * description to find more about the quota configuration in the service's
+     * public documentation, or find the relevant quota limit to adjust through
+     * developer console.
+     * For example: "Service disabled" or "Daily Limit for read operations
+     * exceeded".
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); + } + /** + *
+   * A message type used to describe a single quota violation.  For example, a
+   * daily quota or a custom quota that was exceeded.
+   * 
+ * + * Protobuf type {@code google.rpc.QuotaFailure.Violation} + */ + public static final class Violation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.QuotaFailure.Violation) + ViolationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Violation.newBuilder() to construct. + private Violation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Violation() { + subject_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Violation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Violation( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + subject_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.QuotaFailure.Violation.class, com.google.rpc.QuotaFailure.Violation.Builder.class); + } + + public static final int SUBJECT_FIELD_NUMBER = 1; + private volatile java.lang.Object subject_; + /** + *
+     * The subject on which the quota check failed.
+     * For example, "clientip:<ip address of client>" or "project:<Google
+     * developer project id>".
+     * 
+ * + * string subject = 1; + * @return The subject. + */ + @java.lang.Override + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + 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(); + subject_ = s; + return s; + } + } + /** + *
+     * The subject on which the quota check failed.
+     * For example, "clientip:<ip address of client>" or "project:<Google
+     * developer project id>".
+     * 
+ * + * string subject = 1; + * @return The bytes for subject. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + *
+     * A description of how the quota check failed. Clients can use this
+     * description to find more about the quota configuration in the service's
+     * public documentation, or find the relevant quota limit to adjust through
+     * developer console.
+     * For example: "Service disabled" or "Daily Limit for read operations
+     * exceeded".
+     * 
+ * + * string description = 2; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+     * A description of how the quota check failed. Clients can use this
+     * description to find more about the quota configuration in the service's
+     * public documentation, or find the relevant quota limit to adjust through
+     * developer console.
+     * For example: "Service disabled" or "Daily Limit for read operations
+     * exceeded".
+     * 
+ * + * string description = 2; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getSubjectBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSubjectBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, subject_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.QuotaFailure.Violation)) { + return super.equals(obj); + } + com.google.rpc.QuotaFailure.Violation other = (com.google.rpc.QuotaFailure.Violation) obj; + + if (!getSubject() + .equals(other.getSubject())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SUBJECT_FIELD_NUMBER; + hash = (53 * hash) + getSubject().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.QuotaFailure.Violation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure.Violation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.QuotaFailure.Violation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure.Violation 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.rpc.QuotaFailure.Violation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure.Violation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.QuotaFailure.Violation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure.Violation 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.rpc.QuotaFailure.Violation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure.Violation 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.rpc.QuotaFailure.Violation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure.Violation 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.rpc.QuotaFailure.Violation 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 message type used to describe a single quota violation.  For example, a
+     * daily quota or a custom quota that was exceeded.
+     * 
+ * + * Protobuf type {@code google.rpc.QuotaFailure.Violation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.QuotaFailure.Violation) + com.google.rpc.QuotaFailure.ViolationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_Violation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_Violation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.QuotaFailure.Violation.class, com.google.rpc.QuotaFailure.Violation.Builder.class); + } + + // Construct using com.google.rpc.QuotaFailure.Violation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + subject_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_Violation_descriptor; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure.Violation getDefaultInstanceForType() { + return com.google.rpc.QuotaFailure.Violation.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.QuotaFailure.Violation build() { + com.google.rpc.QuotaFailure.Violation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure.Violation buildPartial() { + com.google.rpc.QuotaFailure.Violation result = new com.google.rpc.QuotaFailure.Violation(this); + result.subject_ = subject_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.QuotaFailure.Violation) { + return mergeFrom((com.google.rpc.QuotaFailure.Violation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.QuotaFailure.Violation other) { + if (other == com.google.rpc.QuotaFailure.Violation.getDefaultInstance()) return this; + if (!other.getSubject().isEmpty()) { + subject_ = other.subject_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.QuotaFailure.Violation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.QuotaFailure.Violation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object subject_ = ""; + /** + *
+       * The subject on which the quota check failed.
+       * For example, "clientip:<ip address of client>" or "project:<Google
+       * developer project id>".
+       * 
+ * + * string subject = 1; + * @return The subject. + */ + public java.lang.String getSubject() { + java.lang.Object ref = subject_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + subject_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The subject on which the quota check failed.
+       * For example, "clientip:<ip address of client>" or "project:<Google
+       * developer project id>".
+       * 
+ * + * string subject = 1; + * @return The bytes for subject. + */ + public com.google.protobuf.ByteString + getSubjectBytes() { + java.lang.Object ref = subject_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + subject_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The subject on which the quota check failed.
+       * For example, "clientip:<ip address of client>" or "project:<Google
+       * developer project id>".
+       * 
+ * + * string subject = 1; + * @param value The subject to set. + * @return This builder for chaining. + */ + public Builder setSubject( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + subject_ = value; + onChanged(); + return this; + } + /** + *
+       * The subject on which the quota check failed.
+       * For example, "clientip:<ip address of client>" or "project:<Google
+       * developer project id>".
+       * 
+ * + * string subject = 1; + * @return This builder for chaining. + */ + public Builder clearSubject() { + + subject_ = getDefaultInstance().getSubject(); + onChanged(); + return this; + } + /** + *
+       * The subject on which the quota check failed.
+       * For example, "clientip:<ip address of client>" or "project:<Google
+       * developer project id>".
+       * 
+ * + * string subject = 1; + * @param value The bytes for subject to set. + * @return This builder for chaining. + */ + public Builder setSubjectBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + subject_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+       * A description of how the quota check failed. Clients can use this
+       * description to find more about the quota configuration in the service's
+       * public documentation, or find the relevant quota limit to adjust through
+       * developer console.
+       * For example: "Service disabled" or "Daily Limit for read operations
+       * exceeded".
+       * 
+ * + * string description = 2; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * A description of how the quota check failed. Clients can use this
+       * description to find more about the quota configuration in the service's
+       * public documentation, or find the relevant quota limit to adjust through
+       * developer console.
+       * For example: "Service disabled" or "Daily Limit for read operations
+       * exceeded".
+       * 
+ * + * string description = 2; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * A description of how the quota check failed. Clients can use this
+       * description to find more about the quota configuration in the service's
+       * public documentation, or find the relevant quota limit to adjust through
+       * developer console.
+       * For example: "Service disabled" or "Daily Limit for read operations
+       * exceeded".
+       * 
+ * + * string description = 2; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+       * A description of how the quota check failed. Clients can use this
+       * description to find more about the quota configuration in the service's
+       * public documentation, or find the relevant quota limit to adjust through
+       * developer console.
+       * For example: "Service disabled" or "Daily Limit for read operations
+       * exceeded".
+       * 
+ * + * string description = 2; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+       * A description of how the quota check failed. Clients can use this
+       * description to find more about the quota configuration in the service's
+       * public documentation, or find the relevant quota limit to adjust through
+       * developer console.
+       * For example: "Service disabled" or "Daily Limit for read operations
+       * exceeded".
+       * 
+ * + * string description = 2; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.QuotaFailure.Violation) + } + + // @@protoc_insertion_point(class_scope:google.rpc.QuotaFailure.Violation) + private static final com.google.rpc.QuotaFailure.Violation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.QuotaFailure.Violation(); + } + + public static com.google.rpc.QuotaFailure.Violation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Violation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Violation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure.Violation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public static final int VIOLATIONS_FIELD_NUMBER = 1; + private java.util.List violations_; + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + @java.lang.Override + public java.util.List getViolationsList() { + return violations_; + } + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + @java.lang.Override + public java.util.List + getViolationsOrBuilderList() { + return violations_; + } + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + @java.lang.Override + public int getViolationsCount() { + return violations_.size(); + } + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + @java.lang.Override + public com.google.rpc.QuotaFailure.Violation getViolations(int index) { + return violations_.get(index); + } + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + @java.lang.Override + public com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder( + int index) { + return violations_.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 < violations_.size(); i++) { + output.writeMessage(1, violations_.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 < violations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, violations_.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.rpc.QuotaFailure)) { + return super.equals(obj); + } + com.google.rpc.QuotaFailure other = (com.google.rpc.QuotaFailure) obj; + + if (!getViolationsList() + .equals(other.getViolationsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getViolationsCount() > 0) { + hash = (37 * hash) + VIOLATIONS_FIELD_NUMBER; + hash = (53 * hash) + getViolationsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.QuotaFailure parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.QuotaFailure parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure 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.rpc.QuotaFailure parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.QuotaFailure parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.QuotaFailure parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure 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.rpc.QuotaFailure parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure 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.rpc.QuotaFailure parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.QuotaFailure 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.rpc.QuotaFailure 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; + } + /** + *
+   * Describes how a quota check failed.
+   * For example if a daily limit was exceeded for the calling project,
+   * a service could respond with a QuotaFailure detail containing the project
+   * id and the description of the quota limit that was exceeded.  If the
+   * calling project hasn't enabled the service in the developer console, then
+   * a service could respond with the project id and set `service_disabled`
+   * to true.
+   * Also see RetryDetail and Help types for other details about handling a
+   * quota failure.
+   * 
+ * + * Protobuf type {@code google.rpc.QuotaFailure} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.QuotaFailure) + com.google.rpc.QuotaFailureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.QuotaFailure.class, com.google.rpc.QuotaFailure.Builder.class); + } + + // Construct using com.google.rpc.QuotaFailure.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getViolationsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + violationsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_QuotaFailure_descriptor; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure getDefaultInstanceForType() { + return com.google.rpc.QuotaFailure.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.QuotaFailure build() { + com.google.rpc.QuotaFailure result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure buildPartial() { + com.google.rpc.QuotaFailure result = new com.google.rpc.QuotaFailure(this); + int from_bitField0_ = bitField0_; + if (violationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + violations_ = java.util.Collections.unmodifiableList(violations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.violations_ = violations_; + } else { + result.violations_ = violationsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.QuotaFailure) { + return mergeFrom((com.google.rpc.QuotaFailure)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.QuotaFailure other) { + if (other == com.google.rpc.QuotaFailure.getDefaultInstance()) return this; + if (violationsBuilder_ == null) { + if (!other.violations_.isEmpty()) { + if (violations_.isEmpty()) { + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureViolationsIsMutable(); + violations_.addAll(other.violations_); + } + onChanged(); + } + } else { + if (!other.violations_.isEmpty()) { + if (violationsBuilder_.isEmpty()) { + violationsBuilder_.dispose(); + violationsBuilder_ = null; + violations_ = other.violations_; + bitField0_ = (bitField0_ & ~0x00000001); + violationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getViolationsFieldBuilder() : null; + } else { + violationsBuilder_.addAllMessages(other.violations_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.QuotaFailure parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.QuotaFailure) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List violations_ = + java.util.Collections.emptyList(); + private void ensureViolationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + violations_ = new java.util.ArrayList(violations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder> violationsBuilder_; + + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public java.util.List getViolationsList() { + if (violationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(violations_); + } else { + return violationsBuilder_.getMessageList(); + } + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public int getViolationsCount() { + if (violationsBuilder_ == null) { + return violations_.size(); + } else { + return violationsBuilder_.getCount(); + } + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public com.google.rpc.QuotaFailure.Violation getViolations(int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); + } else { + return violationsBuilder_.getMessage(index); + } + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.rpc.QuotaFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.set(index, value); + onChanged(); + } else { + violationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder setViolations( + int index, com.google.rpc.QuotaFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.set(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder addViolations(com.google.rpc.QuotaFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(value); + onChanged(); + } else { + violationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.rpc.QuotaFailure.Violation value) { + if (violationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureViolationsIsMutable(); + violations_.add(index, value); + onChanged(); + } else { + violationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder addViolations( + com.google.rpc.QuotaFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder addViolations( + int index, com.google.rpc.QuotaFailure.Violation.Builder builderForValue) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.add(index, builderForValue.build()); + onChanged(); + } else { + violationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder addAllViolations( + java.lang.Iterable values) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, violations_); + onChanged(); + } else { + violationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder clearViolations() { + if (violationsBuilder_ == null) { + violations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + violationsBuilder_.clear(); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public Builder removeViolations(int index) { + if (violationsBuilder_ == null) { + ensureViolationsIsMutable(); + violations_.remove(index); + onChanged(); + } else { + violationsBuilder_.remove(index); + } + return this; + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public com.google.rpc.QuotaFailure.Violation.Builder getViolationsBuilder( + int index) { + return getViolationsFieldBuilder().getBuilder(index); + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder( + int index) { + if (violationsBuilder_ == null) { + return violations_.get(index); } else { + return violationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public java.util.List + getViolationsOrBuilderList() { + if (violationsBuilder_ != null) { + return violationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(violations_); + } + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder() { + return getViolationsFieldBuilder().addBuilder( + com.google.rpc.QuotaFailure.Violation.getDefaultInstance()); + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public com.google.rpc.QuotaFailure.Violation.Builder addViolationsBuilder( + int index) { + return getViolationsFieldBuilder().addBuilder( + index, com.google.rpc.QuotaFailure.Violation.getDefaultInstance()); + } + /** + *
+     * Describes all quota violations.
+     * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + public java.util.List + getViolationsBuilderList() { + return getViolationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder> + getViolationsFieldBuilder() { + if (violationsBuilder_ == null) { + violationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.rpc.QuotaFailure.Violation, com.google.rpc.QuotaFailure.Violation.Builder, com.google.rpc.QuotaFailure.ViolationOrBuilder>( + violations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + violations_ = null; + } + return violationsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.QuotaFailure) + } + + // @@protoc_insertion_point(class_scope:google.rpc.QuotaFailure) + private static final com.google.rpc.QuotaFailure DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.QuotaFailure(); + } + + public static com.google.rpc.QuotaFailure getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public QuotaFailure parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new QuotaFailure(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.QuotaFailure getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java b/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java new file mode 100644 index 0000000..1c063e4 --- /dev/null +++ b/src/main/java/com/google/rpc/QuotaFailureOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface QuotaFailureOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.QuotaFailure) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + java.util.List + getViolationsList(); + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + com.google.rpc.QuotaFailure.Violation getViolations(int index); + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + int getViolationsCount(); + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + java.util.List + getViolationsOrBuilderList(); + /** + *
+   * Describes all quota violations.
+   * 
+ * + * repeated .google.rpc.QuotaFailure.Violation violations = 1; + */ + com.google.rpc.QuotaFailure.ViolationOrBuilder getViolationsOrBuilder( + int index); +} diff --git a/src/main/java/com/google/rpc/RequestInfo.java b/src/main/java/com/google/rpc/RequestInfo.java new file mode 100644 index 0000000..7148f51 --- /dev/null +++ b/src/main/java/com/google/rpc/RequestInfo.java @@ -0,0 +1,775 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Contains metadata about the request that clients can attach when filing a bug
+ * or providing other forms of feedback.
+ * 
+ * + * Protobuf type {@code google.rpc.RequestInfo} + */ +public final class RequestInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.RequestInfo) + RequestInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use RequestInfo.newBuilder() to construct. + private RequestInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RequestInfo() { + requestId_ = ""; + servingData_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RequestInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RequestInfo( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + servingData_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.RequestInfo.class, com.google.rpc.RequestInfo.Builder.class); + } + + public static final int REQUEST_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object requestId_; + /** + *
+   * An opaque string that should only be interpreted by the service generating
+   * it. For example, it can be used to identify requests in the service's logs.
+   * 
+ * + * string request_id = 1; + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + 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(); + requestId_ = s; + return s; + } + } + /** + *
+   * An opaque string that should only be interpreted by the service generating
+   * it. For example, it can be used to identify requests in the service's logs.
+   * 
+ * + * string request_id = 1; + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVING_DATA_FIELD_NUMBER = 2; + private volatile java.lang.Object servingData_; + /** + *
+   * Any data that was used to serve this request. For example, an encrypted
+   * stack trace that can be sent back to the service provider for debugging.
+   * 
+ * + * string serving_data = 2; + * @return The servingData. + */ + @java.lang.Override + public java.lang.String getServingData() { + java.lang.Object ref = servingData_; + 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(); + servingData_ = s; + return s; + } + } + /** + *
+   * Any data that was used to serve this request. For example, an encrypted
+   * stack trace that can be sent back to the service provider for debugging.
+   * 
+ * + * string serving_data = 2; + * @return The bytes for servingData. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServingDataBytes() { + java.lang.Object ref = servingData_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + servingData_ = 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 (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, requestId_); + } + if (!getServingDataBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, servingData_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, requestId_); + } + if (!getServingDataBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, servingData_); + } + 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.rpc.RequestInfo)) { + return super.equals(obj); + } + com.google.rpc.RequestInfo other = (com.google.rpc.RequestInfo) obj; + + if (!getRequestId() + .equals(other.getRequestId())) return false; + if (!getServingData() + .equals(other.getServingData())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + SERVING_DATA_FIELD_NUMBER; + hash = (53 * hash) + getServingData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.RequestInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RequestInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.RequestInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RequestInfo 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.rpc.RequestInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RequestInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.RequestInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.RequestInfo 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.rpc.RequestInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.RequestInfo 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.rpc.RequestInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.RequestInfo 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.rpc.RequestInfo 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; + } + /** + *
+   * Contains metadata about the request that clients can attach when filing a bug
+   * or providing other forms of feedback.
+   * 
+ * + * Protobuf type {@code google.rpc.RequestInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.RequestInfo) + com.google.rpc.RequestInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.RequestInfo.class, com.google.rpc.RequestInfo.Builder.class); + } + + // Construct using com.google.rpc.RequestInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + requestId_ = ""; + + servingData_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RequestInfo_descriptor; + } + + @java.lang.Override + public com.google.rpc.RequestInfo getDefaultInstanceForType() { + return com.google.rpc.RequestInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.RequestInfo build() { + com.google.rpc.RequestInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.RequestInfo buildPartial() { + com.google.rpc.RequestInfo result = new com.google.rpc.RequestInfo(this); + result.requestId_ = requestId_; + result.servingData_ = servingData_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.RequestInfo) { + return mergeFrom((com.google.rpc.RequestInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.RequestInfo other) { + if (other == com.google.rpc.RequestInfo.getDefaultInstance()) return this; + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getServingData().isEmpty()) { + servingData_ = other.servingData_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.RequestInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.RequestInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object requestId_ = ""; + /** + *
+     * An opaque string that should only be interpreted by the service generating
+     * it. For example, it can be used to identify requests in the service's logs.
+     * 
+ * + * string request_id = 1; + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * An opaque string that should only be interpreted by the service generating
+     * it. For example, it can be used to identify requests in the service's logs.
+     * 
+ * + * string request_id = 1; + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString + getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * An opaque string that should only be interpreted by the service generating
+     * it. For example, it can be used to identify requests in the service's logs.
+     * 
+ * + * string request_id = 1; + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + *
+     * An opaque string that should only be interpreted by the service generating
+     * it. For example, it can be used to identify requests in the service's logs.
+     * 
+ * + * string request_id = 1; + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + *
+     * An opaque string that should only be interpreted by the service generating
+     * it. For example, it can be used to identify requests in the service's logs.
+     * 
+ * + * string request_id = 1; + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object servingData_ = ""; + /** + *
+     * Any data that was used to serve this request. For example, an encrypted
+     * stack trace that can be sent back to the service provider for debugging.
+     * 
+ * + * string serving_data = 2; + * @return The servingData. + */ + public java.lang.String getServingData() { + java.lang.Object ref = servingData_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + servingData_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Any data that was used to serve this request. For example, an encrypted
+     * stack trace that can be sent back to the service provider for debugging.
+     * 
+ * + * string serving_data = 2; + * @return The bytes for servingData. + */ + public com.google.protobuf.ByteString + getServingDataBytes() { + java.lang.Object ref = servingData_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + servingData_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Any data that was used to serve this request. For example, an encrypted
+     * stack trace that can be sent back to the service provider for debugging.
+     * 
+ * + * string serving_data = 2; + * @param value The servingData to set. + * @return This builder for chaining. + */ + public Builder setServingData( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + servingData_ = value; + onChanged(); + return this; + } + /** + *
+     * Any data that was used to serve this request. For example, an encrypted
+     * stack trace that can be sent back to the service provider for debugging.
+     * 
+ * + * string serving_data = 2; + * @return This builder for chaining. + */ + public Builder clearServingData() { + + servingData_ = getDefaultInstance().getServingData(); + onChanged(); + return this; + } + /** + *
+     * Any data that was used to serve this request. For example, an encrypted
+     * stack trace that can be sent back to the service provider for debugging.
+     * 
+ * + * string serving_data = 2; + * @param value The bytes for servingData to set. + * @return This builder for chaining. + */ + public Builder setServingDataBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + servingData_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.RequestInfo) + } + + // @@protoc_insertion_point(class_scope:google.rpc.RequestInfo) + private static final com.google.rpc.RequestInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.RequestInfo(); + } + + public static com.google.rpc.RequestInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequestInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RequestInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.RequestInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/RequestInfoOrBuilder.java b/src/main/java/com/google/rpc/RequestInfoOrBuilder.java new file mode 100644 index 0000000..764a49c --- /dev/null +++ b/src/main/java/com/google/rpc/RequestInfoOrBuilder.java @@ -0,0 +1,53 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface RequestInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.RequestInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * An opaque string that should only be interpreted by the service generating
+   * it. For example, it can be used to identify requests in the service's logs.
+   * 
+ * + * string request_id = 1; + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + *
+   * An opaque string that should only be interpreted by the service generating
+   * it. For example, it can be used to identify requests in the service's logs.
+   * 
+ * + * string request_id = 1; + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString + getRequestIdBytes(); + + /** + *
+   * Any data that was used to serve this request. For example, an encrypted
+   * stack trace that can be sent back to the service provider for debugging.
+   * 
+ * + * string serving_data = 2; + * @return The servingData. + */ + java.lang.String getServingData(); + /** + *
+   * Any data that was used to serve this request. For example, an encrypted
+   * stack trace that can be sent back to the service provider for debugging.
+   * 
+ * + * string serving_data = 2; + * @return The bytes for servingData. + */ + com.google.protobuf.ByteString + getServingDataBytes(); +} diff --git a/src/main/java/com/google/rpc/ResourceInfo.java b/src/main/java/com/google/rpc/ResourceInfo.java new file mode 100644 index 0000000..f0b6552 --- /dev/null +++ b/src/main/java/com/google/rpc/ResourceInfo.java @@ -0,0 +1,1147 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes the resource that is being accessed.
+ * 
+ * + * Protobuf type {@code google.rpc.ResourceInfo} + */ +public final class ResourceInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.ResourceInfo) + ResourceInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use ResourceInfo.newBuilder() to construct. + private ResourceInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ResourceInfo() { + resourceType_ = ""; + resourceName_ = ""; + owner_ = ""; + description_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ResourceInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ResourceInfo( + 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; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceType_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceName_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + owner_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.ResourceInfo.class, com.google.rpc.ResourceInfo.Builder.class); + } + + public static final int RESOURCE_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object resourceType_; + /** + *
+   * A name for the type of resource being accessed, e.g. "sql table",
+   * "cloud storage bucket", "file", "Google calendar"; or the type URL
+   * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+   * 
+ * + * string resource_type = 1; + * @return The resourceType. + */ + @java.lang.Override + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + 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(); + resourceType_ = s; + return s; + } + } + /** + *
+   * A name for the type of resource being accessed, e.g. "sql table",
+   * "cloud storage bucket", "file", "Google calendar"; or the type URL
+   * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+   * 
+ * + * string resource_type = 1; + * @return The bytes for resourceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceName_; + /** + *
+   * The name of the resource being accessed.  For example, a shared calendar
+   * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+   * 
+ * + * string resource_name = 2; + * @return The resourceName. + */ + @java.lang.Override + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + 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(); + resourceName_ = s; + return s; + } + } + /** + *
+   * The name of the resource being accessed.  For example, a shared calendar
+   * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+   * 
+ * + * string resource_name = 2; + * @return The bytes for resourceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OWNER_FIELD_NUMBER = 3; + private volatile java.lang.Object owner_; + /** + *
+   * The owner of the resource (optional).
+   * For example, "user:<owner email>" or "project:<Google developer project
+   * id>".
+   * 
+ * + * string owner = 3; + * @return The owner. + */ + @java.lang.Override + public java.lang.String getOwner() { + java.lang.Object ref = owner_; + 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(); + owner_ = s; + return s; + } + } + /** + *
+   * The owner of the resource (optional).
+   * For example, "user:<owner email>" or "project:<Google developer project
+   * id>".
+   * 
+ * + * string owner = 3; + * @return The bytes for owner. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOwnerBytes() { + java.lang.Object ref = owner_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + owner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 4; + private volatile java.lang.Object description_; + /** + *
+   * Describes what error is encountered when accessing this resource.
+   * For example, updating a cloud project may require the `writer` permission
+   * on the developer console project.
+   * 
+ * + * string description = 4; + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + *
+   * Describes what error is encountered when accessing this resource.
+   * For example, updating a cloud project may require the `writer` permission
+   * on the developer console project.
+   * 
+ * + * string description = 4; + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getResourceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, resourceType_); + } + if (!getResourceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceName_); + } + if (!getOwnerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, owner_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getResourceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, resourceType_); + } + if (!getResourceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceName_); + } + if (!getOwnerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, owner_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.ResourceInfo)) { + return super.equals(obj); + } + com.google.rpc.ResourceInfo other = (com.google.rpc.ResourceInfo) obj; + + if (!getResourceType() + .equals(other.getResourceType())) return false; + if (!getResourceName() + .equals(other.getResourceName())) return false; + if (!getOwner() + .equals(other.getOwner())) return false; + if (!getDescription() + .equals(other.getDescription())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getResourceType().hashCode(); + hash = (37 * hash) + RESOURCE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getResourceName().hashCode(); + hash = (37 * hash) + OWNER_FIELD_NUMBER; + hash = (53 * hash) + getOwner().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.ResourceInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.ResourceInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.ResourceInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.ResourceInfo 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.rpc.ResourceInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.ResourceInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.ResourceInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.ResourceInfo 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.rpc.ResourceInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.ResourceInfo 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.rpc.ResourceInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.ResourceInfo 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.rpc.ResourceInfo 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; + } + /** + *
+   * Describes the resource that is being accessed.
+   * 
+ * + * Protobuf type {@code google.rpc.ResourceInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.ResourceInfo) + com.google.rpc.ResourceInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.ResourceInfo.class, com.google.rpc.ResourceInfo.Builder.class); + } + + // Construct using com.google.rpc.ResourceInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + resourceType_ = ""; + + resourceName_ = ""; + + owner_ = ""; + + description_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_ResourceInfo_descriptor; + } + + @java.lang.Override + public com.google.rpc.ResourceInfo getDefaultInstanceForType() { + return com.google.rpc.ResourceInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.ResourceInfo build() { + com.google.rpc.ResourceInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.ResourceInfo buildPartial() { + com.google.rpc.ResourceInfo result = new com.google.rpc.ResourceInfo(this); + result.resourceType_ = resourceType_; + result.resourceName_ = resourceName_; + result.owner_ = owner_; + result.description_ = description_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.ResourceInfo) { + return mergeFrom((com.google.rpc.ResourceInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.ResourceInfo other) { + if (other == com.google.rpc.ResourceInfo.getDefaultInstance()) return this; + if (!other.getResourceType().isEmpty()) { + resourceType_ = other.resourceType_; + onChanged(); + } + if (!other.getResourceName().isEmpty()) { + resourceName_ = other.resourceName_; + onChanged(); + } + if (!other.getOwner().isEmpty()) { + owner_ = other.owner_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.ResourceInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.ResourceInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object resourceType_ = ""; + /** + *
+     * A name for the type of resource being accessed, e.g. "sql table",
+     * "cloud storage bucket", "file", "Google calendar"; or the type URL
+     * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+     * 
+ * + * string resource_type = 1; + * @return The resourceType. + */ + public java.lang.String getResourceType() { + java.lang.Object ref = resourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A name for the type of resource being accessed, e.g. "sql table",
+     * "cloud storage bucket", "file", "Google calendar"; or the type URL
+     * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+     * 
+ * + * string resource_type = 1; + * @return The bytes for resourceType. + */ + public com.google.protobuf.ByteString + getResourceTypeBytes() { + java.lang.Object ref = resourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A name for the type of resource being accessed, e.g. "sql table",
+     * "cloud storage bucket", "file", "Google calendar"; or the type URL
+     * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+     * 
+ * + * string resource_type = 1; + * @param value The resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceType_ = value; + onChanged(); + return this; + } + /** + *
+     * A name for the type of resource being accessed, e.g. "sql table",
+     * "cloud storage bucket", "file", "Google calendar"; or the type URL
+     * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+     * 
+ * + * string resource_type = 1; + * @return This builder for chaining. + */ + public Builder clearResourceType() { + + resourceType_ = getDefaultInstance().getResourceType(); + onChanged(); + return this; + } + /** + *
+     * A name for the type of resource being accessed, e.g. "sql table",
+     * "cloud storage bucket", "file", "Google calendar"; or the type URL
+     * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+     * 
+ * + * string resource_type = 1; + * @param value The bytes for resourceType to set. + * @return This builder for chaining. + */ + public Builder setResourceTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceName_ = ""; + /** + *
+     * The name of the resource being accessed.  For example, a shared calendar
+     * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * string resource_name = 2; + * @return The resourceName. + */ + public java.lang.String getResourceName() { + java.lang.Object ref = resourceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The name of the resource being accessed.  For example, a shared calendar
+     * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * string resource_name = 2; + * @return The bytes for resourceName. + */ + public com.google.protobuf.ByteString + getResourceNameBytes() { + java.lang.Object ref = resourceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The name of the resource being accessed.  For example, a shared calendar
+     * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * string resource_name = 2; + * @param value The resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceName_ = value; + onChanged(); + return this; + } + /** + *
+     * The name of the resource being accessed.  For example, a shared calendar
+     * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * string resource_name = 2; + * @return This builder for chaining. + */ + public Builder clearResourceName() { + + resourceName_ = getDefaultInstance().getResourceName(); + onChanged(); + return this; + } + /** + *
+     * The name of the resource being accessed.  For example, a shared calendar
+     * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+     * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+     * 
+ * + * string resource_name = 2; + * @param value The bytes for resourceName to set. + * @return This builder for chaining. + */ + public Builder setResourceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object owner_ = ""; + /** + *
+     * The owner of the resource (optional).
+     * For example, "user:<owner email>" or "project:<Google developer project
+     * id>".
+     * 
+ * + * string owner = 3; + * @return The owner. + */ + public java.lang.String getOwner() { + java.lang.Object ref = owner_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + owner_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The owner of the resource (optional).
+     * For example, "user:<owner email>" or "project:<Google developer project
+     * id>".
+     * 
+ * + * string owner = 3; + * @return The bytes for owner. + */ + public com.google.protobuf.ByteString + getOwnerBytes() { + java.lang.Object ref = owner_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + owner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The owner of the resource (optional).
+     * For example, "user:<owner email>" or "project:<Google developer project
+     * id>".
+     * 
+ * + * string owner = 3; + * @param value The owner to set. + * @return This builder for chaining. + */ + public Builder setOwner( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + owner_ = value; + onChanged(); + return this; + } + /** + *
+     * The owner of the resource (optional).
+     * For example, "user:<owner email>" or "project:<Google developer project
+     * id>".
+     * 
+ * + * string owner = 3; + * @return This builder for chaining. + */ + public Builder clearOwner() { + + owner_ = getDefaultInstance().getOwner(); + onChanged(); + return this; + } + /** + *
+     * The owner of the resource (optional).
+     * For example, "user:<owner email>" or "project:<Google developer project
+     * id>".
+     * 
+ * + * string owner = 3; + * @param value The bytes for owner to set. + * @return This builder for chaining. + */ + public Builder setOwnerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + owner_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + *
+     * Describes what error is encountered when accessing this resource.
+     * For example, updating a cloud project may require the `writer` permission
+     * on the developer console project.
+     * 
+ * + * string description = 4; + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Describes what error is encountered when accessing this resource.
+     * For example, updating a cloud project may require the `writer` permission
+     * on the developer console project.
+     * 
+ * + * string description = 4; + * @return The bytes for description. + */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Describes what error is encountered when accessing this resource.
+     * For example, updating a cloud project may require the `writer` permission
+     * on the developer console project.
+     * 
+ * + * string description = 4; + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + *
+     * Describes what error is encountered when accessing this resource.
+     * For example, updating a cloud project may require the `writer` permission
+     * on the developer console project.
+     * 
+ * + * string description = 4; + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + *
+     * Describes what error is encountered when accessing this resource.
+     * For example, updating a cloud project may require the `writer` permission
+     * on the developer console project.
+     * 
+ * + * string description = 4; + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.ResourceInfo) + } + + // @@protoc_insertion_point(class_scope:google.rpc.ResourceInfo) + private static final com.google.rpc.ResourceInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.ResourceInfo(); + } + + public static com.google.rpc.ResourceInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ResourceInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ResourceInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.ResourceInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java b/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java new file mode 100644 index 0000000..9ffd08f --- /dev/null +++ b/src/main/java/com/google/rpc/ResourceInfoOrBuilder.java @@ -0,0 +1,105 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface ResourceInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.ResourceInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * A name for the type of resource being accessed, e.g. "sql table",
+   * "cloud storage bucket", "file", "Google calendar"; or the type URL
+   * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+   * 
+ * + * string resource_type = 1; + * @return The resourceType. + */ + java.lang.String getResourceType(); + /** + *
+   * A name for the type of resource being accessed, e.g. "sql table",
+   * "cloud storage bucket", "file", "Google calendar"; or the type URL
+   * of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic".
+   * 
+ * + * string resource_type = 1; + * @return The bytes for resourceType. + */ + com.google.protobuf.ByteString + getResourceTypeBytes(); + + /** + *
+   * The name of the resource being accessed.  For example, a shared calendar
+   * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+   * 
+ * + * string resource_name = 2; + * @return The resourceName. + */ + java.lang.String getResourceName(); + /** + *
+   * The name of the resource being accessed.  For example, a shared calendar
+   * name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
+   * error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
+   * 
+ * + * string resource_name = 2; + * @return The bytes for resourceName. + */ + com.google.protobuf.ByteString + getResourceNameBytes(); + + /** + *
+   * The owner of the resource (optional).
+   * For example, "user:<owner email>" or "project:<Google developer project
+   * id>".
+   * 
+ * + * string owner = 3; + * @return The owner. + */ + java.lang.String getOwner(); + /** + *
+   * The owner of the resource (optional).
+   * For example, "user:<owner email>" or "project:<Google developer project
+   * id>".
+   * 
+ * + * string owner = 3; + * @return The bytes for owner. + */ + com.google.protobuf.ByteString + getOwnerBytes(); + + /** + *
+   * Describes what error is encountered when accessing this resource.
+   * For example, updating a cloud project may require the `writer` permission
+   * on the developer console project.
+   * 
+ * + * string description = 4; + * @return The description. + */ + java.lang.String getDescription(); + /** + *
+   * Describes what error is encountered when accessing this resource.
+   * For example, updating a cloud project may require the `writer` permission
+   * on the developer console project.
+   * 
+ * + * string description = 4; + * @return The bytes for description. + */ + com.google.protobuf.ByteString + getDescriptionBytes(); +} diff --git a/src/main/java/com/google/rpc/RetryInfo.java b/src/main/java/com/google/rpc/RetryInfo.java new file mode 100644 index 0000000..78fb78f --- /dev/null +++ b/src/main/java/com/google/rpc/RetryInfo.java @@ -0,0 +1,683 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +/** + *
+ * Describes when the clients can retry a failed request. Clients could ignore
+ * the recommendation here or retry when this information is missing from error
+ * responses.
+ * It's always recommended that clients should use exponential backoff when
+ * retrying.
+ * Clients should wait until `retry_delay` amount of time has passed since
+ * receiving the error response before retrying.  If retrying requests also
+ * fail, clients should use an exponential backoff scheme to gradually increase
+ * the delay between retries based on `retry_delay`, until either a maximum
+ * number of retires have been reached or a maximum retry delay cap has been
+ * reached.
+ * 
+ * + * Protobuf type {@code google.rpc.RetryInfo} + */ +public final class RetryInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.RetryInfo) + RetryInfoOrBuilder { +private static final long serialVersionUID = 0L; + // Use RetryInfo.newBuilder() to construct. + private RetryInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RetryInfo() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new RetryInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private RetryInfo( + 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; + case 10: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (retryDelay_ != null) { + subBuilder = retryDelay_.toBuilder(); + } + retryDelay_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(retryDelay_); + retryDelay_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + 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.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.RetryInfo.class, com.google.rpc.RetryInfo.Builder.class); + } + + public static final int RETRY_DELAY_FIELD_NUMBER = 1; + private com.google.protobuf.Duration retryDelay_; + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return Whether the retryDelay field is set. + */ + @java.lang.Override + public boolean hasRetryDelay() { + return retryDelay_ != null; + } + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return The retryDelay. + */ + @java.lang.Override + public com.google.protobuf.Duration getRetryDelay() { + return retryDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retryDelay_; + } + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { + return getRetryDelay(); + } + + 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 (retryDelay_ != null) { + output.writeMessage(1, getRetryDelay()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (retryDelay_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRetryDelay()); + } + 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.rpc.RetryInfo)) { + return super.equals(obj); + } + com.google.rpc.RetryInfo other = (com.google.rpc.RetryInfo) obj; + + if (hasRetryDelay() != other.hasRetryDelay()) return false; + if (hasRetryDelay()) { + if (!getRetryDelay() + .equals(other.getRetryDelay())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRetryDelay()) { + hash = (37 * hash) + RETRY_DELAY_FIELD_NUMBER; + hash = (53 * hash) + getRetryDelay().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.RetryInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RetryInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.RetryInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RetryInfo 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.rpc.RetryInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.RetryInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.RetryInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.RetryInfo 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.rpc.RetryInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.RetryInfo 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.rpc.RetryInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.RetryInfo 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.rpc.RetryInfo 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; + } + /** + *
+   * Describes when the clients can retry a failed request. Clients could ignore
+   * the recommendation here or retry when this information is missing from error
+   * responses.
+   * It's always recommended that clients should use exponential backoff when
+   * retrying.
+   * Clients should wait until `retry_delay` amount of time has passed since
+   * receiving the error response before retrying.  If retrying requests also
+   * fail, clients should use an exponential backoff scheme to gradually increase
+   * the delay between retries based on `retry_delay`, until either a maximum
+   * number of retires have been reached or a maximum retry delay cap has been
+   * reached.
+   * 
+ * + * Protobuf type {@code google.rpc.RetryInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.RetryInfo) + com.google.rpc.RetryInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.RetryInfo.class, com.google.rpc.RetryInfo.Builder.class); + } + + // Construct using com.google.rpc.RetryInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (retryDelayBuilder_ == null) { + retryDelay_ = null; + } else { + retryDelay_ = null; + retryDelayBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.ErrorDetailsProto.internal_static_google_rpc_RetryInfo_descriptor; + } + + @java.lang.Override + public com.google.rpc.RetryInfo getDefaultInstanceForType() { + return com.google.rpc.RetryInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.RetryInfo build() { + com.google.rpc.RetryInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.RetryInfo buildPartial() { + com.google.rpc.RetryInfo result = new com.google.rpc.RetryInfo(this); + if (retryDelayBuilder_ == null) { + result.retryDelay_ = retryDelay_; + } else { + result.retryDelay_ = retryDelayBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.RetryInfo) { + return mergeFrom((com.google.rpc.RetryInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.RetryInfo other) { + if (other == com.google.rpc.RetryInfo.getDefaultInstance()) return this; + if (other.hasRetryDelay()) { + mergeRetryDelay(other.getRetryDelay()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.RetryInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.RetryInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Duration retryDelay_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> retryDelayBuilder_; + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return Whether the retryDelay field is set. + */ + public boolean hasRetryDelay() { + return retryDelayBuilder_ != null || retryDelay_ != null; + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return The retryDelay. + */ + public com.google.protobuf.Duration getRetryDelay() { + if (retryDelayBuilder_ == null) { + return retryDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : retryDelay_; + } else { + return retryDelayBuilder_.getMessage(); + } + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public Builder setRetryDelay(com.google.protobuf.Duration value) { + if (retryDelayBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + retryDelay_ = value; + onChanged(); + } else { + retryDelayBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public Builder setRetryDelay( + com.google.protobuf.Duration.Builder builderForValue) { + if (retryDelayBuilder_ == null) { + retryDelay_ = builderForValue.build(); + onChanged(); + } else { + retryDelayBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public Builder mergeRetryDelay(com.google.protobuf.Duration value) { + if (retryDelayBuilder_ == null) { + if (retryDelay_ != null) { + retryDelay_ = + com.google.protobuf.Duration.newBuilder(retryDelay_).mergeFrom(value).buildPartial(); + } else { + retryDelay_ = value; + } + onChanged(); + } else { + retryDelayBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public Builder clearRetryDelay() { + if (retryDelayBuilder_ == null) { + retryDelay_ = null; + onChanged(); + } else { + retryDelay_ = null; + retryDelayBuilder_ = null; + } + + return this; + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public com.google.protobuf.Duration.Builder getRetryDelayBuilder() { + + onChanged(); + return getRetryDelayFieldBuilder().getBuilder(); + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + public com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder() { + if (retryDelayBuilder_ != null) { + return retryDelayBuilder_.getMessageOrBuilder(); + } else { + return retryDelay_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : retryDelay_; + } + } + /** + *
+     * Clients should wait at least this long between retrying the same request.
+     * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getRetryDelayFieldBuilder() { + if (retryDelayBuilder_ == null) { + retryDelayBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getRetryDelay(), + getParentForChildren(), + isClean()); + retryDelay_ = null; + } + return retryDelayBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.RetryInfo) + } + + // @@protoc_insertion_point(class_scope:google.rpc.RetryInfo) + private static final com.google.rpc.RetryInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.RetryInfo(); + } + + public static com.google.rpc.RetryInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RetryInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RetryInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.RetryInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/RetryInfoOrBuilder.java b/src/main/java/com/google/rpc/RetryInfoOrBuilder.java new file mode 100644 index 0000000..2350a0b --- /dev/null +++ b/src/main/java/com/google/rpc/RetryInfoOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/error_details.proto + +package com.google.rpc; + +public interface RetryInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.RetryInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return Whether the retryDelay field is set. + */ + boolean hasRetryDelay(); + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + * @return The retryDelay. + */ + com.google.protobuf.Duration getRetryDelay(); + /** + *
+   * Clients should wait at least this long between retrying the same request.
+   * 
+ * + * .google.protobuf.Duration retry_delay = 1; + */ + com.google.protobuf.DurationOrBuilder getRetryDelayOrBuilder(); +} diff --git a/src/main/java/com/google/rpc/Status.java b/src/main/java/com/google/rpc/Status.java new file mode 100644 index 0000000..b9e0bba --- /dev/null +++ b/src/main/java/com/google/rpc/Status.java @@ -0,0 +1,1229 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/status.proto + +package com.google.rpc; + +/** + *
+ * The `Status` type defines a logical error model that is suitable for different
+ * programming environments, including REST APIs and RPC APIs. It is used by
+ * [gRPC](https://github.com/grpc). The error model is designed to be:
+ * - Simple to use and understand for most users
+ * - Flexible enough to meet unexpected needs
+ * # Overview
+ * The `Status` message contains three pieces of data: error code, error message,
+ * and error details. The error code should be an enum value of
+ * [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed.  The
+ * error message should be a developer-facing English message that helps
+ * developers *understand* and *resolve* the error. If a localized user-facing
+ * error message is needed, put the localized message in the error details or
+ * localize it in the client. The optional error details may contain arbitrary
+ * information about the error. There is a predefined set of error detail types
+ * in the package `google.rpc` that can be used for common error conditions.
+ * # Language mapping
+ * The `Status` message is the logical representation of the error model, but it
+ * is not necessarily the actual wire format. When the `Status` message is
+ * exposed in different client libraries and different wire protocols, it can be
+ * mapped differently. For example, it will likely be mapped to some exceptions
+ * in Java, but more likely mapped to some error codes in C.
+ * # Other uses
+ * The error model and the `Status` message can be used in a variety of
+ * environments, either with or without APIs, to provide a
+ * consistent developer experience across different environments.
+ * Example uses of this error model include:
+ * - Partial errors. If a service needs to return partial errors to the client,
+ *     it may embed the `Status` in the normal response to indicate the partial
+ *     errors.
+ * - Workflow errors. A typical workflow has multiple steps. Each step may
+ *     have a `Status` message for error reporting.
+ * - Batch operations. If a client uses batch request and batch response, the
+ *     `Status` message should be used directly inside batch response, one for
+ *     each error sub-response.
+ * - Asynchronous operations. If an API call embeds asynchronous operation
+ *     results in its response, the status of those operations should be
+ *     represented directly using the `Status` message.
+ * - Logging. If some API errors are stored in logs, the message `Status` could
+ *     be used directly after any stripping needed for security/privacy reasons.
+ * 
+ * + * Protobuf type {@code google.rpc.Status} + */ +public final class Status extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.rpc.Status) + StatusOrBuilder { +private static final long serialVersionUID = 0L; + // Use Status.newBuilder() to construct. + private Status(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Status() { + message_ = ""; + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Status(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Status( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + code_ = input.readInt32(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + details_.add( + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.StatusProto.internal_static_google_rpc_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.StatusProto.internal_static_google_rpc_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Status.class, com.google.rpc.Status.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + *
+   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
+   * 
+ * + * int32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + /** + *
+   * A developer-facing error message, which should be in English. Any
+   * user-facing error message should be localized and sent in the
+   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+   * 
+ * + * string message = 2; + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + /** + *
+   * A developer-facing error message, which should be in English. Any
+   * user-facing error message should be localized and sent in the
+   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+   * 
+ * + * string message = 2; + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DETAILS_FIELD_NUMBER = 3; + private java.util.List details_; + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + @java.lang.Override + public java.util.List + getDetailsOrBuilderList() { + return details_; + } + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder( + int index) { + return details_.get(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (code_ != 0) { + output.writeInt32(1, code_); + } + if (!getMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(3, details_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, code_); + } + if (!getMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, details_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.rpc.Status)) { + return super.equals(obj); + } + com.google.rpc.Status other = (com.google.rpc.Status) obj; + + if (getCode() + != other.getCode()) return false; + if (!getMessage() + .equals(other.getMessage())) return false; + if (!getDetailsList() + .equals(other.getDetailsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.rpc.Status parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Status parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Status parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Status 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.rpc.Status parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.rpc.Status parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.rpc.Status parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Status 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.rpc.Status parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.rpc.Status 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.rpc.Status parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.rpc.Status 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.rpc.Status 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 `Status` type defines a logical error model that is suitable for different
+   * programming environments, including REST APIs and RPC APIs. It is used by
+   * [gRPC](https://github.com/grpc). The error model is designed to be:
+   * - Simple to use and understand for most users
+   * - Flexible enough to meet unexpected needs
+   * # Overview
+   * The `Status` message contains three pieces of data: error code, error message,
+   * and error details. The error code should be an enum value of
+   * [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed.  The
+   * error message should be a developer-facing English message that helps
+   * developers *understand* and *resolve* the error. If a localized user-facing
+   * error message is needed, put the localized message in the error details or
+   * localize it in the client. The optional error details may contain arbitrary
+   * information about the error. There is a predefined set of error detail types
+   * in the package `google.rpc` that can be used for common error conditions.
+   * # Language mapping
+   * The `Status` message is the logical representation of the error model, but it
+   * is not necessarily the actual wire format. When the `Status` message is
+   * exposed in different client libraries and different wire protocols, it can be
+   * mapped differently. For example, it will likely be mapped to some exceptions
+   * in Java, but more likely mapped to some error codes in C.
+   * # Other uses
+   * The error model and the `Status` message can be used in a variety of
+   * environments, either with or without APIs, to provide a
+   * consistent developer experience across different environments.
+   * Example uses of this error model include:
+   * - Partial errors. If a service needs to return partial errors to the client,
+   *     it may embed the `Status` in the normal response to indicate the partial
+   *     errors.
+   * - Workflow errors. A typical workflow has multiple steps. Each step may
+   *     have a `Status` message for error reporting.
+   * - Batch operations. If a client uses batch request and batch response, the
+   *     `Status` message should be used directly inside batch response, one for
+   *     each error sub-response.
+   * - Asynchronous operations. If an API call embeds asynchronous operation
+   *     results in its response, the status of those operations should be
+   *     represented directly using the `Status` message.
+   * - Logging. If some API errors are stored in logs, the message `Status` could
+   *     be used directly after any stripping needed for security/privacy reasons.
+   * 
+ * + * Protobuf type {@code google.rpc.Status} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.rpc.Status) + com.google.rpc.StatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.rpc.StatusProto.internal_static_google_rpc_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.rpc.StatusProto.internal_static_google_rpc_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.rpc.Status.class, com.google.rpc.Status.Builder.class); + } + + // Construct using com.google.rpc.Status.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + message_ = ""; + + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.rpc.StatusProto.internal_static_google_rpc_Status_descriptor; + } + + @java.lang.Override + public com.google.rpc.Status getDefaultInstanceForType() { + return com.google.rpc.Status.getDefaultInstance(); + } + + @java.lang.Override + public com.google.rpc.Status build() { + com.google.rpc.Status result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.rpc.Status buildPartial() { + com.google.rpc.Status result = new com.google.rpc.Status(this); + int from_bitField0_ = bitField0_; + result.code_ = code_; + result.message_ = message_; + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.rpc.Status) { + return mergeFrom((com.google.rpc.Status)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.rpc.Status other) { + if (other == com.google.rpc.Status.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getDetailsFieldBuilder() : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.rpc.Status parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.rpc.Status) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int code_ ; + /** + *
+     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
+     * 
+ * + * int32 code = 1; + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + /** + *
+     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
+     * 
+ * + * int32 code = 1; + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + *
+     * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
+     * 
+ * + * int32 code = 1; + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + /** + *
+     * A developer-facing error message, which should be in English. Any
+     * user-facing error message should be localized and sent in the
+     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+     * 
+ * + * string message = 2; + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * A developer-facing error message, which should be in English. Any
+     * user-facing error message should be localized and sent in the
+     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+     * 
+ * + * string message = 2; + * @return The bytes for message. + */ + public com.google.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * A developer-facing error message, which should be in English. Any
+     * user-facing error message should be localized and sent in the
+     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+     * 
+ * + * string message = 2; + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + /** + *
+     * A developer-facing error message, which should be in English. Any
+     * user-facing error message should be localized and sent in the
+     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+     * 
+ * + * string message = 2; + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + /** + *
+     * A developer-facing error message, which should be in English. Any
+     * user-facing error message should be localized and sent in the
+     * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+     * 
+ * + * string message = 2; + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private java.util.List details_ = + java.util.Collections.emptyList(); + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> detailsBuilder_; + + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder setDetails( + int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder setDetails( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder addDetails( + int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder addDetails( + com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder addDetails( + int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder addAllDetails( + java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public com.google.protobuf.Any.Builder getDetailsBuilder( + int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder( + int index) { + if (detailsBuilder_ == null) { + return details_.get(index); } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public java.util.List + getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder( + com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder( + int index) { + return getDetailsFieldBuilder().addBuilder( + index, com.google.protobuf.Any.getDefaultInstance()); + } + /** + *
+     * A list of messages that carry the error details.  There is a common set of
+     * message types for APIs to use.
+     * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + public java.util.List + getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + details_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + details_ = null; + } + return detailsBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:google.rpc.Status) + } + + // @@protoc_insertion_point(class_scope:google.rpc.Status) + private static final com.google.rpc.Status DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.rpc.Status(); + } + + public static com.google.rpc.Status getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Status parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Status(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.rpc.Status getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/rpc/StatusOrBuilder.java b/src/main/java/com/google/rpc/StatusOrBuilder.java new file mode 100644 index 0000000..0a5c580 --- /dev/null +++ b/src/main/java/com/google/rpc/StatusOrBuilder.java @@ -0,0 +1,92 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/status.proto + +package com.google.rpc; + +public interface StatusOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.rpc.Status) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
+   * 
+ * + * int32 code = 1; + * @return The code. + */ + int getCode(); + + /** + *
+   * A developer-facing error message, which should be in English. Any
+   * user-facing error message should be localized and sent in the
+   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+   * 
+ * + * string message = 2; + * @return The message. + */ + java.lang.String getMessage(); + /** + *
+   * A developer-facing error message, which should be in English. Any
+   * user-facing error message should be localized and sent in the
+   * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
+   * 
+ * + * string message = 2; + * @return The bytes for message. + */ + com.google.protobuf.ByteString + getMessageBytes(); + + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + java.util.List + getDetailsList(); + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + com.google.protobuf.Any getDetails(int index); + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + int getDetailsCount(); + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + java.util.List + getDetailsOrBuilderList(); + /** + *
+   * A list of messages that carry the error details.  There is a common set of
+   * message types for APIs to use.
+   * 
+ * + * repeated .google.protobuf.Any details = 3; + */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder( + int index); +} diff --git a/src/main/java/com/google/rpc/StatusProto.java b/src/main/java/com/google/rpc/StatusProto.java new file mode 100644 index 0000000..4cd63b9 --- /dev/null +++ b/src/main/java/com/google/rpc/StatusProto.java @@ -0,0 +1,54 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/rpc/status.proto + +package com.google.rpc; + +public final class StatusProto { + private StatusProto() {} + 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_rpc_Status_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_rpc_Status_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\027google/rpc/status.proto\022\ngoogle.rpc\032\031g" + + "oogle/protobuf/any.proto\"N\n\006Status\022\014\n\004co" + + "de\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022%\n\007details\030\003 \003" + + "(\0132\024.google.protobuf.AnyB^\n\016com.google.r" + + "pcB\013StatusProtoP\001Z7google.golang.org/gen" + + "proto/googleapis/rpc/status;status\242\002\003RPC" + + "b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + }); + internal_static_google_rpc_Status_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_rpc_Status_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_rpc_Status_descriptor, + new java.lang.String[] { "Code", "Message", "Details", }); + com.google.protobuf.AnyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/CommonProto.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/CommonProto.java index 816fae8..58bc6be 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/CommonProto.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/CommonProto.java @@ -1956,7 +1956,7 @@ public final class CommonProto { /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -1965,7 +1965,7 @@ public final class CommonProto { java.util.List getTransactionHashesList(); /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -1974,7 +1974,7 @@ public final class CommonProto { int getTransactionHashesCount(); /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -1982,6 +1982,45 @@ public final class CommonProto { * @return The transactionHashes at the given index. */ com.google.protobuf.ByteString getTransactionHashes(int index); + + /** + *
+     * 产块者签名
+     * 
+ * + * bytes creator_signature = 12; + * @return The creatorSignature. + */ + com.google.protobuf.ByteString getCreatorSignature(); + + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @return A list containing the witnessSignatures. + */ + java.util.List getWitnessSignaturesList(); + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @return The count of witnessSignatures. + */ + int getWitnessSignaturesCount(); + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @param index The index of the element to return. + * @return The witnessSignatures at the given index. + */ + com.google.protobuf.ByteString getWitnessSignatures(int index); } /** * Protobuf type {@code bdware.bdledger.api.Block} @@ -2003,6 +2042,8 @@ public final class CommonProto { transactionsRoot_ = com.google.protobuf.ByteString.EMPTY; transactions_ = java.util.Collections.emptyList(); transactionHashes_ = java.util.Collections.emptyList(); + creatorSignature_ = com.google.protobuf.ByteString.EMPTY; + witnessSignatures_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -2104,6 +2145,19 @@ public final class CommonProto { transactionHashes_.add(input.readBytes()); break; } + case 98: { + + creatorSignature_ = input.readBytes(); + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + witnessSignatures_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + witnessSignatures_.add(input.readBytes()); + break; + } default: { if (!parseUnknownField( input, unknownFields, extensionRegistry, tag)) { @@ -2131,6 +2185,9 @@ public final class CommonProto { if (((mutable_bitField0_ & 0x00000008) != 0)) { transactionHashes_ = java.util.Collections.unmodifiableList(transactionHashes_); // C } + if (((mutable_bitField0_ & 0x00000010) != 0)) { + witnessSignatures_ = java.util.Collections.unmodifiableList(witnessSignatures_); // C + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -2395,7 +2452,7 @@ public final class CommonProto { private java.util.List transactionHashes_; /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -2408,7 +2465,7 @@ public final class CommonProto { } /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -2419,7 +2476,7 @@ public final class CommonProto { } /** *
-     * 20字节的交易哈希的数组,或为空
+     * 20字节的事务哈希的数组,或为空
      * 
* * repeated bytes transaction_hashes = 11; @@ -2430,6 +2487,60 @@ public final class CommonProto { return transactionHashes_.get(index); } + public static final int CREATOR_SIGNATURE_FIELD_NUMBER = 12; + private com.google.protobuf.ByteString creatorSignature_; + /** + *
+     * 产块者签名
+     * 
+ * + * bytes creator_signature = 12; + * @return The creatorSignature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCreatorSignature() { + return creatorSignature_; + } + + public static final int WITNESS_SIGNATURES_FIELD_NUMBER = 13; + private java.util.List witnessSignatures_; + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @return A list containing the witnessSignatures. + */ + @java.lang.Override + public java.util.List + getWitnessSignaturesList() { + return witnessSignatures_; + } + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @return The count of witnessSignatures. + */ + public int getWitnessSignaturesCount() { + return witnessSignatures_.size(); + } + /** + *
+     * 见证者签名
+     * 
+ * + * repeated bytes witness_signatures = 13; + * @param index The index of the element to return. + * @return The witnessSignatures at the given index. + */ + public com.google.protobuf.ByteString getWitnessSignatures(int index) { + return witnessSignatures_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -2477,6 +2588,12 @@ public final class CommonProto { for (int i = 0; i < transactionHashes_.size(); i++) { output.writeBytes(11, transactionHashes_.get(i)); } + if (!creatorSignature_.isEmpty()) { + output.writeBytes(12, creatorSignature_); + } + for (int i = 0; i < witnessSignatures_.size(); i++) { + output.writeBytes(13, witnessSignatures_.get(i)); + } unknownFields.writeTo(output); } @@ -2545,6 +2662,19 @@ public final class CommonProto { size += dataSize; size += 1 * getTransactionHashesList().size(); } + if (!creatorSignature_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(12, creatorSignature_); + } + { + int dataSize = 0; + for (int i = 0; i < witnessSignatures_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeBytesSizeNoTag(witnessSignatures_.get(i)); + } + size += dataSize; + size += 1 * getWitnessSignaturesList().size(); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -2582,6 +2712,10 @@ public final class CommonProto { .equals(other.getTransactionsList())) return false; if (!getTransactionHashesList() .equals(other.getTransactionHashesList())) return false; + if (!getCreatorSignature() + .equals(other.getCreatorSignature())) return false; + if (!getWitnessSignaturesList() + .equals(other.getWitnessSignaturesList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -2626,6 +2760,12 @@ public final class CommonProto { hash = (37 * hash) + TRANSACTION_HASHES_FIELD_NUMBER; hash = (53 * hash) + getTransactionHashesList().hashCode(); } + hash = (37 * hash) + CREATOR_SIGNATURE_FIELD_NUMBER; + hash = (53 * hash) + getCreatorSignature().hashCode(); + if (getWitnessSignaturesCount() > 0) { + hash = (37 * hash) + WITNESS_SIGNATURES_FIELD_NUMBER; + hash = (53 * hash) + getWitnessSignaturesList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -2786,6 +2926,10 @@ public final class CommonProto { } transactionHashes_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000008); + creatorSignature_ = com.google.protobuf.ByteString.EMPTY; + + witnessSignatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); return this; } @@ -2844,6 +2988,12 @@ public final class CommonProto { bitField0_ = (bitField0_ & ~0x00000008); } result.transactionHashes_ = transactionHashes_; + result.creatorSignature_ = creatorSignature_; + if (((bitField0_ & 0x00000010) != 0)) { + witnessSignatures_ = java.util.Collections.unmodifiableList(witnessSignatures_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.witnessSignatures_ = witnessSignatures_; onBuilt(); return result; } @@ -2969,6 +3119,19 @@ public final class CommonProto { } onChanged(); } + if (other.getCreatorSignature() != com.google.protobuf.ByteString.EMPTY) { + setCreatorSignature(other.getCreatorSignature()); + } + if (!other.witnessSignatures_.isEmpty()) { + if (witnessSignatures_.isEmpty()) { + witnessSignatures_ = other.witnessSignatures_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureWitnessSignaturesIsMutable(); + witnessSignatures_.addAll(other.witnessSignatures_); + } + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -3856,7 +4019,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3869,7 +4032,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3880,7 +4043,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3892,7 +4055,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3912,7 +4075,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3930,7 +4093,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3947,7 +4110,7 @@ public final class CommonProto { } /** *
-       * 20字节的交易哈希的数组,或为空
+       * 20字节的事务哈希的数组,或为空
        * 
* * repeated bytes transaction_hashes = 11; @@ -3959,6 +4122,165 @@ public final class CommonProto { onChanged(); return this; } + + private com.google.protobuf.ByteString creatorSignature_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * 产块者签名
+       * 
+ * + * bytes creator_signature = 12; + * @return The creatorSignature. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCreatorSignature() { + return creatorSignature_; + } + /** + *
+       * 产块者签名
+       * 
+ * + * bytes creator_signature = 12; + * @param value The creatorSignature to set. + * @return This builder for chaining. + */ + public Builder setCreatorSignature(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + creatorSignature_ = value; + onChanged(); + return this; + } + /** + *
+       * 产块者签名
+       * 
+ * + * bytes creator_signature = 12; + * @return This builder for chaining. + */ + public Builder clearCreatorSignature() { + + creatorSignature_ = getDefaultInstance().getCreatorSignature(); + onChanged(); + return this; + } + + private java.util.List witnessSignatures_ = java.util.Collections.emptyList(); + private void ensureWitnessSignaturesIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + witnessSignatures_ = new java.util.ArrayList(witnessSignatures_); + bitField0_ |= 0x00000010; + } + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @return A list containing the witnessSignatures. + */ + public java.util.List + getWitnessSignaturesList() { + return ((bitField0_ & 0x00000010) != 0) ? + java.util.Collections.unmodifiableList(witnessSignatures_) : witnessSignatures_; + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @return The count of witnessSignatures. + */ + public int getWitnessSignaturesCount() { + return witnessSignatures_.size(); + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @param index The index of the element to return. + * @return The witnessSignatures at the given index. + */ + public com.google.protobuf.ByteString getWitnessSignatures(int index) { + return witnessSignatures_.get(index); + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @param index The index to set the value at. + * @param value The witnessSignatures to set. + * @return This builder for chaining. + */ + public Builder setWitnessSignatures( + int index, com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWitnessSignaturesIsMutable(); + witnessSignatures_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @param value The witnessSignatures to add. + * @return This builder for chaining. + */ + public Builder addWitnessSignatures(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + ensureWitnessSignaturesIsMutable(); + witnessSignatures_.add(value); + onChanged(); + return this; + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @param values The witnessSignatures to add. + * @return This builder for chaining. + */ + public Builder addAllWitnessSignatures( + java.lang.Iterable values) { + ensureWitnessSignaturesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, witnessSignatures_); + onChanged(); + return this; + } + /** + *
+       * 见证者签名
+       * 
+ * + * repeated bytes witness_signatures = 13; + * @return This builder for chaining. + */ + public Builder clearWitnessSignatures() { + witnessSignatures_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -5304,26 +5626,28 @@ public final class CommonProto { "$.bdware.bdledger.api.TransactionType\022\014\n" + "\004from\030\006 \001(\014\022\r\n\005nonce\030\007 \001(\004\022\n\n\002to\030\010 \001(\014\022\014" + "\n\004data\030\t \001(\014\022\t\n\001v\030\n \001(\014\022\t\n\001r\030\013 \001(\014\022\t\n\001s\030" + - "\014 \001(\014\"\212\002\n\005Block\022\014\n\004hash\030\001 \001(\014\022\017\n\007creator" + + "\014 \001(\014\"\301\002\n\005Block\022\014\n\004hash\030\001 \001(\014\022\017\n\007creator" + "\030\002 \001(\014\022\r\n\005nonce\030\003 \001(\004\022\025\n\rparent_hashes\030\004" + " \003(\014\022\021\n\twitnesses\030\005 \003(\014\022\021\n\ttimestamp\030\006 \001" + "(\003\022\014\n\004size\030\007 \001(\004\022\031\n\021transaction_count\030\010 " + "\001(\r\022\031\n\021transactions_root\030\t \001(\014\0226\n\014transa" + "ctions\030\n \003(\0132 .bdware.bdledger.api.Trans" + - "action\022\032\n\022transaction_hashes\030\013 \003(\014\"\253\002\n\010C" + - "ontract\022\024\n\014contractName\030\001 \001(\014\022\021\n\trandomN" + - "um\030\002 \001(\r\022\021\n\toperation\030\003 \001(\014\022\013\n\003arg\030\004 \001(\014" + - "\022\014\n\004path\030\005 \001(\014\022\017\n\007content\030\006 \001(\014\022\016\n\006pubke" + - "y\030\007 \001(\014\"\246\001\n\027ContractUnitRequestType\022\t\n\005S" + - "TART\020\000\022\010\n\004STOP\020\001\022\013\n\007EXECUTE\020\002\022\t\n\005REPLY\020\003" + - "\022\013\n\007REQUEST\020\004\022\016\n\nPREPREPARE\020\005\022\013\n\007PREPARE" + - "\020\006\022\n\n\006COMMIT\020\007\022\013\n\007ADDPEER\020\010\022\014\n\010DROPPEER\020" + - "\t\022\r\n\tSTATESYNC\020\n*o\n\017TransactionType\022\n\n\006R" + - "ECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021CONTRACT_CREATIO" + - "N\020\002\022\027\n\023CONTRACT_INVOCATION\020\003\022\023\n\017CONTRACT" + - "_STATUS\020\004BY\n\037org.bdware.bdledger.api.grp" + - "c.pbB\013CommonProtoZ)bdware.org/bdledger/p" + - "kg/api/grpc/pb;apipbb\006proto3" + "action\022\032\n\022transaction_hashes\030\013 \003(\014\022\031\n\021cr" + + "eator_signature\030\014 \001(\014\022\032\n\022witness_signatu" + + "res\030\r \003(\014\"\253\002\n\010Contract\022\024\n\014contractName\030\001" + + " \001(\014\022\021\n\trandomNum\030\002 \001(\r\022\021\n\toperation\030\003 \001" + + "(\014\022\013\n\003arg\030\004 \001(\014\022\014\n\004path\030\005 \001(\014\022\017\n\007content" + + "\030\006 \001(\014\022\016\n\006pubkey\030\007 \001(\014\"\246\001\n\027ContractUnitR" + + "equestType\022\t\n\005START\020\000\022\010\n\004STOP\020\001\022\013\n\007EXECU" + + "TE\020\002\022\t\n\005REPLY\020\003\022\013\n\007REQUEST\020\004\022\016\n\nPREPREPA" + + "RE\020\005\022\013\n\007PREPARE\020\006\022\n\n\006COMMIT\020\007\022\013\n\007ADDPEER" + + "\020\010\022\014\n\010DROPPEER\020\t\022\r\n\tSTATESYNC\020\n*o\n\017Trans" + + "actionType\022\n\n\006RECORD\020\000\022\013\n\007MESSAGE\020\001\022\025\n\021C" + + "ONTRACT_CREATION\020\002\022\027\n\023CONTRACT_INVOCATIO" + + "N\020\003\022\023\n\017CONTRACT_STATUS\020\004BY\n\037org.bdware.b" + + "dledger.api.grpc.pbB\013CommonProtoZ)bdware" + + ".org/bdledger/pkg/api/grpc/pb;apipbb\006pro" + + "to3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -5340,7 +5664,7 @@ public final class CommonProto { internal_static_bdware_bdledger_api_Block_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_bdware_bdledger_api_Block_descriptor, - new java.lang.String[] { "Hash", "Creator", "Nonce", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionCount", "TransactionsRoot", "Transactions", "TransactionHashes", }); + new java.lang.String[] { "Hash", "Creator", "Nonce", "ParentHashes", "Witnesses", "Timestamp", "Size", "TransactionCount", "TransactionsRoot", "Transactions", "TransactionHashes", "CreatorSignature", "WitnessSignatures", }); internal_static_bdware_bdledger_api_Contract_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_bdware_bdledger_api_Contract_fieldAccessorTable = new diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerGrpc.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerGrpc.java index c2fb4c5..aa9606f 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerGrpc.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerGrpc.java @@ -1,25 +1,13 @@ package org.bdware.bdledger.api.grpc.pb; 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; /** */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.32.1)", + value = "by gRPC proto compiler (version 1.41.0)", comments = "Source: bdware/bdledger/api/ledger.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class LedgerGrpc { private LedgerGrpc() {} @@ -177,7 +165,7 @@ public final class LedgerGrpc { */ public void createLedger(org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCreateLedgerMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateLedgerMethod(), responseObserver); } /** @@ -189,7 +177,7 @@ public final class LedgerGrpc { */ public void getLedgers(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetLedgersMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetLedgersMethod(), responseObserver); } /** @@ -201,28 +189,28 @@ public final class LedgerGrpc { */ public void sendTransaction(org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getSendTransactionMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSendTransactionMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getCreateLedgerMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerRequest, org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerResponse>( this, METHODID_CREATE_LEDGER))) .addMethod( getGetLedgersMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.protobuf.Empty, org.bdware.bdledger.api.grpc.pb.LedgerProto.GetLedgersResponse>( this, METHODID_GET_LEDGERS))) .addMethod( getSendTransactionMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest, org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionResponse>( @@ -254,7 +242,7 @@ public final class LedgerGrpc { */ public void createLedger(org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCreateLedgerMethod(), getCallOptions()), request, responseObserver); } @@ -267,7 +255,7 @@ public final class LedgerGrpc { */ public void getLedgers(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetLedgersMethod(), getCallOptions()), request, responseObserver); } @@ -280,7 +268,7 @@ public final class LedgerGrpc { */ public void sendTransaction(org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request, responseObserver); } } @@ -307,7 +295,7 @@ public final class LedgerGrpc { * */ public org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerResponse createLedger(org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCreateLedgerMethod(), getCallOptions(), request); } @@ -319,7 +307,7 @@ public final class LedgerGrpc { * */ public org.bdware.bdledger.api.grpc.pb.LedgerProto.GetLedgersResponse getLedgers(com.google.protobuf.Empty request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetLedgersMethod(), getCallOptions(), request); } @@ -331,7 +319,7 @@ public final class LedgerGrpc { * */ public org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionResponse sendTransaction(org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getSendTransactionMethod(), getCallOptions(), request); } } @@ -359,7 +347,7 @@ public final class LedgerGrpc { */ public com.google.common.util.concurrent.ListenableFuture createLedger( org.bdware.bdledger.api.grpc.pb.LedgerProto.CreateLedgerRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCreateLedgerMethod(), getCallOptions()), request); } @@ -372,7 +360,7 @@ public final class LedgerGrpc { */ public com.google.common.util.concurrent.ListenableFuture getLedgers( com.google.protobuf.Empty request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetLedgersMethod(), getCallOptions()), request); } @@ -385,7 +373,7 @@ public final class LedgerGrpc { */ public com.google.common.util.concurrent.ListenableFuture sendTransaction( org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getSendTransactionMethod(), getCallOptions()), request); } } diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerProto.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerProto.java index 77c75b3..731ac7f 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerProto.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/LedgerProto.java @@ -19,11 +19,21 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string name = 1; * @return The name. */ java.lang.String getName(); /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string name = 1; * @return The bytes for name. */ @@ -117,6 +127,11 @@ public final class LedgerProto { public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string name = 1; * @return The name. */ @@ -134,6 +149,11 @@ public final class LedgerProto { } } /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string name = 1; * @return The bytes for name. */ @@ -456,6 +476,11 @@ public final class LedgerProto { private java.lang.Object name_ = ""; /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string name = 1; * @return The name. */ @@ -472,6 +497,11 @@ public final class LedgerProto { } } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string name = 1; * @return The bytes for name. */ @@ -489,6 +519,11 @@ public final class LedgerProto { } } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string name = 1; * @param value The name to set. * @return This builder for chaining. @@ -504,6 +539,11 @@ public final class LedgerProto { return this; } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string name = 1; * @return This builder for chaining. */ @@ -514,6 +554,11 @@ public final class LedgerProto { return this; } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string name = 1; * @param value The bytes for name to set. * @return This builder for chaining. @@ -587,6 +632,11 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * Boolean value indicating if the ledger is successfully created
+     * 是否创建成功
+     * 
+ * * bool ok = 1; * @return The ok. */ @@ -677,6 +727,11 @@ public final class LedgerProto { public static final int OK_FIELD_NUMBER = 1; private boolean ok_; /** + *
+     * Boolean value indicating if the ledger is successfully created
+     * 是否创建成功
+     * 
+ * * bool ok = 1; * @return The ok. */ @@ -990,6 +1045,11 @@ public final class LedgerProto { private boolean ok_ ; /** + *
+       * Boolean value indicating if the ledger is successfully created
+       * 是否创建成功
+       * 
+ * * bool ok = 1; * @return The ok. */ @@ -998,6 +1058,11 @@ public final class LedgerProto { return ok_; } /** + *
+       * Boolean value indicating if the ledger is successfully created
+       * 是否创建成功
+       * 
+ * * bool ok = 1; * @param value The ok to set. * @return This builder for chaining. @@ -1009,6 +1074,11 @@ public final class LedgerProto { return this; } /** + *
+       * Boolean value indicating if the ledger is successfully created
+       * 是否创建成功
+       * 
+ * * bool ok = 1; * @return This builder for chaining. */ @@ -1076,23 +1146,43 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @return A list containing the ledgers. */ java.util.List getLedgersList(); /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @return The count of ledgers. */ int getLedgersCount(); /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @param index The index of the element to return. * @return The ledgers at the given index. */ java.lang.String getLedgers(int index); /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @param index The index of the value to return. * @return The bytes of the ledgers at the given index. @@ -1194,6 +1284,11 @@ public final class LedgerProto { public static final int LEDGERS_FIELD_NUMBER = 1; private com.google.protobuf.LazyStringList ledgers_; /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @return A list containing the ledgers. */ @@ -1202,6 +1297,11 @@ public final class LedgerProto { return ledgers_; } /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @return The count of ledgers. */ @@ -1209,6 +1309,11 @@ public final class LedgerProto { return ledgers_.size(); } /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @param index The index of the element to return. * @return The ledgers at the given index. @@ -1217,6 +1322,11 @@ public final class LedgerProto { return ledgers_.get(index); } /** + *
+     * List of ledger names
+     * 帐本名称列表
+     * 
+ * * repeated string ledgers = 1; * @param index The index of the value to return. * @return The bytes of the ledgers at the given index. @@ -1555,6 +1665,11 @@ public final class LedgerProto { } } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @return A list containing the ledgers. */ @@ -1563,6 +1678,11 @@ public final class LedgerProto { return ledgers_.getUnmodifiableView(); } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @return The count of ledgers. */ @@ -1570,6 +1690,11 @@ public final class LedgerProto { return ledgers_.size(); } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param index The index of the element to return. * @return The ledgers at the given index. @@ -1578,6 +1703,11 @@ public final class LedgerProto { return ledgers_.get(index); } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param index The index of the value to return. * @return The bytes of the ledgers at the given index. @@ -1587,6 +1717,11 @@ public final class LedgerProto { return ledgers_.getByteString(index); } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param index The index to set the value at. * @param value The ledgers to set. @@ -1603,6 +1738,11 @@ public final class LedgerProto { return this; } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param value The ledgers to add. * @return This builder for chaining. @@ -1618,6 +1758,11 @@ public final class LedgerProto { return this; } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param values The ledgers to add. * @return This builder for chaining. @@ -1631,6 +1776,11 @@ public final class LedgerProto { return this; } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @return This builder for chaining. */ @@ -1641,6 +1791,11 @@ public final class LedgerProto { return this; } /** + *
+       * List of ledger names
+       * 帐本名称列表
+       * 
+ * * repeated string ledgers = 1; * @param value The bytes of the ledgers to add. * @return This builder for chaining. @@ -1714,11 +1869,21 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -1726,16 +1891,31 @@ public final class LedgerProto { getLedgerBytes(); /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return Whether the transaction field is set. */ boolean hasTransaction(); /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return The transaction. */ org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction getTransaction(); /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.TransactionOrBuilder getTransactionOrBuilder(); @@ -1842,35 +2022,59 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+       * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+       * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The enum numeric value on the wire for type. */ int getTypeValue(); /** + *
+       * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+       * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The type. */ org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionType getType(); /** + *
+       * 任意20字节的地址,用于区分使用同一节点的事务发起者
+       * 
+ * * bytes from = 2; * @return The from. */ com.google.protobuf.ByteString getFrom(); /** + *
+       * 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1)
+       * 
+ * * uint64 nonce = 3; * @return The nonce. */ long getNonce(); /** + *
+       * 对于通用数据记录不需传递,无意义
+       * 
+ * * bytes to = 4; * @return The to. */ com.google.protobuf.ByteString getTo(); /** + *
+       * 事务数据内容,字节数组
+       * 
+ * * bytes data = 5; * @return The data. */ @@ -1986,6 +2190,10 @@ public final class LedgerProto { public static final int TYPE_FIELD_NUMBER = 1; private int type_; /** + *
+       * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+       * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The enum numeric value on the wire for type. */ @@ -1993,6 +2201,10 @@ public final class LedgerProto { return type_; } /** + *
+       * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+       * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The type. */ @@ -2005,6 +2217,10 @@ public final class LedgerProto { public static final int FROM_FIELD_NUMBER = 2; private com.google.protobuf.ByteString from_; /** + *
+       * 任意20字节的地址,用于区分使用同一节点的事务发起者
+       * 
+ * * bytes from = 2; * @return The from. */ @@ -2016,6 +2232,10 @@ public final class LedgerProto { public static final int NONCE_FIELD_NUMBER = 3; private long nonce_; /** + *
+       * 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1)
+       * 
+ * * uint64 nonce = 3; * @return The nonce. */ @@ -2027,6 +2247,10 @@ public final class LedgerProto { public static final int TO_FIELD_NUMBER = 4; private com.google.protobuf.ByteString to_; /** + *
+       * 对于通用数据记录不需传递,无意义
+       * 
+ * * bytes to = 4; * @return The to. */ @@ -2038,6 +2262,10 @@ public final class LedgerProto { public static final int DATA_FIELD_NUMBER = 5; private com.google.protobuf.ByteString data_; /** + *
+       * 事务数据内容,字节数组
+       * 
+ * * bytes data = 5; * @return The data. */ @@ -2418,6 +2646,10 @@ public final class LedgerProto { private int type_ = 0; /** + *
+         * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+         * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The enum numeric value on the wire for type. */ @@ -2425,6 +2657,10 @@ public final class LedgerProto { return type_; } /** + *
+         * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+         * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @param value The enum numeric value on the wire for type to set. * @return This builder for chaining. @@ -2436,6 +2672,10 @@ public final class LedgerProto { return this; } /** + *
+         * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+         * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return The type. */ @@ -2446,6 +2686,10 @@ public final class LedgerProto { return result == null ? org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionType.UNRECOGNIZED : result; } /** + *
+         * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+         * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @param value The type to set. * @return This builder for chaining. @@ -2460,6 +2704,10 @@ public final class LedgerProto { return this; } /** + *
+         * 事务类型,目前仅支持通用数据记录,即type为RECORD (0)
+         * 
+ * * .bdware.bdledger.api.TransactionType type = 1; * @return This builder for chaining. */ @@ -2472,6 +2720,10 @@ public final class LedgerProto { private com.google.protobuf.ByteString from_ = com.google.protobuf.ByteString.EMPTY; /** + *
+         * 任意20字节的地址,用于区分使用同一节点的事务发起者
+         * 
+ * * bytes from = 2; * @return The from. */ @@ -2480,6 +2732,10 @@ public final class LedgerProto { return from_; } /** + *
+         * 任意20字节的地址,用于区分使用同一节点的事务发起者
+         * 
+ * * bytes from = 2; * @param value The from to set. * @return This builder for chaining. @@ -2494,6 +2750,10 @@ public final class LedgerProto { return this; } /** + *
+         * 任意20字节的地址,用于区分使用同一节点的事务发起者
+         * 
+ * * bytes from = 2; * @return This builder for chaining. */ @@ -2506,6 +2766,10 @@ public final class LedgerProto { private long nonce_ ; /** + *
+         * 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1)
+         * 
+ * * uint64 nonce = 3; * @return The nonce. */ @@ -2514,6 +2778,10 @@ public final class LedgerProto { return nonce_; } /** + *
+         * 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1)
+         * 
+ * * uint64 nonce = 3; * @param value The nonce to set. * @return This builder for chaining. @@ -2525,6 +2793,10 @@ public final class LedgerProto { return this; } /** + *
+         * 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1)
+         * 
+ * * uint64 nonce = 3; * @return This builder for chaining. */ @@ -2537,6 +2809,10 @@ public final class LedgerProto { private com.google.protobuf.ByteString to_ = com.google.protobuf.ByteString.EMPTY; /** + *
+         * 对于通用数据记录不需传递,无意义
+         * 
+ * * bytes to = 4; * @return The to. */ @@ -2545,6 +2821,10 @@ public final class LedgerProto { return to_; } /** + *
+         * 对于通用数据记录不需传递,无意义
+         * 
+ * * bytes to = 4; * @param value The to to set. * @return This builder for chaining. @@ -2559,6 +2839,10 @@ public final class LedgerProto { return this; } /** + *
+         * 对于通用数据记录不需传递,无意义
+         * 
+ * * bytes to = 4; * @return This builder for chaining. */ @@ -2571,6 +2855,10 @@ public final class LedgerProto { private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; /** + *
+         * 事务数据内容,字节数组
+         * 
+ * * bytes data = 5; * @return The data. */ @@ -2579,6 +2867,10 @@ public final class LedgerProto { return data_; } /** + *
+         * 事务数据内容,字节数组
+         * 
+ * * bytes data = 5; * @param value The data to set. * @return This builder for chaining. @@ -2593,6 +2885,10 @@ public final class LedgerProto { return this; } /** + *
+         * 事务数据内容,字节数组
+         * 
+ * * bytes data = 5; * @return This builder for chaining. */ @@ -2658,6 +2954,11 @@ public final class LedgerProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -2675,6 +2976,11 @@ public final class LedgerProto { } } /** + *
+     * Ledger name
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -2696,6 +3002,11 @@ public final class LedgerProto { public static final int TRANSACTION_FIELD_NUMBER = 2; private org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction transaction_; /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return Whether the transaction field is set. */ @@ -2704,6 +3015,11 @@ public final class LedgerProto { return transaction_ != null; } /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return The transaction. */ @@ -2712,6 +3028,11 @@ public final class LedgerProto { return transaction_ == null ? org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction.getDefaultInstance() : transaction_; } /** + *
+     * Transaction info
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ @java.lang.Override @@ -3053,6 +3374,11 @@ public final class LedgerProto { private java.lang.Object ledger_ = ""; /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -3069,6 +3395,11 @@ public final class LedgerProto { } } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -3086,6 +3417,11 @@ public final class LedgerProto { } } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -3101,6 +3437,11 @@ public final class LedgerProto { return this; } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -3111,6 +3452,11 @@ public final class LedgerProto { return this; } /** + *
+       * Ledger name
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -3131,6 +3477,11 @@ public final class LedgerProto { private com.google.protobuf.SingleFieldBuilderV3< org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction, org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction.Builder, org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.TransactionOrBuilder> transactionBuilder_; /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return Whether the transaction field is set. */ @@ -3138,6 +3489,11 @@ public final class LedgerProto { return transactionBuilder_ != null || transaction_ != null; } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; * @return The transaction. */ @@ -3149,6 +3505,11 @@ public final class LedgerProto { } } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public Builder setTransaction(org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction value) { @@ -3165,6 +3526,11 @@ public final class LedgerProto { return this; } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public Builder setTransaction( @@ -3179,6 +3545,11 @@ public final class LedgerProto { return this; } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public Builder mergeTransaction(org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction value) { @@ -3197,6 +3568,11 @@ public final class LedgerProto { return this; } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public Builder clearTransaction() { @@ -3211,6 +3587,11 @@ public final class LedgerProto { return this; } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.Transaction.Builder getTransactionBuilder() { @@ -3219,6 +3600,11 @@ public final class LedgerProto { return getTransactionFieldBuilder().getBuilder(); } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ public org.bdware.bdledger.api.grpc.pb.LedgerProto.SendTransactionRequest.TransactionOrBuilder getTransactionOrBuilder() { @@ -3230,6 +3616,11 @@ public final class LedgerProto { } } /** + *
+       * Transaction info
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.SendTransactionRequest.Transaction transaction = 2; */ private com.google.protobuf.SingleFieldBuilderV3< @@ -3303,6 +3694,11 @@ public final class LedgerProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * Hash of the created transaction
+     * 事务哈希
+     * 
+ * * bytes hash = 1; * @return The hash. */ @@ -3394,6 +3790,11 @@ public final class LedgerProto { public static final int HASH_FIELD_NUMBER = 1; private com.google.protobuf.ByteString hash_; /** + *
+     * Hash of the created transaction
+     * 事务哈希
+     * 
+ * * bytes hash = 1; * @return The hash. */ @@ -3706,6 +4107,11 @@ public final class LedgerProto { private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; /** + *
+       * Hash of the created transaction
+       * 事务哈希
+       * 
+ * * bytes hash = 1; * @return The hash. */ @@ -3714,6 +4120,11 @@ public final class LedgerProto { return hash_; } /** + *
+       * Hash of the created transaction
+       * 事务哈希
+       * 
+ * * bytes hash = 1; * @param value The hash to set. * @return This builder for chaining. @@ -3728,6 +4139,11 @@ public final class LedgerProto { return this; } /** + *
+       * Hash of the created transaction
+       * 事务哈希
+       * 
+ * * bytes hash = 1; * @return This builder for chaining. */ diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeGrpc.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeGrpc.java index 8f2c729..de02f76 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeGrpc.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeGrpc.java @@ -1,25 +1,13 @@ package org.bdware.bdledger.api.grpc.pb; 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; /** */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.32.1)", + value = "by gRPC proto compiler (version 1.41.0)", comments = "Source: bdware/bdledger/api/node.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class NodeGrpc { private NodeGrpc() {} @@ -115,14 +103,14 @@ public final class NodeGrpc { */ public void clientVersion(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getClientVersionMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getClientVersionMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getClientVersionMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< com.google.protobuf.Empty, org.bdware.bdledger.api.grpc.pb.NodeProto.ClientVersionResponse>( @@ -154,7 +142,7 @@ public final class NodeGrpc { */ public void clientVersion(com.google.protobuf.Empty request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getClientVersionMethod(), getCallOptions()), request, responseObserver); } } @@ -181,7 +169,7 @@ public final class NodeGrpc { * */ public org.bdware.bdledger.api.grpc.pb.NodeProto.ClientVersionResponse clientVersion(com.google.protobuf.Empty request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getClientVersionMethod(), getCallOptions(), request); } } @@ -209,7 +197,7 @@ public final class NodeGrpc { */ public com.google.common.util.concurrent.ListenableFuture clientVersion( com.google.protobuf.Empty request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getClientVersionMethod(), getCallOptions()), request); } } diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeProto.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeProto.java index aa5610d..2995d05 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeProto.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/NodeProto.java @@ -20,6 +20,7 @@ public final class NodeProto { /** *
+     * Client version
      * 节点客户端版本
      * 
* @@ -29,6 +30,7 @@ public final class NodeProto { java.lang.String getVersion(); /** *
+     * Client version
      * 节点客户端版本
      * 
* @@ -126,6 +128,7 @@ public final class NodeProto { private volatile java.lang.Object version_; /** *
+     * Client version
      * 节点客户端版本
      * 
* @@ -147,6 +150,7 @@ public final class NodeProto { } /** *
+     * Client version
      * 节点客户端版本
      * 
* @@ -473,6 +477,7 @@ public final class NodeProto { private java.lang.Object version_ = ""; /** *
+       * Client version
        * 节点客户端版本
        * 
* @@ -493,6 +498,7 @@ public final class NodeProto { } /** *
+       * Client version
        * 节点客户端版本
        * 
* @@ -514,6 +520,7 @@ public final class NodeProto { } /** *
+       * Client version
        * 节点客户端版本
        * 
* @@ -533,6 +540,7 @@ public final class NodeProto { } /** *
+       * Client version
        * 节点客户端版本
        * 
* @@ -547,6 +555,7 @@ public final class NodeProto { } /** *
+       * Client version
        * 节点客户端版本
        * 
* diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryGrpc.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryGrpc.java index ae87201..9030a50 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryGrpc.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryGrpc.java @@ -1,25 +1,13 @@ package org.bdware.bdledger.api.grpc.pb; 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; /** */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.32.1)", + value = "by gRPC proto compiler (version 1.41.0)", comments = "Source: bdware/bdledger/api/query.proto") +@io.grpc.stub.annotations.GrpcGenerated public final class QueryGrpc { private QueryGrpc() {} @@ -332,7 +320,7 @@ public final class QueryGrpc { */ public void getBlockByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetBlockByHashMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlockByHashMethod(), responseObserver); } /** @@ -340,12 +328,20 @@ public final class QueryGrpc { ** * Get blocks in a timestamp range * 查询时间范围内的区块 - * start_timestamp is required + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to + * the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) + * (query.maxDuration is specified in go-bdledger's config file). + * If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), + * then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). + * If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public void getBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetBlocksMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlocksMethod(), responseObserver); } /** @@ -353,23 +349,29 @@ public final class QueryGrpc { ** * Count all blocks in a ledger, or blocks in a timestamp range * 查询帐本中的所有区块数量,或时间范围内的区块数量 + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. + * If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. + * If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public void countBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCountBlocksMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCountBlocksMethod(), responseObserver); } /** *
      **
      * Get recent 'count' blocks (Only support IncludeTransactions=NONE for now)
-     * 查询最新的n个区块
+     * 查询最新的 'count' 个区块
      * 
*/ public void getRecentBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetRecentBlocksMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRecentBlocksMethod(), responseObserver); } /** @@ -381,7 +383,7 @@ public final class QueryGrpc { */ public void getTransactionByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetTransactionByHashMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTransactionByHashMethod(), responseObserver); } /** @@ -393,7 +395,7 @@ public final class QueryGrpc { */ public void getTransactionByBlockHashAndIndex(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetTransactionByBlockHashAndIndexMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTransactionByBlockHashAndIndexMethod(), responseObserver); } /** @@ -401,11 +403,12 @@ public final class QueryGrpc { ** * Get transactions in a timestamp range * 查询时间范围内的事务 + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. * */ public void getTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getGetTransactionsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTransactionsMethod(), responseObserver); } /** @@ -413,68 +416,68 @@ public final class QueryGrpc { ** * Count all transactions in a ledger, or transactions in a timestamp range * 查询帐本中的所有事务数量,或时间范围内的事务数量 - * start_timestamp is required + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. * */ public void countTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnimplementedUnaryCall(getCountTransactionsMethod(), responseObserver); + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCountTransactionsMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getGetBlockByHashMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashResponse>( this, METHODID_GET_BLOCK_BY_HASH))) .addMethod( getGetBlocksMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlocksResponse>( this, METHODID_GET_BLOCKS))) .addMethod( getCountBlocksMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.CountBlocksResponse>( this, METHODID_COUNT_BLOCKS))) .addMethod( getGetRecentBlocksMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlocksResponse>( this, METHODID_GET_RECENT_BLOCKS))) .addMethod( getGetTransactionByHashMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashResponse>( this, METHODID_GET_TRANSACTION_BY_HASH))) .addMethod( getGetTransactionByBlockHashAndIndexMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexResponse>( this, METHODID_GET_TRANSACTION_BY_BLOCK_HASH_AND_INDEX))) .addMethod( getGetTransactionsMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionsResponse>( this, METHODID_GET_TRANSACTIONS))) .addMethod( getCountTransactionsMethod(), - asyncUnaryCall( + io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest, org.bdware.bdledger.api.grpc.pb.QueryProto.CountTransactionsResponse>( @@ -506,7 +509,7 @@ public final class QueryGrpc { */ public void getBlockByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetBlockByHashMethod(), getCallOptions()), request, responseObserver); } @@ -515,12 +518,20 @@ public final class QueryGrpc { ** * Get blocks in a timestamp range * 查询时间范围内的区块 - * start_timestamp is required + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to + * the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) + * (query.maxDuration is specified in go-bdledger's config file). + * If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), + * then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). + * If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public void getBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetBlocksMethod(), getCallOptions()), request, responseObserver); } @@ -529,11 +540,17 @@ public final class QueryGrpc { ** * Count all blocks in a ledger, or blocks in a timestamp range * 查询帐本中的所有区块数量,或时间范围内的区块数量 + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. + * If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. + * If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public void countBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCountBlocksMethod(), getCallOptions()), request, responseObserver); } @@ -541,12 +558,12 @@ public final class QueryGrpc { *
      **
      * Get recent 'count' blocks (Only support IncludeTransactions=NONE for now)
-     * 查询最新的n个区块
+     * 查询最新的 'count' 个区块
      * 
*/ public void getRecentBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetRecentBlocksMethod(), getCallOptions()), request, responseObserver); } @@ -559,7 +576,7 @@ public final class QueryGrpc { */ public void getTransactionByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetTransactionByHashMethod(), getCallOptions()), request, responseObserver); } @@ -572,7 +589,7 @@ public final class QueryGrpc { */ public void getTransactionByBlockHashAndIndex(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetTransactionByBlockHashAndIndexMethod(), getCallOptions()), request, responseObserver); } @@ -581,11 +598,12 @@ public final class QueryGrpc { ** * Get transactions in a timestamp range * 查询时间范围内的事务 + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. * */ public void getTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetTransactionsMethod(), getCallOptions()), request, responseObserver); } @@ -594,12 +612,12 @@ public final class QueryGrpc { ** * Count all transactions in a ledger, or transactions in a timestamp range * 查询帐本中的所有事务数量,或时间范围内的事务数量 - * start_timestamp is required + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. * */ public void countTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request, io.grpc.stub.StreamObserver responseObserver) { - asyncUnaryCall( + io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getCountTransactionsMethod(), getCallOptions()), request, responseObserver); } } @@ -626,7 +644,7 @@ public final class QueryGrpc { * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashResponse getBlockByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetBlockByHashMethod(), getCallOptions(), request); } @@ -635,11 +653,19 @@ public final class QueryGrpc { ** * Get blocks in a timestamp range * 查询时间范围内的区块 - * start_timestamp is required + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to + * the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) + * (query.maxDuration is specified in go-bdledger's config file). + * If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), + * then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). + * If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlocksResponse getBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetBlocksMethod(), getCallOptions(), request); } @@ -648,10 +674,16 @@ public final class QueryGrpc { ** * Count all blocks in a ledger, or blocks in a timestamp range * 查询帐本中的所有区块数量,或时间范围内的区块数量 + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. + * If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. + * If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.CountBlocksResponse countBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCountBlocksMethod(), getCallOptions(), request); } @@ -659,11 +691,11 @@ public final class QueryGrpc { *
      **
      * Get recent 'count' blocks (Only support IncludeTransactions=NONE for now)
-     * 查询最新的n个区块
+     * 查询最新的 'count' 个区块
      * 
*/ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlocksResponse getRecentBlocks(org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetRecentBlocksMethod(), getCallOptions(), request); } @@ -675,7 +707,7 @@ public final class QueryGrpc { * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashResponse getTransactionByHash(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetTransactionByHashMethod(), getCallOptions(), request); } @@ -687,7 +719,7 @@ public final class QueryGrpc { * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexResponse getTransactionByBlockHashAndIndex(org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetTransactionByBlockHashAndIndexMethod(), getCallOptions(), request); } @@ -696,10 +728,11 @@ public final class QueryGrpc { ** * Get transactions in a timestamp range * 查询时间范围内的事务 + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionsResponse getTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetTransactionsMethod(), getCallOptions(), request); } @@ -708,11 +741,11 @@ public final class QueryGrpc { ** * Count all transactions in a ledger, or transactions in a timestamp range * 查询帐本中的所有事务数量,或时间范围内的事务数量 - * start_timestamp is required + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. * */ public org.bdware.bdledger.api.grpc.pb.QueryProto.CountTransactionsResponse countTransactions(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request) { - return blockingUnaryCall( + return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getCountTransactionsMethod(), getCallOptions(), request); } } @@ -740,7 +773,7 @@ public final class QueryGrpc { */ public com.google.common.util.concurrent.ListenableFuture getBlockByHash( org.bdware.bdledger.api.grpc.pb.QueryProto.GetBlockByHashRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetBlockByHashMethod(), getCallOptions()), request); } @@ -749,12 +782,20 @@ public final class QueryGrpc { ** * Get blocks in a timestamp range * 查询时间范围内的区块 - * start_timestamp is required + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to + * the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) + * (query.maxDuration is specified in go-bdledger's config file). + * If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), + * then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). + * If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public com.google.common.util.concurrent.ListenableFuture getBlocks( org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetBlocksMethod(), getCallOptions()), request); } @@ -763,11 +804,17 @@ public final class QueryGrpc { ** * Count all blocks in a ledger, or blocks in a timestamp range * 查询帐本中的所有区块数量,或时间范围内的区块数量 + * Requirement: start_timestamp <= end_timestamp + * If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. + * If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. + * If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. + * In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, + * and 'end_timestamp' will never be later than the current timestamp when the node process the query request. * */ public com.google.common.util.concurrent.ListenableFuture countBlocks( org.bdware.bdledger.api.grpc.pb.QueryProto.BlocksRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCountBlocksMethod(), getCallOptions()), request); } @@ -775,12 +822,12 @@ public final class QueryGrpc { *
      **
      * Get recent 'count' blocks (Only support IncludeTransactions=NONE for now)
-     * 查询最新的n个区块
+     * 查询最新的 'count' 个区块
      * 
*/ public com.google.common.util.concurrent.ListenableFuture getRecentBlocks( org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetRecentBlocksMethod(), getCallOptions()), request); } @@ -793,7 +840,7 @@ public final class QueryGrpc { */ public com.google.common.util.concurrent.ListenableFuture getTransactionByHash( org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByHashRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetTransactionByHashMethod(), getCallOptions()), request); } @@ -806,7 +853,7 @@ public final class QueryGrpc { */ public com.google.common.util.concurrent.ListenableFuture getTransactionByBlockHashAndIndex( org.bdware.bdledger.api.grpc.pb.QueryProto.GetTransactionByBlockHashAndIndexRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetTransactionByBlockHashAndIndexMethod(), getCallOptions()), request); } @@ -815,11 +862,12 @@ public final class QueryGrpc { ** * Get transactions in a timestamp range * 查询时间范围内的事务 + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. * */ public com.google.common.util.concurrent.ListenableFuture getTransactions( org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetTransactionsMethod(), getCallOptions()), request); } @@ -828,12 +876,12 @@ public final class QueryGrpc { ** * Count all transactions in a ledger, or transactions in a timestamp range * 查询帐本中的所有事务数量,或时间范围内的事务数量 - * start_timestamp is required + * 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. * */ public com.google.common.util.concurrent.ListenableFuture countTransactions( org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionsRequest request) { - return futureUnaryCall( + return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getCountTransactionsMethod(), getCallOptions()), request); } } diff --git a/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryProto.java b/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryProto.java index 737aa21..83351fc 100644 --- a/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryProto.java +++ b/src/main/java/org/bdware/bdledger/api/grpc/pb/QueryProto.java @@ -15,13 +15,18 @@ public final class QueryProto { (com.google.protobuf.ExtensionRegistryLite) registry); } /** + *
+   **
+   * 包含事务信息详细程度
+   * 
+ * * Protobuf enum {@code bdware.bdledger.api.IncludeTransactions} */ public enum IncludeTransactions implements com.google.protobuf.ProtocolMessageEnum { /** *
-     * 不包含交易数据
+     * 不包含事务数据
      * 
* * NONE = 0; @@ -29,7 +34,7 @@ public final class QueryProto { NONE(0), /** *
-     * 包含交易哈希列表
+     * 包含事务哈希列表
      * 
* * HASH = 1; @@ -37,7 +42,7 @@ public final class QueryProto { HASH(1), /** *
-     * 包含完整交易列表
+     * 包含完整事务列表
      * 
* * FULL = 2; @@ -48,7 +53,7 @@ public final class QueryProto { /** *
-     * 不包含交易数据
+     * 不包含事务数据
      * 
* * NONE = 0; @@ -56,7 +61,7 @@ public final class QueryProto { public static final int NONE_VALUE = 0; /** *
-     * 包含交易哈希列表
+     * 包含事务哈希列表
      * 
* * HASH = 1; @@ -64,7 +69,7 @@ public final class QueryProto { public static final int HASH_VALUE = 1; /** *
-     * 包含完整交易列表
+     * 包含完整事务列表
      * 
* * FULL = 2; @@ -172,6 +177,11 @@ public final class QueryProto { long getTimestamp(); } /** + *
+   **
+   * 暂不支持
+   * 
+ * * Protobuf type {@code bdware.bdledger.api.BlockFilter} */ public static final class BlockFilter extends @@ -449,6 +459,11 @@ public final class QueryProto { return builder; } /** + *
+     **
+     * 暂不支持
+     * 
+ * * Protobuf type {@code bdware.bdledger.api.BlockFilter} */ public static final class Builder extends @@ -1445,11 +1460,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -1457,12 +1480,20 @@ public final class QueryProto { getLedgerBytes(); /** + *
+     * 区块哈希
+     * 
+ * * bytes hash = 2; * @return The hash. */ com.google.protobuf.ByteString getHash(); /** + *
+     * 是否返回完整事务列表,而不是事务哈希列表
+     * 
+ * * bool full_transactions = 3; * @return The fullTransactions. */ @@ -1566,6 +1597,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -1583,6 +1618,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -1604,6 +1643,10 @@ public final class QueryProto { public static final int HASH_FIELD_NUMBER = 2; private com.google.protobuf.ByteString hash_; /** + *
+     * 区块哈希
+     * 
+ * * bytes hash = 2; * @return The hash. */ @@ -1615,6 +1658,10 @@ public final class QueryProto { public static final int FULL_TRANSACTIONS_FIELD_NUMBER = 3; private boolean fullTransactions_; /** + *
+     * 是否返回完整事务列表,而不是事务哈希列表
+     * 
+ * * bool full_transactions = 3; * @return The fullTransactions. */ @@ -1962,6 +2009,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -1978,6 +2029,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -1995,6 +2050,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -2010,6 +2069,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -2020,6 +2083,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -2038,6 +2105,10 @@ public final class QueryProto { private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; /** + *
+       * 区块哈希
+       * 
+ * * bytes hash = 2; * @return The hash. */ @@ -2046,6 +2117,10 @@ public final class QueryProto { return hash_; } /** + *
+       * 区块哈希
+       * 
+ * * bytes hash = 2; * @param value The hash to set. * @return This builder for chaining. @@ -2060,6 +2135,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块哈希
+       * 
+ * * bytes hash = 2; * @return This builder for chaining. */ @@ -2072,6 +2151,10 @@ public final class QueryProto { private boolean fullTransactions_ ; /** + *
+       * 是否返回完整事务列表,而不是事务哈希列表
+       * 
+ * * bool full_transactions = 3; * @return The fullTransactions. */ @@ -2080,6 +2163,10 @@ public final class QueryProto { return fullTransactions_; } /** + *
+       * 是否返回完整事务列表,而不是事务哈希列表
+       * 
+ * * bool full_transactions = 3; * @param value The fullTransactions to set. * @return This builder for chaining. @@ -2091,6 +2178,10 @@ public final class QueryProto { return this; } /** + *
+       * 是否返回完整事务列表,而不是事务哈希列表
+       * 
+ * * bool full_transactions = 3; * @return This builder for chaining. */ @@ -2158,16 +2249,28 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; * @return Whether the block field is set. */ boolean hasBlock(); /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; * @return The block. */ org.bdware.bdledger.api.grpc.pb.CommonProto.Block getBlock(); /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder getBlockOrBuilder(); @@ -2265,6 +2368,10 @@ public final class QueryProto { public static final int BLOCK_FIELD_NUMBER = 1; private org.bdware.bdledger.api.grpc.pb.CommonProto.Block block_; /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; * @return Whether the block field is set. */ @@ -2273,6 +2380,10 @@ public final class QueryProto { return block_ != null; } /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; * @return The block. */ @@ -2281,6 +2392,10 @@ public final class QueryProto { return block_ == null ? org.bdware.bdledger.api.grpc.pb.CommonProto.Block.getDefaultInstance() : block_; } /** + *
+     * 区块信息
+     * 
+ * * .bdware.bdledger.api.Block block = 1; */ @java.lang.Override @@ -2607,6 +2722,10 @@ public final class QueryProto { private com.google.protobuf.SingleFieldBuilderV3< org.bdware.bdledger.api.grpc.pb.CommonProto.Block, org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder, org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder> blockBuilder_; /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; * @return Whether the block field is set. */ @@ -2614,6 +2733,10 @@ public final class QueryProto { return blockBuilder_ != null || block_ != null; } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; * @return The block. */ @@ -2625,6 +2748,10 @@ public final class QueryProto { } } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public Builder setBlock(org.bdware.bdledger.api.grpc.pb.CommonProto.Block value) { @@ -2641,6 +2768,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public Builder setBlock( @@ -2655,6 +2786,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public Builder mergeBlock(org.bdware.bdledger.api.grpc.pb.CommonProto.Block value) { @@ -2673,6 +2808,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public Builder clearBlock() { @@ -2687,6 +2826,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder getBlockBuilder() { @@ -2695,6 +2838,10 @@ public final class QueryProto { return getBlockFieldBuilder().getBuilder(); } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder getBlockOrBuilder() { @@ -2706,6 +2853,10 @@ public final class QueryProto { } } /** + *
+       * 区块信息
+       * 
+ * * .bdware.bdledger.api.Block block = 1; */ private com.google.protobuf.SingleFieldBuilderV3< @@ -2779,11 +2930,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -2791,47 +2950,83 @@ public final class QueryProto { getLedgerBytes(); /** + *
+     * 查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ long getStartTimestamp(); /** + *
+     * 查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ long getEndTimestamp(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ java.util.List getFiltersList(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter getFilters(int index); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ int getFiltersCount(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ java.util.List getFiltersOrBuilderList(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilterOrBuilder getFiltersOrBuilder( int index); /** + *
+     * 包含事务信息详细程度
+     * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The enum numeric value on the wire for includeTransactions. */ int getIncludeTransactionsValue(); /** + *
+     * 包含事务信息详细程度
+     * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The includeTransactions. */ @@ -2955,6 +3150,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -2972,6 +3171,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -2993,6 +3196,10 @@ public final class QueryProto { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** + *
+     * 查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -3004,6 +3211,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -3015,6 +3226,10 @@ public final class QueryProto { public static final int FILTERS_FIELD_NUMBER = 4; private java.util.List filters_; /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ @java.lang.Override @@ -3022,6 +3237,10 @@ public final class QueryProto { return filters_; } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ @java.lang.Override @@ -3030,6 +3249,10 @@ public final class QueryProto { return filters_; } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ @java.lang.Override @@ -3037,6 +3260,10 @@ public final class QueryProto { return filters_.size(); } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ @java.lang.Override @@ -3044,6 +3271,10 @@ public final class QueryProto { return filters_.get(index); } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ @java.lang.Override @@ -3055,6 +3286,10 @@ public final class QueryProto { public static final int INCLUDE_TRANSACTIONS_FIELD_NUMBER = 5; private int includeTransactions_; /** + *
+     * 包含事务信息详细程度
+     * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The enum numeric value on the wire for includeTransactions. */ @@ -3062,6 +3297,10 @@ public final class QueryProto { return includeTransactions_; } /** + *
+     * 包含事务信息详细程度
+     * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The includeTransactions. */ @@ -3484,6 +3723,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -3500,6 +3743,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -3517,6 +3764,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -3532,6 +3783,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -3542,6 +3797,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -3560,6 +3819,10 @@ public final class QueryProto { private long startTimestamp_ ; /** + *
+       * 查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -3568,6 +3831,10 @@ public final class QueryProto { return startTimestamp_; } /** + *
+       * 查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @param value The startTimestamp to set. * @return This builder for chaining. @@ -3579,6 +3846,10 @@ public final class QueryProto { return this; } /** + *
+       * 查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return This builder for chaining. */ @@ -3591,6 +3862,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -3599,6 +3874,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -3610,6 +3889,10 @@ public final class QueryProto { return this; } /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -3633,6 +3916,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter, org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.Builder, org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilterOrBuilder> filtersBuilder_; /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public java.util.List getFiltersList() { @@ -3643,6 +3930,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public int getFiltersCount() { @@ -3653,6 +3944,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter getFilters(int index) { @@ -3663,6 +3958,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder setFilters( @@ -3680,6 +3979,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder setFilters( @@ -3694,6 +3997,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder addFilters(org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter value) { @@ -3710,6 +4017,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder addFilters( @@ -3727,6 +4038,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder addFilters( @@ -3741,6 +4056,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder addFilters( @@ -3755,6 +4074,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder addAllFilters( @@ -3770,6 +4093,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder clearFilters() { @@ -3783,6 +4110,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public Builder removeFilters(int index) { @@ -3796,6 +4127,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.Builder getFiltersBuilder( @@ -3803,6 +4138,10 @@ public final class QueryProto { return getFiltersFieldBuilder().getBuilder(index); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilterOrBuilder getFiltersOrBuilder( @@ -3813,6 +4152,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public java.util.List @@ -3824,6 +4167,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.Builder addFiltersBuilder() { @@ -3831,6 +4178,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.getDefaultInstance()); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.Builder addFiltersBuilder( @@ -3839,6 +4190,10 @@ public final class QueryProto { index, org.bdware.bdledger.api.grpc.pb.QueryProto.BlockFilter.getDefaultInstance()); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.BlockFilter filters = 4; */ public java.util.List @@ -3862,6 +4217,10 @@ public final class QueryProto { private int includeTransactions_ = 0; /** + *
+       * 包含事务信息详细程度
+       * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The enum numeric value on the wire for includeTransactions. */ @@ -3869,6 +4228,10 @@ public final class QueryProto { return includeTransactions_; } /** + *
+       * 包含事务信息详细程度
+       * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @param value The enum numeric value on the wire for includeTransactions to set. * @return This builder for chaining. @@ -3880,6 +4243,10 @@ public final class QueryProto { return this; } /** + *
+       * 包含事务信息详细程度
+       * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return The includeTransactions. */ @@ -3890,6 +4257,10 @@ public final class QueryProto { return result == null ? org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions.UNRECOGNIZED : result; } /** + *
+       * 包含事务信息详细程度
+       * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @param value The includeTransactions to set. * @return This builder for chaining. @@ -3904,6 +4275,10 @@ public final class QueryProto { return this; } /** + *
+       * 包含事务信息详细程度
+       * 
+ * * .bdware.bdledger.api.IncludeTransactions include_transactions = 5; * @return This builder for chaining. */ @@ -3971,36 +4346,64 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ java.util.List getBlocksList(); /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.Block getBlocks(int index); /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ int getBlocksCount(); /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ java.util.List getBlocksOrBuilderList(); /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder getBlocksOrBuilder( int index); /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ long getStartTimestamp(); /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -4110,6 +4513,10 @@ public final class QueryProto { public static final int BLOCKS_FIELD_NUMBER = 1; private java.util.List blocks_; /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ @java.lang.Override @@ -4117,6 +4524,10 @@ public final class QueryProto { return blocks_; } /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ @java.lang.Override @@ -4125,6 +4536,10 @@ public final class QueryProto { return blocks_; } /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ @java.lang.Override @@ -4132,6 +4547,10 @@ public final class QueryProto { return blocks_.size(); } /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ @java.lang.Override @@ -4139,6 +4558,10 @@ public final class QueryProto { return blocks_.get(index); } /** + *
+     * 区块列表
+     * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ @java.lang.Override @@ -4150,6 +4573,10 @@ public final class QueryProto { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -4161,6 +4588,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -4560,6 +4991,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.CommonProto.Block, org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder, org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder> blocksBuilder_; /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public java.util.List getBlocksList() { @@ -4570,6 +5005,10 @@ public final class QueryProto { } } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public int getBlocksCount() { @@ -4580,6 +5019,10 @@ public final class QueryProto { } } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Block getBlocks(int index) { @@ -4590,6 +5033,10 @@ public final class QueryProto { } } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder setBlocks( @@ -4607,6 +5054,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder setBlocks( @@ -4621,6 +5072,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder addBlocks(org.bdware.bdledger.api.grpc.pb.CommonProto.Block value) { @@ -4637,6 +5092,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder addBlocks( @@ -4654,6 +5113,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder addBlocks( @@ -4668,6 +5131,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder addBlocks( @@ -4682,6 +5149,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder addAllBlocks( @@ -4697,6 +5168,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder clearBlocks() { @@ -4710,6 +5185,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public Builder removeBlocks(int index) { @@ -4723,6 +5202,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder getBlocksBuilder( @@ -4730,6 +5213,10 @@ public final class QueryProto { return getBlocksFieldBuilder().getBuilder(index); } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.BlockOrBuilder getBlocksOrBuilder( @@ -4740,6 +5227,10 @@ public final class QueryProto { } } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public java.util.List @@ -4751,6 +5242,10 @@ public final class QueryProto { } } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder addBlocksBuilder() { @@ -4758,6 +5253,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.CommonProto.Block.getDefaultInstance()); } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Block.Builder addBlocksBuilder( @@ -4766,6 +5265,10 @@ public final class QueryProto { index, org.bdware.bdledger.api.grpc.pb.CommonProto.Block.getDefaultInstance()); } /** + *
+       * 区块列表
+       * 
+ * * repeated .bdware.bdledger.api.Block blocks = 1; */ public java.util.List @@ -4789,6 +5292,10 @@ public final class QueryProto { private long startTimestamp_ ; /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -4797,6 +5304,10 @@ public final class QueryProto { return startTimestamp_; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @param value The startTimestamp to set. * @return This builder for chaining. @@ -4808,6 +5319,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return This builder for chaining. */ @@ -4820,6 +5335,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -4828,6 +5347,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -4839,6 +5362,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -4906,18 +5433,30 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 区块数量
+     * 
+ * * uint64 count = 1; * @return The count. */ long getCount(); /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ long getStartTimestamp(); /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -5018,6 +5557,10 @@ public final class QueryProto { public static final int COUNT_FIELD_NUMBER = 1; private long count_; /** + *
+     * 区块数量
+     * 
+ * * uint64 count = 1; * @return The count. */ @@ -5029,6 +5572,10 @@ public final class QueryProto { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -5040,6 +5587,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -5389,6 +5940,10 @@ public final class QueryProto { private long count_ ; /** + *
+       * 区块数量
+       * 
+ * * uint64 count = 1; * @return The count. */ @@ -5397,6 +5952,10 @@ public final class QueryProto { return count_; } /** + *
+       * 区块数量
+       * 
+ * * uint64 count = 1; * @param value The count to set. * @return This builder for chaining. @@ -5408,6 +5967,10 @@ public final class QueryProto { return this; } /** + *
+       * 区块数量
+       * 
+ * * uint64 count = 1; * @return This builder for chaining. */ @@ -5420,6 +5983,10 @@ public final class QueryProto { private long startTimestamp_ ; /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -5428,6 +5995,10 @@ public final class QueryProto { return startTimestamp_; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @param value The startTimestamp to set. * @return This builder for chaining. @@ -5439,6 +6010,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return This builder for chaining. */ @@ -5451,6 +6026,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -5459,6 +6038,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -5470,6 +6053,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -5537,11 +6124,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -5549,18 +6144,40 @@ public final class QueryProto { getLedgerBytes(); /** - * int64 count = 2; + *
+     * 起始值
+     * 
+ * + * int64 offset = 2; + * @return The offset. + */ + long getOffset(); + + /** + *
+     * 查询区块数量
+     * 
+ * + * int64 count = 3; * @return The count. */ long getCount(); /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+     * 包含事务信息详细程度
+     * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The enum numeric value on the wire for includeTransactions. */ int getIncludeTransactionsValue(); /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+     * 包含事务信息详细程度
+     * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The includeTransactions. */ org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions getIncludeTransactions(); @@ -5620,10 +6237,15 @@ public final class QueryProto { } case 16: { - count_ = input.readInt64(); + offset_ = input.readInt64(); break; } case 24: { + + count_ = input.readInt64(); + break; + } + case 32: { int rawValue = input.readEnum(); includeTransactions_ = rawValue; @@ -5664,6 +6286,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -5681,6 +6307,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -5699,10 +6329,29 @@ public final class QueryProto { } } - public static final int COUNT_FIELD_NUMBER = 2; + public static final int OFFSET_FIELD_NUMBER = 2; + private long offset_; + /** + *
+     * 起始值
+     * 
+ * + * int64 offset = 2; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + + public static final int COUNT_FIELD_NUMBER = 3; private long count_; /** - * int64 count = 2; + *
+     * 查询区块数量
+     * 
+ * + * int64 count = 3; * @return The count. */ @java.lang.Override @@ -5710,17 +6359,25 @@ public final class QueryProto { return count_; } - public static final int INCLUDE_TRANSACTIONS_FIELD_NUMBER = 3; + public static final int INCLUDE_TRANSACTIONS_FIELD_NUMBER = 4; private int includeTransactions_; /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+     * 包含事务信息详细程度
+     * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The enum numeric value on the wire for includeTransactions. */ @java.lang.Override public int getIncludeTransactionsValue() { return includeTransactions_; } /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+     * 包含事务信息详细程度
+     * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The includeTransactions. */ @java.lang.Override public org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions getIncludeTransactions() { @@ -5746,11 +6403,14 @@ public final class QueryProto { if (!getLedgerBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, ledger_); } + if (offset_ != 0L) { + output.writeInt64(2, offset_); + } if (count_ != 0L) { - output.writeInt64(2, count_); + output.writeInt64(3, count_); } if (includeTransactions_ != org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions.NONE.getNumber()) { - output.writeEnum(3, includeTransactions_); + output.writeEnum(4, includeTransactions_); } unknownFields.writeTo(output); } @@ -5764,13 +6424,17 @@ public final class QueryProto { if (!getLedgerBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, ledger_); } + if (offset_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, offset_); + } if (count_ != 0L) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, count_); + .computeInt64Size(3, count_); } if (includeTransactions_ != org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions.NONE.getNumber()) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(3, includeTransactions_); + .computeEnumSize(4, includeTransactions_); } size += unknownFields.getSerializedSize(); memoizedSize = size; @@ -5789,6 +6453,8 @@ public final class QueryProto { if (!getLedger() .equals(other.getLedger())) return false; + if (getOffset() + != other.getOffset()) return false; if (getCount() != other.getCount()) return false; if (includeTransactions_ != other.includeTransactions_) return false; @@ -5805,6 +6471,9 @@ public final class QueryProto { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + LEDGER_FIELD_NUMBER; hash = (53 * hash) + getLedger().hashCode(); + hash = (37 * hash) + OFFSET_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getOffset()); hash = (37 * hash) + COUNT_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getCount()); @@ -5945,6 +6614,8 @@ public final class QueryProto { super.clear(); ledger_ = ""; + offset_ = 0L; + count_ = 0L; includeTransactions_ = 0; @@ -5976,6 +6647,7 @@ public final class QueryProto { public org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest buildPartial() { org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest result = new org.bdware.bdledger.api.grpc.pb.QueryProto.RecentBlocksRequest(this); result.ledger_ = ledger_; + result.offset_ = offset_; result.count_ = count_; result.includeTransactions_ = includeTransactions_; onBuilt(); @@ -6030,6 +6702,9 @@ public final class QueryProto { ledger_ = other.ledger_; onChanged(); } + if (other.getOffset() != 0L) { + setOffset(other.getOffset()); + } if (other.getCount() != 0L) { setCount(other.getCount()); } @@ -6067,6 +6742,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -6083,6 +6762,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -6100,6 +6783,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -6115,6 +6802,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -6125,6 +6816,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -6141,9 +6836,56 @@ public final class QueryProto { return this; } + private long offset_ ; + /** + *
+       * 起始值
+       * 
+ * + * int64 offset = 2; + * @return The offset. + */ + @java.lang.Override + public long getOffset() { + return offset_; + } + /** + *
+       * 起始值
+       * 
+ * + * int64 offset = 2; + * @param value The offset to set. + * @return This builder for chaining. + */ + public Builder setOffset(long value) { + + offset_ = value; + onChanged(); + return this; + } + /** + *
+       * 起始值
+       * 
+ * + * int64 offset = 2; + * @return This builder for chaining. + */ + public Builder clearOffset() { + + offset_ = 0L; + onChanged(); + return this; + } + private long count_ ; /** - * int64 count = 2; + *
+       * 查询区块数量
+       * 
+ * + * int64 count = 3; * @return The count. */ @java.lang.Override @@ -6151,7 +6893,11 @@ public final class QueryProto { return count_; } /** - * int64 count = 2; + *
+       * 查询区块数量
+       * 
+ * + * int64 count = 3; * @param value The count to set. * @return This builder for chaining. */ @@ -6162,7 +6908,11 @@ public final class QueryProto { return this; } /** - * int64 count = 2; + *
+       * 查询区块数量
+       * 
+ * + * int64 count = 3; * @return This builder for chaining. */ public Builder clearCount() { @@ -6174,14 +6924,22 @@ public final class QueryProto { private int includeTransactions_ = 0; /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+       * 包含事务信息详细程度
+       * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The enum numeric value on the wire for includeTransactions. */ @java.lang.Override public int getIncludeTransactionsValue() { return includeTransactions_; } /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+       * 包含事务信息详细程度
+       * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @param value The enum numeric value on the wire for includeTransactions to set. * @return This builder for chaining. */ @@ -6192,7 +6950,11 @@ public final class QueryProto { return this; } /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+       * 包含事务信息详细程度
+       * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return The includeTransactions. */ @java.lang.Override @@ -6202,7 +6964,11 @@ public final class QueryProto { return result == null ? org.bdware.bdledger.api.grpc.pb.QueryProto.IncludeTransactions.UNRECOGNIZED : result; } /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+       * 包含事务信息详细程度
+       * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @param value The includeTransactions to set. * @return This builder for chaining. */ @@ -6216,7 +6982,11 @@ public final class QueryProto { return this; } /** - * .bdware.bdledger.api.IncludeTransactions include_transactions = 3; + *
+       * 包含事务信息详细程度
+       * 
+ * + * .bdware.bdledger.api.IncludeTransactions include_transactions = 4; * @return This builder for chaining. */ public Builder clearIncludeTransactions() { @@ -6283,11 +7053,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -6295,6 +7073,10 @@ public final class QueryProto { getLedgerBytes(); /** + *
+     * 事务哈希
+     * 
+ * * bytes hash = 2; * @return The hash. */ @@ -6393,6 +7175,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -6410,6 +7196,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -6431,6 +7221,10 @@ public final class QueryProto { public static final int HASH_FIELD_NUMBER = 2; private com.google.protobuf.ByteString hash_; /** + *
+     * 事务哈希
+     * 
+ * * bytes hash = 2; * @return The hash. */ @@ -6760,6 +7554,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -6776,6 +7574,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -6793,6 +7595,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -6808,6 +7614,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -6818,6 +7628,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -6836,6 +7650,10 @@ public final class QueryProto { private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; /** + *
+       * 事务哈希
+       * 
+ * * bytes hash = 2; * @return The hash. */ @@ -6844,6 +7662,10 @@ public final class QueryProto { return hash_; } /** + *
+       * 事务哈希
+       * 
+ * * bytes hash = 2; * @param value The hash to set. * @return This builder for chaining. @@ -6858,6 +7680,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务哈希
+       * 
+ * * bytes hash = 2; * @return This builder for chaining. */ @@ -6925,16 +7751,28 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ boolean hasTransaction(); /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction getTransaction(); /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionOrBuilder(); @@ -7032,6 +7870,10 @@ public final class QueryProto { public static final int TRANSACTION_FIELD_NUMBER = 1; private org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction transaction_; /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ @@ -7040,6 +7882,10 @@ public final class QueryProto { return transaction_ != null; } /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ @@ -7048,6 +7894,10 @@ public final class QueryProto { return transaction_ == null ? org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.getDefaultInstance() : transaction_; } /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ @java.lang.Override @@ -7374,6 +8224,10 @@ public final class QueryProto { private com.google.protobuf.SingleFieldBuilderV3< org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction, org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder, org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder> transactionBuilder_; /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ @@ -7381,6 +8235,10 @@ public final class QueryProto { return transactionBuilder_ != null || transaction_ != null; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ @@ -7392,6 +8250,10 @@ public final class QueryProto { } } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder setTransaction(org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction value) { @@ -7408,6 +8270,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder setTransaction( @@ -7422,6 +8288,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder mergeTransaction(org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction value) { @@ -7440,6 +8310,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder clearTransaction() { @@ -7454,6 +8328,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder getTransactionBuilder() { @@ -7462,6 +8340,10 @@ public final class QueryProto { return getTransactionFieldBuilder().getBuilder(); } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionOrBuilder() { @@ -7473,6 +8355,10 @@ public final class QueryProto { } } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ private com.google.protobuf.SingleFieldBuilderV3< @@ -7546,11 +8432,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -7558,12 +8452,20 @@ public final class QueryProto { getLedgerBytes(); /** + *
+     * 事务所属区块哈希
+     * 
+ * * bytes block_hash = 2; * @return The blockHash. */ com.google.protobuf.ByteString getBlockHash(); /** + *
+     * 事务在区块中的位置
+     * 
+ * * uint32 index = 3; * @return The index. */ @@ -7667,6 +8569,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -7684,6 +8590,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -7705,6 +8615,10 @@ public final class QueryProto { public static final int BLOCK_HASH_FIELD_NUMBER = 2; private com.google.protobuf.ByteString blockHash_; /** + *
+     * 事务所属区块哈希
+     * 
+ * * bytes block_hash = 2; * @return The blockHash. */ @@ -7716,6 +8630,10 @@ public final class QueryProto { public static final int INDEX_FIELD_NUMBER = 3; private int index_; /** + *
+     * 事务在区块中的位置
+     * 
+ * * uint32 index = 3; * @return The index. */ @@ -8062,6 +8980,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -8078,6 +9000,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -8095,6 +9021,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -8110,6 +9040,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -8120,6 +9054,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -8138,6 +9076,10 @@ public final class QueryProto { private com.google.protobuf.ByteString blockHash_ = com.google.protobuf.ByteString.EMPTY; /** + *
+       * 事务所属区块哈希
+       * 
+ * * bytes block_hash = 2; * @return The blockHash. */ @@ -8146,6 +9088,10 @@ public final class QueryProto { return blockHash_; } /** + *
+       * 事务所属区块哈希
+       * 
+ * * bytes block_hash = 2; * @param value The blockHash to set. * @return This builder for chaining. @@ -8160,6 +9106,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务所属区块哈希
+       * 
+ * * bytes block_hash = 2; * @return This builder for chaining. */ @@ -8172,6 +9122,10 @@ public final class QueryProto { private int index_ ; /** + *
+       * 事务在区块中的位置
+       * 
+ * * uint32 index = 3; * @return The index. */ @@ -8180,6 +9134,10 @@ public final class QueryProto { return index_; } /** + *
+       * 事务在区块中的位置
+       * 
+ * * uint32 index = 3; * @param value The index to set. * @return This builder for chaining. @@ -8191,6 +9149,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务在区块中的位置
+       * 
+ * * uint32 index = 3; * @return This builder for chaining. */ @@ -8258,16 +9220,28 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ boolean hasTransaction(); /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction getTransaction(); /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionOrBuilder(); @@ -8365,6 +9339,10 @@ public final class QueryProto { public static final int TRANSACTION_FIELD_NUMBER = 1; private org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction transaction_; /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ @@ -8373,6 +9351,10 @@ public final class QueryProto { return transaction_ != null; } /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ @@ -8381,6 +9363,10 @@ public final class QueryProto { return transaction_ == null ? org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.getDefaultInstance() : transaction_; } /** + *
+     * 事务信息
+     * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ @java.lang.Override @@ -8707,6 +9693,10 @@ public final class QueryProto { private com.google.protobuf.SingleFieldBuilderV3< org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction, org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder, org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder> transactionBuilder_; /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return Whether the transaction field is set. */ @@ -8714,6 +9704,10 @@ public final class QueryProto { return transactionBuilder_ != null || transaction_ != null; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; * @return The transaction. */ @@ -8725,6 +9719,10 @@ public final class QueryProto { } } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder setTransaction(org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction value) { @@ -8741,6 +9739,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder setTransaction( @@ -8755,6 +9757,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder mergeTransaction(org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction value) { @@ -8773,6 +9779,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public Builder clearTransaction() { @@ -8787,6 +9797,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder getTransactionBuilder() { @@ -8795,6 +9809,10 @@ public final class QueryProto { return getTransactionFieldBuilder().getBuilder(); } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionOrBuilder() { @@ -8806,6 +9824,10 @@ public final class QueryProto { } } /** + *
+       * 事务信息
+       * 
+ * * .bdware.bdledger.api.Transaction transaction = 1; */ private com.google.protobuf.SingleFieldBuilderV3< @@ -8879,11 +9901,19 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ java.lang.String getLedger(); /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -8892,7 +9922,7 @@ public final class QueryProto { /** *
-     * required
+     * 查询范围开始时间戳
      * 
* * int64 start_timestamp = 2; @@ -8901,30 +9931,54 @@ public final class QueryProto { long getStartTimestamp(); /** + *
+     * 查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ long getEndTimestamp(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ java.util.List getFiltersList(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter getFilters(int index); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ int getFiltersCount(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ java.util.List getFiltersOrBuilderList(); /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilterOrBuilder getFiltersOrBuilder( @@ -9041,6 +10095,10 @@ public final class QueryProto { public static final int LEDGER_FIELD_NUMBER = 1; private volatile java.lang.Object ledger_; /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The ledger. */ @@ -9058,6 +10116,10 @@ public final class QueryProto { } } /** + *
+     * 账本名称
+     * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -9080,7 +10142,7 @@ public final class QueryProto { private long startTimestamp_; /** *
-     * required
+     * 查询范围开始时间戳
      * 
* * int64 start_timestamp = 2; @@ -9094,6 +10156,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -9105,6 +10171,10 @@ public final class QueryProto { public static final int FILTERS_FIELD_NUMBER = 4; private java.util.List filters_; /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ @java.lang.Override @@ -9112,6 +10182,10 @@ public final class QueryProto { return filters_; } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ @java.lang.Override @@ -9120,6 +10194,10 @@ public final class QueryProto { return filters_; } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ @java.lang.Override @@ -9127,6 +10205,10 @@ public final class QueryProto { return filters_.size(); } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ @java.lang.Override @@ -9134,6 +10216,10 @@ public final class QueryProto { return filters_.get(index); } /** + *
+     * 暂不支持
+     * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ @java.lang.Override @@ -9539,6 +10625,10 @@ public final class QueryProto { private java.lang.Object ledger_ = ""; /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The ledger. */ @@ -9555,6 +10645,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return The bytes for ledger. */ @@ -9572,6 +10666,10 @@ public final class QueryProto { } } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The ledger to set. * @return This builder for chaining. @@ -9587,6 +10685,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @return This builder for chaining. */ @@ -9597,6 +10699,10 @@ public final class QueryProto { return this; } /** + *
+       * 账本名称
+       * 
+ * * string ledger = 1; * @param value The bytes for ledger to set. * @return This builder for chaining. @@ -9616,7 +10722,7 @@ public final class QueryProto { private long startTimestamp_ ; /** *
-       * required
+       * 查询范围开始时间戳
        * 
* * int64 start_timestamp = 2; @@ -9628,7 +10734,7 @@ public final class QueryProto { } /** *
-       * required
+       * 查询范围开始时间戳
        * 
* * int64 start_timestamp = 2; @@ -9643,7 +10749,7 @@ public final class QueryProto { } /** *
-       * required
+       * 查询范围开始时间戳
        * 
* * int64 start_timestamp = 2; @@ -9658,6 +10764,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -9666,6 +10776,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -9677,6 +10791,10 @@ public final class QueryProto { return this; } /** + *
+       * 查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -9700,6 +10818,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter, org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.Builder, org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilterOrBuilder> filtersBuilder_; /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public java.util.List getFiltersList() { @@ -9710,6 +10832,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public int getFiltersCount() { @@ -9720,6 +10846,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter getFilters(int index) { @@ -9730,6 +10860,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder setFilters( @@ -9747,6 +10881,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder setFilters( @@ -9761,6 +10899,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder addFilters(org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter value) { @@ -9777,6 +10919,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder addFilters( @@ -9794,6 +10940,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder addFilters( @@ -9808,6 +10958,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder addFilters( @@ -9822,6 +10976,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder addAllFilters( @@ -9837,6 +10995,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder clearFilters() { @@ -9850,6 +11012,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public Builder removeFilters(int index) { @@ -9863,6 +11029,10 @@ public final class QueryProto { return this; } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.Builder getFiltersBuilder( @@ -9870,6 +11040,10 @@ public final class QueryProto { return getFiltersFieldBuilder().getBuilder(index); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilterOrBuilder getFiltersOrBuilder( @@ -9880,6 +11054,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public java.util.List @@ -9891,6 +11069,10 @@ public final class QueryProto { } } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.Builder addFiltersBuilder() { @@ -9898,6 +11080,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.getDefaultInstance()); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.Builder addFiltersBuilder( @@ -9906,6 +11092,10 @@ public final class QueryProto { index, org.bdware.bdledger.api.grpc.pb.QueryProto.TransactionFilter.getDefaultInstance()); } /** + *
+       * 暂不支持
+       * 
+ * * repeated .bdware.bdledger.api.TransactionFilter filters = 4; */ public java.util.List @@ -9984,36 +11174,64 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ java.util.List getTransactionsList(); /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction getTransactions(int index); /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ int getTransactionsCount(); /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ java.util.List getTransactionsOrBuilderList(); /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionsOrBuilder( int index); /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ long getStartTimestamp(); /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -10123,6 +11341,10 @@ public final class QueryProto { public static final int TRANSACTIONS_FIELD_NUMBER = 1; private java.util.List transactions_; /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ @java.lang.Override @@ -10130,6 +11352,10 @@ public final class QueryProto { return transactions_; } /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ @java.lang.Override @@ -10138,6 +11364,10 @@ public final class QueryProto { return transactions_; } /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ @java.lang.Override @@ -10145,6 +11375,10 @@ public final class QueryProto { return transactions_.size(); } /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ @java.lang.Override @@ -10152,6 +11386,10 @@ public final class QueryProto { return transactions_.get(index); } /** + *
+     * 事务列表
+     * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ @java.lang.Override @@ -10163,6 +11401,10 @@ public final class QueryProto { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -10174,6 +11416,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -10573,6 +11819,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction, org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder, org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder> transactionsBuilder_; /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public java.util.List getTransactionsList() { @@ -10583,6 +11833,10 @@ public final class QueryProto { } } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public int getTransactionsCount() { @@ -10593,6 +11847,10 @@ public final class QueryProto { } } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction getTransactions(int index) { @@ -10603,6 +11861,10 @@ public final class QueryProto { } } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder setTransactions( @@ -10620,6 +11882,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder setTransactions( @@ -10634,6 +11900,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder addTransactions(org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction value) { @@ -10650,6 +11920,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder addTransactions( @@ -10667,6 +11941,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder addTransactions( @@ -10681,6 +11959,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder addTransactions( @@ -10695,6 +11977,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder addAllTransactions( @@ -10710,6 +11996,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder clearTransactions() { @@ -10723,6 +12013,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public Builder removeTransactions(int index) { @@ -10736,6 +12030,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder getTransactionsBuilder( @@ -10743,6 +12041,10 @@ public final class QueryProto { return getTransactionsFieldBuilder().getBuilder(index); } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionOrBuilder getTransactionsOrBuilder( @@ -10753,6 +12055,10 @@ public final class QueryProto { } } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public java.util.List @@ -10764,6 +12070,10 @@ public final class QueryProto { } } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder addTransactionsBuilder() { @@ -10771,6 +12081,10 @@ public final class QueryProto { org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.getDefaultInstance()); } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.Builder addTransactionsBuilder( @@ -10779,6 +12093,10 @@ public final class QueryProto { index, org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction.getDefaultInstance()); } /** + *
+       * 事务列表
+       * 
+ * * repeated .bdware.bdledger.api.Transaction transactions = 1; */ public java.util.List @@ -10802,6 +12120,10 @@ public final class QueryProto { private long startTimestamp_ ; /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -10810,6 +12132,10 @@ public final class QueryProto { return startTimestamp_; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @param value The startTimestamp to set. * @return This builder for chaining. @@ -10821,6 +12147,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return This builder for chaining. */ @@ -10833,6 +12163,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -10841,6 +12175,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -10852,6 +12190,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -10919,18 +12261,30 @@ public final class QueryProto { com.google.protobuf.MessageOrBuilder { /** + *
+     * 事务数量
+     * 
+ * * uint64 count = 1; * @return The count. */ long getCount(); /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ long getStartTimestamp(); /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -11031,6 +12385,10 @@ public final class QueryProto { public static final int COUNT_FIELD_NUMBER = 1; private long count_; /** + *
+     * 事务数量
+     * 
+ * * uint64 count = 1; * @return The count. */ @@ -11042,6 +12400,10 @@ public final class QueryProto { public static final int START_TIMESTAMP_FIELD_NUMBER = 2; private long startTimestamp_; /** + *
+     * 本次查询有效的查询范围开始时间戳
+     * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -11053,6 +12415,10 @@ public final class QueryProto { public static final int END_TIMESTAMP_FIELD_NUMBER = 3; private long endTimestamp_; /** + *
+     * 本次查询有效的查询范围结束时间戳
+     * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -11402,6 +12768,10 @@ public final class QueryProto { private long count_ ; /** + *
+       * 事务数量
+       * 
+ * * uint64 count = 1; * @return The count. */ @@ -11410,6 +12780,10 @@ public final class QueryProto { return count_; } /** + *
+       * 事务数量
+       * 
+ * * uint64 count = 1; * @param value The count to set. * @return This builder for chaining. @@ -11421,6 +12795,10 @@ public final class QueryProto { return this; } /** + *
+       * 事务数量
+       * 
+ * * uint64 count = 1; * @return This builder for chaining. */ @@ -11433,6 +12811,10 @@ public final class QueryProto { private long startTimestamp_ ; /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return The startTimestamp. */ @@ -11441,6 +12823,10 @@ public final class QueryProto { return startTimestamp_; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @param value The startTimestamp to set. * @return This builder for chaining. @@ -11452,6 +12838,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围开始时间戳
+       * 
+ * * int64 start_timestamp = 2; * @return This builder for chaining. */ @@ -11464,6 +12854,10 @@ public final class QueryProto { private long endTimestamp_ ; /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return The endTimestamp. */ @@ -11472,6 +12866,10 @@ public final class QueryProto { return endTimestamp_; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @param value The endTimestamp to set. * @return This builder for chaining. @@ -11483,6 +12881,10 @@ public final class QueryProto { return this; } /** + *
+       * 本次查询有效的查询范围结束时间戳
+       * 
+ * * int64 end_timestamp = 3; * @return This builder for chaining. */ @@ -11648,54 +13050,55 @@ public final class QueryProto { "\017start_timestamp\030\002 \001(\003\022\025\n\rend_timestamp\030" + "\003 \001(\003\"T\n\023CountBlocksResponse\022\r\n\005count\030\001 " + "\001(\004\022\027\n\017start_timestamp\030\002 \001(\003\022\025\n\rend_time" + - "stamp\030\003 \001(\003\"|\n\023RecentBlocksRequest\022\016\n\006le" + - "dger\030\001 \001(\t\022\r\n\005count\030\002 \001(\003\022F\n\024include_tra" + - "nsactions\030\003 \001(\0162(.bdware.bdledger.api.In" + - "cludeTransactions\";\n\033GetTransactionByHas" + - "hRequest\022\016\n\006ledger\030\001 \001(\t\022\014\n\004hash\030\002 \001(\014\"U" + - "\n\034GetTransactionByHashResponse\0225\n\013transa" + - "ction\030\001 \001(\0132 .bdware.bdledger.api.Transa" + - "ction\"]\n(GetTransactionByBlockHashAndInd" + - "exRequest\022\016\n\006ledger\030\001 \001(\t\022\022\n\nblock_hash\030" + - "\002 \001(\014\022\r\n\005index\030\003 \001(\r\"b\n)GetTransactionBy" + - "BlockHashAndIndexResponse\0225\n\013transaction" + - "\030\001 \001(\0132 .bdware.bdledger.api.Transaction" + - "\"\216\001\n\023TransactionsRequest\022\016\n\006ledger\030\001 \001(\t" + - "\022\027\n\017start_timestamp\030\002 \001(\003\022\025\n\rend_timesta" + - "mp\030\003 \001(\003\0227\n\007filters\030\004 \003(\0132&.bdware.bdled" + - "ger.api.TransactionFilter\"\201\001\n\027GetTransac" + - "tionsResponse\0226\n\014transactions\030\001 \003(\0132 .bd" + - "ware.bdledger.api.Transaction\022\027\n\017start_t" + - "imestamp\030\002 \001(\003\022\025\n\rend_timestamp\030\003 \001(\003\"Z\n" + - "\031CountTransactionsResponse\022\r\n\005count\030\001 \001(" + - "\004\022\027\n\017start_timestamp\030\002 \001(\003\022\025\n\rend_timest" + - "amp\030\003 \001(\003*3\n\023IncludeTransactions\022\010\n\004NONE" + - "\020\000\022\010\n\004HASH\020\001\022\010\n\004FULL\020\0022\211\007\n\005Query\022i\n\016GetB" + - "lockByHash\022*.bdware.bdledger.api.GetBloc" + - "kByHashRequest\032+.bdware.bdledger.api.Get" + - "BlockByHashResponse\022W\n\tGetBlocks\022\".bdwar" + - "e.bdledger.api.BlocksRequest\032&.bdware.bd" + - "ledger.api.GetBlocksResponse\022[\n\013CountBlo" + - "cks\022\".bdware.bdledger.api.BlocksRequest\032" + - "(.bdware.bdledger.api.CountBlocksRespons" + - "e\022c\n\017GetRecentBlocks\022(.bdware.bdledger.a" + - "pi.RecentBlocksRequest\032&.bdware.bdledger" + - ".api.GetBlocksResponse\022{\n\024GetTransaction" + - "ByHash\0220.bdware.bdledger.api.GetTransact" + - "ionByHashRequest\0321.bdware.bdledger.api.G" + - "etTransactionByHashResponse\022\242\001\n!GetTrans" + - "actionByBlockHashAndIndex\022=.bdware.bdled" + + "stamp\030\003 \001(\003\"\214\001\n\023RecentBlocksRequest\022\016\n\006l" + + "edger\030\001 \001(\t\022\016\n\006offset\030\002 \001(\003\022\r\n\005count\030\003 \001" + + "(\003\022F\n\024include_transactions\030\004 \001(\0162(.bdwar" + + "e.bdledger.api.IncludeTransactions\";\n\033Ge" + + "tTransactionByHashRequest\022\016\n\006ledger\030\001 \001(" + + "\t\022\014\n\004hash\030\002 \001(\014\"U\n\034GetTransactionByHashR" + + "esponse\0225\n\013transaction\030\001 \001(\0132 .bdware.bd" + + "ledger.api.Transaction\"]\n(GetTransaction" + + "ByBlockHashAndIndexRequest\022\016\n\006ledger\030\001 \001" + + "(\t\022\022\n\nblock_hash\030\002 \001(\014\022\r\n\005index\030\003 \001(\r\"b\n" + + ")GetTransactionByBlockHashAndIndexRespon" + + "se\0225\n\013transaction\030\001 \001(\0132 .bdware.bdledge" + + "r.api.Transaction\"\216\001\n\023TransactionsReques" + + "t\022\016\n\006ledger\030\001 \001(\t\022\027\n\017start_timestamp\030\002 \001" + + "(\003\022\025\n\rend_timestamp\030\003 \001(\003\0227\n\007filters\030\004 \003" + + "(\0132&.bdware.bdledger.api.TransactionFilt" + + "er\"\201\001\n\027GetTransactionsResponse\0226\n\014transa" + + "ctions\030\001 \003(\0132 .bdware.bdledger.api.Trans" + + "action\022\027\n\017start_timestamp\030\002 \001(\003\022\025\n\rend_t" + + "imestamp\030\003 \001(\003\"Z\n\031CountTransactionsRespo" + + "nse\022\r\n\005count\030\001 \001(\004\022\027\n\017start_timestamp\030\002 " + + "\001(\003\022\025\n\rend_timestamp\030\003 \001(\003*3\n\023IncludeTra" + + "nsactions\022\010\n\004NONE\020\000\022\010\n\004HASH\020\001\022\010\n\004FULL\020\0022" + + "\211\007\n\005Query\022i\n\016GetBlockByHash\022*.bdware.bdl" + + "edger.api.GetBlockByHashRequest\032+.bdware" + + ".bdledger.api.GetBlockByHashResponse\022W\n\t" + + "GetBlocks\022\".bdware.bdledger.api.BlocksRe" + + "quest\032&.bdware.bdledger.api.GetBlocksRes" + + "ponse\022[\n\013CountBlocks\022\".bdware.bdledger.a" + + "pi.BlocksRequest\032(.bdware.bdledger.api.C" + + "ountBlocksResponse\022c\n\017GetRecentBlocks\022(." + + "bdware.bdledger.api.RecentBlocksRequest\032" + + "&.bdware.bdledger.api.GetBlocksResponse\022" + + "{\n\024GetTransactionByHash\0220.bdware.bdledge" + + "r.api.GetTransactionByHashRequest\0321.bdwa" + + "re.bdledger.api.GetTransactionByHashResp" + + "onse\022\242\001\n!GetTransactionByBlockHashAndInd" + + "ex\022=.bdware.bdledger.api.GetTransactionB" + + "yBlockHashAndIndexRequest\032>.bdware.bdled" + "ger.api.GetTransactionByBlockHashAndInde" + - "xRequest\032>.bdware.bdledger.api.GetTransa" + - "ctionByBlockHashAndIndexResponse\022i\n\017GetT" + - "ransactions\022(.bdware.bdledger.api.Transa" + - "ctionsRequest\032,.bdware.bdledger.api.GetT" + - "ransactionsResponse\022m\n\021CountTransactions" + - "\022(.bdware.bdledger.api.TransactionsReque" + - "st\032..bdware.bdledger.api.CountTransactio" + - "nsResponseBX\n\037org.bdware.bdledger.api.gr" + - "pc.pbB\nQueryProtoZ)bdware.org/bdledger/p" + - "kg/api/grpc/pb;apipbb\006proto3" + "xResponse\022i\n\017GetTransactions\022(.bdware.bd" + + "ledger.api.TransactionsRequest\032,.bdware." + + "bdledger.api.GetTransactionsResponse\022m\n\021" + + "CountTransactions\022(.bdware.bdledger.api." + + "TransactionsRequest\032..bdware.bdledger.ap" + + "i.CountTransactionsResponseBX\n\037org.bdwar" + + "e.bdledger.api.grpc.pbB\nQueryProtoZ)bdwa" + + "re.org/bdledger/pkg/api/grpc/pb;apipbb\006p" + + "roto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -11749,7 +13152,7 @@ public final class QueryProto { internal_static_bdware_bdledger_api_RecentBlocksRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_bdware_bdledger_api_RecentBlocksRequest_descriptor, - new java.lang.String[] { "Ledger", "Count", "IncludeTransactions", }); + new java.lang.String[] { "Ledger", "Offset", "Count", "IncludeTransactions", }); internal_static_bdware_bdledger_api_GetTransactionByHashRequest_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_bdware_bdledger_api_GetTransactionByHashRequest_fieldAccessorTable = new diff --git a/src/test/java/org/bdware/bdledger/api/grpc/ClientTests.java b/src/test/java/org/bdware/bdledger/api/grpc/ClientTests.java index 5909dfe..364a437 100644 --- a/src/test/java/org/bdware/bdledger/api/grpc/ClientTests.java +++ b/src/test/java/org/bdware/bdledger/api/grpc/ClientTests.java @@ -94,10 +94,10 @@ class ClientTests { private static Client client; -// @BeforeAll -// static void initAll() { -// client = new Client("localhost", 10000); -// } + @BeforeAll + static void initAll() { + client = new Client("localhost", 2401); + } // // @Test // @DisplayName("ClientVersion#1") diff --git a/src/test/java/org/bdware/bdledger/api/grpc/Test.java b/src/test/java/org/bdware/bdledger/api/grpc/Test.java new file mode 100644 index 0000000..b2c5788 --- /dev/null +++ b/src/test/java/org/bdware/bdledger/api/grpc/Test.java @@ -0,0 +1,30 @@ +package org.bdware.bdledger.api.grpc; + +import org.bdware.bdledger.api.grpc.pb.LedgerProto.*; +import org.bdware.bdledger.api.grpc.pb.QueryProto.*; +import com.google.protobuf.ByteString; +import io.grpc.Status; +import org.bdware.bdledger.api.grpc.pb.CommonProto.Block; +import org.bdware.bdledger.api.grpc.pb.CommonProto.Transaction; +import org.bdware.bdledger.api.grpc.pb.CommonProto.TransactionType; +import org.bdware.bdledger.api.grpc.pb.LedgerProto.GetLedgersResponse; +import org.junit.jupiter.api.*; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class Test { + public static void main(String[] args) { + Client client = new Client("localhost", 2401); + GetBlocksResponse res = client.getRecentBlocksSync("test", 0, IncludeTransactions.NONE); + System.out.println(res.getBlocks(0).getCreator()); + System.out.println(res.getBlocks(0).getCreatorSignature()); + System.out.println(res.getBlocks(0).getWitnesses(0)); + System.out.println(res.getBlocks(0).getWitnessSignatures(0)); + } +}