com.google.rpc.HttpRequest Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: google/rpc/http.proto
// Protobuf Java Version: 4.28.1
package com.google.rpc;
/**
*
* Represents an HTTP request.
*
*
* Protobuf type {@code google.rpc.HttpRequest}
*/
public final class HttpRequest extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:google.rpc.HttpRequest)
HttpRequestOrBuilder {
private static final long serialVersionUID = 0L;
static {
com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
/* major= */ 4,
/* minor= */ 28,
/* patch= */ 1,
/* suffix= */ "",
HttpRequest.class.getName());
}
// Use HttpRequest.newBuilder() to construct.
private HttpRequest(com.google.protobuf.GeneratedMessage.Builder> builder) {
super(builder);
}
private HttpRequest() {
method_ = "";
uri_ = "";
headers_ = java.util.Collections.emptyList();
body_ = com.google.protobuf.ByteString.EMPTY;
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.rpc.HttpRequest.class, com.google.rpc.HttpRequest.Builder.class);
}
public static final int METHOD_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object method_ = "";
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @return The method.
*/
@java.lang.Override
public java.lang.String getMethod() {
java.lang.Object ref = method_;
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();
method_ = s;
return s;
}
}
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @return The bytes for method.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMethodBytes() {
java.lang.Object ref = method_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
method_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int URI_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object uri_ = "";
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @return The uri.
*/
@java.lang.Override
public java.lang.String getUri() {
java.lang.Object ref = uri_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
uri_ = s;
return s;
}
}
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @return The bytes for uri.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HEADERS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List headers_;
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public java.util.List getHeadersList() {
return headers_;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public java.util.List extends com.google.rpc.HttpHeaderOrBuilder>
getHeadersOrBuilderList() {
return headers_;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public int getHeadersCount() {
return headers_.size();
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public com.google.rpc.HttpHeader getHeaders(int index) {
return headers_.get(index);
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
@java.lang.Override
public com.google.rpc.HttpHeaderOrBuilder getHeadersOrBuilder(
int index) {
return headers_.get(index);
}
public static final int BODY_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* The HTTP request body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return The body.
*/
@java.lang.Override
public com.google.protobuf.ByteString getBody() {
return body_;
}
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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(method_)) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, method_);
}
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) {
com.google.protobuf.GeneratedMessage.writeString(output, 2, uri_);
}
for (int i = 0; i < headers_.size(); i++) {
output.writeMessage(3, headers_.get(i));
}
if (!body_.isEmpty()) {
output.writeBytes(4, body_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(method_)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, method_);
}
if (!com.google.protobuf.GeneratedMessage.isStringEmpty(uri_)) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, uri_);
}
for (int i = 0; i < headers_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, headers_.get(i));
}
if (!body_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, body_);
}
size += getUnknownFields().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.HttpRequest)) {
return super.equals(obj);
}
com.google.rpc.HttpRequest other = (com.google.rpc.HttpRequest) obj;
if (!getMethod()
.equals(other.getMethod())) return false;
if (!getUri()
.equals(other.getUri())) return false;
if (!getHeadersList()
.equals(other.getHeadersList())) return false;
if (!getBody()
.equals(other.getBody())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) 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) + METHOD_FIELD_NUMBER;
hash = (53 * hash) + getMethod().hashCode();
hash = (37 * hash) + URI_FIELD_NUMBER;
hash = (53 * hash) + getUri().hashCode();
if (getHeadersCount() > 0) {
hash = (37 * hash) + HEADERS_FIELD_NUMBER;
hash = (53 * hash) + getHeadersList().hashCode();
}
hash = (37 * hash) + BODY_FIELD_NUMBER;
hash = (53 * hash) + getBody().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.rpc.HttpRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpRequest 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.HttpRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpRequest 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.HttpRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.rpc.HttpRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.rpc.HttpRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.google.rpc.HttpRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.rpc.HttpRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.rpc.HttpRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.rpc.HttpRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static com.google.rpc.HttpRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.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.HttpRequest 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.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
* Represents an HTTP request.
*
*
* Protobuf type {@code google.rpc.HttpRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder implements
// @@protoc_insertion_point(builder_implements:google.rpc.HttpRequest)
com.google.rpc.HttpRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.rpc.HttpRequest.class, com.google.rpc.HttpRequest.Builder.class);
}
// Construct using com.google.rpc.HttpRequest.newBuilder()
private Builder() {
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
method_ = "";
uri_ = "";
if (headersBuilder_ == null) {
headers_ = java.util.Collections.emptyList();
} else {
headers_ = null;
headersBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
body_ = com.google.protobuf.ByteString.EMPTY;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.rpc.HttpProto.internal_static_google_rpc_HttpRequest_descriptor;
}
@java.lang.Override
public com.google.rpc.HttpRequest getDefaultInstanceForType() {
return com.google.rpc.HttpRequest.getDefaultInstance();
}
@java.lang.Override
public com.google.rpc.HttpRequest build() {
com.google.rpc.HttpRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.rpc.HttpRequest buildPartial() {
com.google.rpc.HttpRequest result = new com.google.rpc.HttpRequest(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) { buildPartial0(result); }
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.rpc.HttpRequest result) {
if (headersBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
headers_ = java.util.Collections.unmodifiableList(headers_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.headers_ = headers_;
} else {
result.headers_ = headersBuilder_.build();
}
}
private void buildPartial0(com.google.rpc.HttpRequest result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.method_ = method_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.uri_ = uri_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.body_ = body_;
}
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.rpc.HttpRequest) {
return mergeFrom((com.google.rpc.HttpRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.rpc.HttpRequest other) {
if (other == com.google.rpc.HttpRequest.getDefaultInstance()) return this;
if (!other.getMethod().isEmpty()) {
method_ = other.method_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getUri().isEmpty()) {
uri_ = other.uri_;
bitField0_ |= 0x00000002;
onChanged();
}
if (headersBuilder_ == null) {
if (!other.headers_.isEmpty()) {
if (headers_.isEmpty()) {
headers_ = other.headers_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureHeadersIsMutable();
headers_.addAll(other.headers_);
}
onChanged();
}
} else {
if (!other.headers_.isEmpty()) {
if (headersBuilder_.isEmpty()) {
headersBuilder_.dispose();
headersBuilder_ = null;
headers_ = other.headers_;
bitField0_ = (bitField0_ & ~0x00000004);
headersBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getHeadersFieldBuilder() : null;
} else {
headersBuilder_.addAllMessages(other.headers_);
}
}
}
if (other.getBody() != com.google.protobuf.ByteString.EMPTY) {
setBody(other.getBody());
}
this.mergeUnknownFields(other.getUnknownFields());
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 {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
method_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18: {
uri_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26: {
com.google.rpc.HttpHeader m =
input.readMessage(
com.google.rpc.HttpHeader.parser(),
extensionRegistry);
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(m);
} else {
headersBuilder_.addMessage(m);
}
break;
} // case 26
case 34: {
body_ = input.readBytes();
bitField0_ |= 0x00000008;
break;
} // case 34
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object method_ = "";
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @return The method.
*/
public java.lang.String getMethod() {
java.lang.Object ref = method_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
method_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @return The bytes for method.
*/
public com.google.protobuf.ByteString
getMethodBytes() {
java.lang.Object ref = method_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
method_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @param value The method to set.
* @return This builder for chaining.
*/
public Builder setMethod(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
method_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @return This builder for chaining.
*/
public Builder clearMethod() {
method_ = getDefaultInstance().getMethod();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
* The HTTP request method.
*
*
* string method = 1;
* @param value The bytes for method to set.
* @return This builder for chaining.
*/
public Builder setMethodBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
method_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object uri_ = "";
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @return The uri.
*/
public java.lang.String getUri() {
java.lang.Object ref = uri_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
uri_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @return The bytes for uri.
*/
public com.google.protobuf.ByteString
getUriBytes() {
java.lang.Object ref = uri_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
uri_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @param value The uri to set.
* @return This builder for chaining.
*/
public Builder setUri(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
uri_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @return This builder for chaining.
*/
public Builder clearUri() {
uri_ = getDefaultInstance().getUri();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
* The HTTP request URI.
*
*
* string uri = 2;
* @param value The bytes for uri to set.
* @return This builder for chaining.
*/
public Builder setUriBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
uri_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.util.List headers_ =
java.util.Collections.emptyList();
private void ensureHeadersIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
headers_ = new java.util.ArrayList(headers_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder> headersBuilder_;
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public java.util.List getHeadersList() {
if (headersBuilder_ == null) {
return java.util.Collections.unmodifiableList(headers_);
} else {
return headersBuilder_.getMessageList();
}
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public int getHeadersCount() {
if (headersBuilder_ == null) {
return headers_.size();
} else {
return headersBuilder_.getCount();
}
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public com.google.rpc.HttpHeader getHeaders(int index) {
if (headersBuilder_ == null) {
return headers_.get(index);
} else {
return headersBuilder_.getMessage(index);
}
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder setHeaders(
int index, com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.set(index, value);
onChanged();
} else {
headersBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder setHeaders(
int index, com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.set(index, builderForValue.build());
onChanged();
} else {
headersBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder addHeaders(com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.add(value);
onChanged();
} else {
headersBuilder_.addMessage(value);
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder addHeaders(
int index, com.google.rpc.HttpHeader value) {
if (headersBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureHeadersIsMutable();
headers_.add(index, value);
onChanged();
} else {
headersBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder addHeaders(
com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(builderForValue.build());
onChanged();
} else {
headersBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder addHeaders(
int index, com.google.rpc.HttpHeader.Builder builderForValue) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.add(index, builderForValue.build());
onChanged();
} else {
headersBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder addAllHeaders(
java.lang.Iterable extends com.google.rpc.HttpHeader> values) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, headers_);
onChanged();
} else {
headersBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder clearHeaders() {
if (headersBuilder_ == null) {
headers_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
headersBuilder_.clear();
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public Builder removeHeaders(int index) {
if (headersBuilder_ == null) {
ensureHeadersIsMutable();
headers_.remove(index);
onChanged();
} else {
headersBuilder_.remove(index);
}
return this;
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public com.google.rpc.HttpHeader.Builder getHeadersBuilder(
int index) {
return getHeadersFieldBuilder().getBuilder(index);
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public com.google.rpc.HttpHeaderOrBuilder getHeadersOrBuilder(
int index) {
if (headersBuilder_ == null) {
return headers_.get(index); } else {
return headersBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public java.util.List extends com.google.rpc.HttpHeaderOrBuilder>
getHeadersOrBuilderList() {
if (headersBuilder_ != null) {
return headersBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(headers_);
}
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public com.google.rpc.HttpHeader.Builder addHeadersBuilder() {
return getHeadersFieldBuilder().addBuilder(
com.google.rpc.HttpHeader.getDefaultInstance());
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public com.google.rpc.HttpHeader.Builder addHeadersBuilder(
int index) {
return getHeadersFieldBuilder().addBuilder(
index, com.google.rpc.HttpHeader.getDefaultInstance());
}
/**
*
* The HTTP request headers. The ordering of the headers is significant.
* Multiple headers with the same key may present for the request.
*
*
* repeated .google.rpc.HttpHeader headers = 3;
*/
public java.util.List
getHeadersBuilderList() {
return getHeadersFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder>
getHeadersFieldBuilder() {
if (headersBuilder_ == null) {
headersBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
com.google.rpc.HttpHeader, com.google.rpc.HttpHeader.Builder, com.google.rpc.HttpHeaderOrBuilder>(
headers_,
((bitField0_ & 0x00000004) != 0),
getParentForChildren(),
isClean());
headers_ = null;
}
return headersBuilder_;
}
private com.google.protobuf.ByteString body_ = com.google.protobuf.ByteString.EMPTY;
/**
*
* The HTTP request body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return The body.
*/
@java.lang.Override
public com.google.protobuf.ByteString getBody() {
return body_;
}
/**
*
* The HTTP request body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @param value The body to set.
* @return This builder for chaining.
*/
public Builder setBody(com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
body_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
* The HTTP request body. If the body is not expected, it should be empty.
*
*
* bytes body = 4;
* @return This builder for chaining.
*/
public Builder clearBody() {
bitField0_ = (bitField0_ & ~0x00000008);
body_ = getDefaultInstance().getBody();
onChanged();
return this;
}
// @@protoc_insertion_point(builder_scope:google.rpc.HttpRequest)
}
// @@protoc_insertion_point(class_scope:google.rpc.HttpRequest)
private static final com.google.rpc.HttpRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.rpc.HttpRequest();
}
public static com.google.rpc.HttpRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public HttpRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
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.HttpRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}