public final class HttpBody extends GeneratedMessageV3 implements HttpBodyOrBuilder
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
google.api.HttpBody
Modifier and Type | Class and Description |
---|---|
static class |
HttpBody.Builder
Message that represents an arbitrary HTTP body.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable
Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_TYPE_FIELD_NUMBER |
static int |
DATA_FIELD_NUMBER |
static int |
EXTENSIONS_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getContentType()
The HTTP Content-Type header value specifying the content type of the body.
|
ByteString |
getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
|
ByteString |
getData()
The HTTP request/response body as raw binary.
|
static HttpBody |
getDefaultInstance() |
HttpBody |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Any |
getExtensions(int index)
Application specific response metadata.
|
int |
getExtensionsCount()
Application specific response metadata.
|
java.util.List<Any> |
getExtensionsList()
Application specific response metadata.
|
AnyOrBuilder |
getExtensionsOrBuilder(int index)
Application specific response metadata.
|
java.util.List<? extends AnyOrBuilder> |
getExtensionsOrBuilderList()
Application specific response metadata.
|
Parser<HttpBody> |
getParserForType() |
int |
getSerializedSize() |
UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static HttpBody.Builder |
newBuilder() |
static HttpBody.Builder |
newBuilder(HttpBody prototype) |
HttpBody.Builder |
newBuilderForType() |
protected HttpBody.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(byte[] data) |
static HttpBody |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(ByteString data) |
static HttpBody |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(CodedInputStream input) |
static HttpBody |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.io.InputStream input) |
static HttpBody |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<HttpBody> |
parser() |
HttpBody.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public static final int CONTENT_TYPE_FIELD_NUMBER
public static final int DATA_FIELD_NUMBER
public static final int EXTENSIONS_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public java.lang.String getContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
getContentType
in interface HttpBodyOrBuilder
public ByteString getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
getContentTypeBytes
in interface HttpBodyOrBuilder
public ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;
getData
in interface HttpBodyOrBuilder
public java.util.List<Any> getExtensionsList()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
getExtensionsList
in interface HttpBodyOrBuilder
public java.util.List<? extends AnyOrBuilder> getExtensionsOrBuilderList()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
getExtensionsOrBuilderList
in interface HttpBodyOrBuilder
public int getExtensionsCount()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
getExtensionsCount
in interface HttpBodyOrBuilder
public Any getExtensions(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
getExtensions
in interface HttpBodyOrBuilder
public AnyOrBuilder getExtensionsOrBuilder(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
getExtensionsOrBuilder
in interface HttpBodyOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static HttpBody parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static HttpBody parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static HttpBody parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static HttpBody parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static HttpBody parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static HttpBody parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static HttpBody parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public HttpBody.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static HttpBody.Builder newBuilder()
public static HttpBody.Builder newBuilder(HttpBody prototype)
public HttpBody.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected HttpBody.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static HttpBody getDefaultInstance()
public Parser<HttpBody> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public HttpBody getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder