public static final class HttpBody.Builder extends GeneratedMessageV3.Builder<HttpBody.Builder> 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 | Method and Description |
---|---|
HttpBody.Builder |
addAllExtensions(java.lang.Iterable<? extends Any> values)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(Any value)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(int index,
Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(int index,
Any value)
Application specific response metadata.
|
Any.Builder |
addExtensionsBuilder()
Application specific response metadata.
|
Any.Builder |
addExtensionsBuilder(int index)
Application specific response metadata.
|
HttpBody.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
HttpBody |
build() |
HttpBody |
buildPartial() |
HttpBody.Builder |
clear() |
HttpBody.Builder |
clearContentType()
The HTTP Content-Type header value specifying the content type of the body.
|
HttpBody.Builder |
clearData()
The HTTP request/response body as raw binary.
|
HttpBody.Builder |
clearExtensions()
Application specific response metadata.
|
HttpBody.Builder |
clearField(Descriptors.FieldDescriptor field) |
HttpBody.Builder |
clearOneof(Descriptors.OneofDescriptor oneof) |
HttpBody.Builder |
clone() |
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.
|
HttpBody |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType() |
Any |
getExtensions(int index)
Application specific response metadata.
|
Any.Builder |
getExtensionsBuilder(int index)
Application specific response metadata.
|
java.util.List<Any.Builder> |
getExtensionsBuilderList()
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.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
HttpBody.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
HttpBody.Builder |
mergeFrom(HttpBody other) |
HttpBody.Builder |
mergeFrom(Message other) |
HttpBody.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields) |
HttpBody.Builder |
removeExtensions(int index)
Application specific response metadata.
|
HttpBody.Builder |
setContentType(java.lang.String value)
The HTTP Content-Type header value specifying the content type of the body.
|
HttpBody.Builder |
setContentTypeBytes(ByteString value)
The HTTP Content-Type header value specifying the content type of the body.
|
HttpBody.Builder |
setData(ByteString value)
The HTTP request/response body as raw binary.
|
HttpBody.Builder |
setExtensions(int index,
Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
setExtensions(int index,
Any value)
Application specific response metadata.
|
HttpBody.Builder |
setField(Descriptors.FieldDescriptor field,
java.lang.Object value) |
HttpBody.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
HttpBody.Builder |
setUnknownFields(UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
addAll, addAll, mergeFrom, newUninitializedMessageException
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clear()
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public HttpBody build()
build
in interface Message.Builder
build
in interface MessageLite.Builder
public HttpBody buildPartial()
buildPartial
in interface Message.Builder
buildPartial
in interface MessageLite.Builder
public HttpBody.Builder clone()
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface Message.Builder
setField
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clearField(Descriptors.FieldDescriptor field)
clearField
in interface Message.Builder
clearField
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clearOneof(Descriptors.OneofDescriptor oneof)
clearOneof
in interface Message.Builder
clearOneof
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface Message.Builder
setRepeatedField
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface Message.Builder
addRepeatedField
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(Message other)
mergeFrom
in interface Message.Builder
mergeFrom
in class AbstractMessage.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(HttpBody other)
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface Message.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<HttpBody.Builder>
java.io.IOException
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 HttpBody.Builder setContentType(java.lang.String value)
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
public HttpBody.Builder clearContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
public HttpBody.Builder setContentTypeBytes(ByteString value)
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
public ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;
getData
in interface HttpBodyOrBuilder
public HttpBody.Builder setData(ByteString value)
The HTTP request/response body as raw binary.
bytes data = 2;
public HttpBody.Builder clearData()
The HTTP request/response body as raw binary.
bytes data = 2;
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 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 HttpBody.Builder setExtensions(int index, Any value)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder setExtensions(int index, Any.Builder builderForValue)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder addExtensions(Any value)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder addExtensions(int index, Any value)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder addExtensions(Any.Builder builderForValue)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder addExtensions(int index, Any.Builder builderForValue)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder addAllExtensions(java.lang.Iterable<? extends Any> values)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder clearExtensions()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public HttpBody.Builder removeExtensions(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public Any.Builder getExtensionsBuilder(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
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 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 Any.Builder addExtensionsBuilder()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public Any.Builder addExtensionsBuilder(int 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<Any.Builder> getExtensionsBuilderList()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public final HttpBody.Builder setUnknownFields(UnknownFieldSet unknownFields)
setUnknownFields
in interface Message.Builder
setUnknownFields
in class GeneratedMessageV3.Builder<HttpBody.Builder>
public final HttpBody.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class GeneratedMessageV3.Builder<HttpBody.Builder>