public final class HttpBody extends com.google.protobuf.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.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENT_TYPE_FIELD_NUMBER |
static int |
DATA_FIELD_NUMBER |
static int |
EXTENSIONS_FIELD_NUMBER |
| 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.
|
com.google.protobuf.ByteString |
getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
|
com.google.protobuf.ByteString |
getData()
The HTTP request/response body as raw binary.
|
static HttpBody |
getDefaultInstance() |
HttpBody |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Any |
getExtensions(int index)
Application specific response metadata.
|
int |
getExtensionsCount()
Application specific response metadata.
|
java.util.List<com.google.protobuf.Any> |
getExtensionsList()
Application specific response metadata.
|
com.google.protobuf.AnyOrBuilder |
getExtensionsOrBuilder(int index)
Application specific response metadata.
|
java.util.List<? extends com.google.protobuf.AnyOrBuilder> |
getExtensionsOrBuilderList()
Application specific response metadata.
|
com.google.protobuf.Parser<HttpBody> |
getParserForType() |
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static HttpBody.Builder |
newBuilder() |
static HttpBody.Builder |
newBuilder(HttpBody prototype) |
HttpBody.Builder |
newBuilderForType() |
protected HttpBody.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(byte[] data) |
static HttpBody |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(com.google.protobuf.ByteString data) |
static HttpBody |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(com.google.protobuf.CodedInputStream input) |
static HttpBody |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.io.InputStream input) |
static HttpBody |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<HttpBody> |
parser() |
HttpBody.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int CONTENT_TYPE_FIELD_NUMBER
public static final int DATA_FIELD_NUMBER
public static final int EXTENSIONS_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public java.lang.String getContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;getContentType in interface HttpBodyOrBuilderpublic com.google.protobuf.ByteString getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;getContentTypeBytes in interface HttpBodyOrBuilderpublic com.google.protobuf.ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;getData in interface HttpBodyOrBuilderpublic java.util.List<com.google.protobuf.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 HttpBodyOrBuilderpublic java.util.List<? extends com.google.protobuf.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 HttpBodyOrBuilderpublic 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 HttpBodyOrBuilderpublic 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;getExtensions in interface HttpBodyOrBuilderpublic com.google.protobuf.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 HttpBodyOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static HttpBody parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic HttpBody.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static HttpBody.Builder newBuilder()
public static HttpBody.Builder newBuilder(HttpBody prototype)
public HttpBody.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected HttpBody.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static HttpBody getDefaultInstance()
public static com.google.protobuf.Parser<HttpBody> parser()
public com.google.protobuf.Parser<HttpBody> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public HttpBody getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder