public static final class HttpBody.Builder extends com.google.protobuf.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 com.google.protobuf.Any> values)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(com.google.protobuf.Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(com.google.protobuf.Any value)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(int index,
com.google.protobuf.Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
addExtensions(int index,
com.google.protobuf.Any value)
Application specific response metadata.
|
com.google.protobuf.Any.Builder |
addExtensionsBuilder()
Application specific response metadata.
|
com.google.protobuf.Any.Builder |
addExtensionsBuilder(int index)
Application specific response metadata.
|
HttpBody.Builder |
addRepeatedField(com.google.protobuf.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(com.google.protobuf.Descriptors.FieldDescriptor field) |
HttpBody.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
HttpBody.Builder |
clone() |
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.
|
HttpBody |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
com.google.protobuf.Any |
getExtensions(int index)
Application specific response metadata.
|
com.google.protobuf.Any.Builder |
getExtensionsBuilder(int index)
Application specific response metadata.
|
java.util.List<com.google.protobuf.Any.Builder> |
getExtensionsBuilderList()
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.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
HttpBody.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
HttpBody.Builder |
mergeFrom(HttpBody other) |
HttpBody.Builder |
mergeFrom(com.google.protobuf.Message other) |
HttpBody.Builder |
mergeUnknownFields(com.google.protobuf.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(com.google.protobuf.ByteString value)
The HTTP Content-Type header value specifying the content type of the body.
|
HttpBody.Builder |
setData(com.google.protobuf.ByteString value)
The HTTP request/response body as raw binary.
|
HttpBody.Builder |
setExtensions(int index,
com.google.protobuf.Any.Builder builderForValue)
Application specific response metadata.
|
HttpBody.Builder |
setExtensions(int index,
com.google.protobuf.Any value)
Application specific response metadata.
|
HttpBody.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) |
HttpBody.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
HttpBody.Builder |
setUnknownFields(com.google.protobuf.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
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clear()
clear
in interface com.google.protobuf.Message.Builder
clear
in interface com.google.protobuf.MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType
in interface com.google.protobuf.Message.Builder
getDescriptorForType
in interface com.google.protobuf.MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
public HttpBody build()
build
in interface com.google.protobuf.Message.Builder
build
in interface com.google.protobuf.MessageLite.Builder
public HttpBody buildPartial()
buildPartial
in interface com.google.protobuf.Message.Builder
buildPartial
in interface com.google.protobuf.MessageLite.Builder
public HttpBody.Builder clone()
clone
in interface com.google.protobuf.Message.Builder
clone
in interface com.google.protobuf.MessageLite.Builder
clone
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
setField
in interface com.google.protobuf.Message.Builder
setField
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField
in interface com.google.protobuf.Message.Builder
clearField
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof
in interface com.google.protobuf.Message.Builder
clearOneof
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField
in interface com.google.protobuf.Message.Builder
setRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField
in interface com.google.protobuf.Message.Builder
addRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in class com.google.protobuf.AbstractMessage.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(HttpBody other)
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public HttpBody.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom
in interface com.google.protobuf.Message.Builder
mergeFrom
in interface com.google.protobuf.MessageLite.Builder
mergeFrom
in class com.google.protobuf.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 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 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(com.google.protobuf.ByteString value)
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
public com.google.protobuf.ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;
getData
in interface HttpBodyOrBuilder
public HttpBody.Builder setData(com.google.protobuf.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<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 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 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 HttpBodyOrBuilder
public HttpBody.Builder setExtensions(int index, com.google.protobuf.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, com.google.protobuf.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(com.google.protobuf.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, com.google.protobuf.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(com.google.protobuf.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, com.google.protobuf.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 com.google.protobuf.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 com.google.protobuf.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 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 HttpBodyOrBuilder
public 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 HttpBodyOrBuilder
public com.google.protobuf.Any.Builder addExtensionsBuilder()
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)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
public java.util.List<com.google.protobuf.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(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields
in interface com.google.protobuf.Message.Builder
setUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
public final HttpBody.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields
in interface com.google.protobuf.Message.Builder
mergeUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>