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
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns
Methods
addAllExtensions(Iterable<? extends Any> values)
public HttpBody.Builder addAllExtensions(Iterable<? extends Any> values)
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Parameter
Name | Description |
values | Iterable<? extends com.google.protobuf.Any>
|
Returns
addExtensions(Any value)
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;
Parameter
Returns
addExtensions(Any.Builder builderForValue)
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;
Parameter
Name | Description |
builderForValue | Builder
|
Returns
addExtensions(int index, Any value)
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;
Parameters
Name | Description |
index | int
|
value | Any
|
Returns
addExtensions(int index, Any.Builder builderForValue)
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;
Parameters
Returns
addExtensionsBuilder()
public Any.Builder addExtensionsBuilder()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
addExtensionsBuilder(int index)
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;
Parameter
Returns
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public HttpBody.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
build()
Returns
buildPartial()
public HttpBody buildPartial()
Returns
clear()
public HttpBody.Builder clear()
Returns
Overrides
clearContentType()
public HttpBody.Builder clearContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
Returns
clearData()
public HttpBody.Builder clearData()
The HTTP request/response body as raw binary.
bytes data = 2;
Returns
clearExtensions()
public HttpBody.Builder clearExtensions()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
clearField(Descriptors.FieldDescriptor field)
public HttpBody.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Returns
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public HttpBody.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Returns
Overrides
clone()
public HttpBody.Builder clone()
Returns
Overrides
getContentType()
public String getContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
Returns
Type | Description |
String | The contentType.
|
getContentTypeBytes()
public ByteString getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
Returns
Type | Description |
ByteString | The bytes for contentType.
|
getData()
public ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;
Returns
getDefaultInstanceForType()
public HttpBody getDefaultInstanceForType()
Returns
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns
Overrides
getExtensions(int index)
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;
Parameter
Returns
getExtensionsBuilder(int index)
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;
Parameter
Returns
getExtensionsBuilderList()
public List<Any.Builder> getExtensionsBuilderList()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
getExtensionsCount()
public int getExtensionsCount()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
getExtensionsList()
public List<Any> getExtensionsList()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
getExtensionsOrBuilder(int index)
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;
Parameter
Returns
getExtensionsOrBuilderList()
public List<? extends AnyOrBuilder> getExtensionsOrBuilderList()
Application specific response metadata. Must be set in the first response
for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
Returns
Type | Description |
List<? extends com.google.protobuf.AnyOrBuilder> | |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Overrides
isInitialized()
public final boolean isInitialized()
Returns
Overrides
mergeFrom(HttpBody other)
public HttpBody.Builder mergeFrom(HttpBody other)
Parameter
Returns
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public HttpBody.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Returns
Overrides
Exceptions
mergeFrom(Message other)
public HttpBody.Builder mergeFrom(Message other)
Parameter
Returns
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final HttpBody.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides
removeExtensions(int index)
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;
Parameter
Returns
setContentType(String value)
public HttpBody.Builder setContentType(String value)
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
Parameter
Name | Description |
value | String
The contentType to set.
|
Returns
setContentTypeBytes(ByteString value)
public HttpBody.Builder setContentTypeBytes(ByteString value)
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
Parameter
Name | Description |
value | ByteString
The bytes for contentType to set.
|
Returns
setData(ByteString value)
public HttpBody.Builder setData(ByteString value)
The HTTP request/response body as raw binary.
bytes data = 2;
Parameter
Returns
setExtensions(int index, Any value)
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;
Parameters
Name | Description |
index | int
|
value | Any
|
Returns
setExtensions(int index, Any.Builder builderForValue)
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;
Parameters
Returns
setField(Descriptors.FieldDescriptor field, Object value)
public HttpBody.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Returns
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public HttpBody.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Returns
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final HttpBody.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Returns
Overrides