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()
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>
|
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 |
---|
Name | Description |
value | Any
|
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
|
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
|
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 |
---|
Name | Description |
index | int
|
builderForValue | Builder
|
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;
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 |
---|
Name | Description |
index | int
|
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public HttpBody.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
buildPartial()
public HttpBody buildPartial()
clear()
public HttpBody.Builder clear()
Overrides
clearContentType()
public HttpBody.Builder clearContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
clearData()
public HttpBody.Builder clearData()
The HTTP request/response body as raw binary.
bytes data = 2;
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;
clearField(Descriptors.FieldDescriptor field)
public HttpBody.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public HttpBody.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Overrides
clone()
public HttpBody.Builder clone()
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;
getDefaultInstanceForType()
public HttpBody getDefaultInstanceForType()
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
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 |
---|
Name | Description |
index | int
|
Returns |
---|
Type | Description |
Any | |
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 |
---|
Name | Description |
index | int
|
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;
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 |
---|
Type | Description |
int | |
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;
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 |
---|
Name | Description |
index | int
|
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()
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
mergeFrom(HttpBody other)
public HttpBody.Builder mergeFrom(HttpBody other)
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public HttpBody.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Overrides
mergeFrom(Message other)
public HttpBody.Builder mergeFrom(Message other)
Parameter |
---|
Name | Description |
other | Message
|
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final HttpBody.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
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 |
---|
Name | Description |
index | int
|
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.
|
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.
|
setData(ByteString value)
public HttpBody.Builder setData(ByteString value)
The HTTP request/response body as raw binary.
bytes data = 2;
Parameter |
---|
Name | Description |
value | ByteString
The data to set.
|
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
|
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 |
---|
Name | Description |
index | int
|
builderForValue | Builder
|
setField(Descriptors.FieldDescriptor field, Object value)
public HttpBody.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public HttpBody.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setUnknownFields(UnknownFieldSet unknownFields)
public final HttpBody.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides