Package com.google.api
Class HttpBody.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
com.google.api.HttpBody.Builder
- All Implemented Interfaces:
HttpBodyOrBuilder
,com.google.protobuf.Message.Builder
,com.google.protobuf.MessageLite.Builder
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,Cloneable
- Enclosing class:
HttpBody
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
-
Method Summary
Modifier and TypeMethodDescriptionaddAllExtensions
(Iterable<? extends com.google.protobuf.Any> values) Application specific response metadata.addExtensions
(int index, com.google.protobuf.Any value) Application specific response metadata.addExtensions
(int index, com.google.protobuf.Any.Builder builderForValue) Application specific response metadata.addExtensions
(com.google.protobuf.Any value) Application specific response metadata.addExtensions
(com.google.protobuf.Any.Builder builderForValue) Application specific response metadata.com.google.protobuf.Any.Builder
Application specific response metadata.com.google.protobuf.Any.Builder
addExtensionsBuilder
(int index) Application specific response metadata.addRepeatedField
(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()
clear()
The HTTP Content-Type header value specifying the content type of the body.The HTTP request/response body as raw binary.Application specific response metadata.clearField
(com.google.protobuf.Descriptors.FieldDescriptor field) clearOneof
(com.google.protobuf.Descriptors.OneofDescriptor oneof) clone()
The HTTP Content-Type header value specifying the content type of the body.com.google.protobuf.ByteString
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 final com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Descriptors.Descriptor
com.google.protobuf.Any
getExtensions
(int index) Application specific response metadata.com.google.protobuf.Any.Builder
getExtensionsBuilder
(int index) Application specific response metadata.List<com.google.protobuf.Any.Builder>
Application specific response metadata.int
Application specific response metadata.List<com.google.protobuf.Any>
Application specific response metadata.com.google.protobuf.AnyOrBuilder
getExtensionsOrBuilder
(int index) Application specific response metadata.List<? extends com.google.protobuf.AnyOrBuilder>
Application specific response metadata.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
final boolean
mergeFrom
(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom
(com.google.protobuf.Message other) final HttpBody.Builder
mergeUnknownFields
(com.google.protobuf.UnknownFieldSet unknownFields) removeExtensions
(int index) Application specific response metadata.setContentType
(String value) The HTTP Content-Type header value specifying the content type of the body.setContentTypeBytes
(com.google.protobuf.ByteString value) The HTTP Content-Type header value specifying the content type of the body.setData
(com.google.protobuf.ByteString value) The HTTP request/response body as raw binary.setExtensions
(int index, com.google.protobuf.Any value) Application specific response metadata.setExtensions
(int index, com.google.protobuf.Any.Builder builderForValue) Application specific response metadata.setRepeatedField
(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) final HttpBody.Builder
setUnknownFields
(com.google.protobuf.UnknownFieldSet unknownFields) Methods inherited from class com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, newBuilderForField, onBuilt, onChanged, setUnknownFieldsProto3
Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFrom
Methods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
clear
- Specified by:
clear
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clear
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clear
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.Message.Builder
- Specified by:
getDescriptorForType
in interfacecom.google.protobuf.MessageOrBuilder
- Overrides:
getDescriptorForType
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
build
in interfacecom.google.protobuf.Message.Builder
- Specified by:
build
in interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartial
in interfacecom.google.protobuf.Message.Builder
- Specified by:
buildPartial
in interfacecom.google.protobuf.MessageLite.Builder
-
clone
- Specified by:
clone
in interfacecom.google.protobuf.Message.Builder
- Specified by:
clone
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
clone
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
setField
public HttpBody.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
setField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setField
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
clearField
- Specified by:
clearField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearField
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
clearOneof
- Specified by:
clearOneof
in interfacecom.google.protobuf.Message.Builder
- Overrides:
clearOneof
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
setRepeatedField
public HttpBody.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - Specified by:
setRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
addRepeatedField
public HttpBody.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - Specified by:
addRepeatedField
in interfacecom.google.protobuf.Message.Builder
- Overrides:
addRepeatedField
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
mergeFrom
- Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<HttpBody.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
mergeFrom
public HttpBody.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFrom
in interfacecom.google.protobuf.Message.Builder
- Specified by:
mergeFrom
in interfacecom.google.protobuf.MessageLite.Builder
- Overrides:
mergeFrom
in classcom.google.protobuf.AbstractMessage.Builder<HttpBody.Builder>
- Throws:
IOException
-
getContentType
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
- Specified by:
getContentType
in interfaceHttpBodyOrBuilder
- Returns:
- The contentType.
-
getContentTypeBytes
public com.google.protobuf.ByteString getContentTypeBytes()The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
- Specified by:
getContentTypeBytes
in interfaceHttpBodyOrBuilder
- Returns:
- The bytes for contentType.
-
setContentType
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
- Parameters:
value
- The contentType to set.- Returns:
- This builder for chaining.
-
clearContentType
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
- Returns:
- This builder for chaining.
-
setContentTypeBytes
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;
- Parameters:
value
- The bytes for contentType to set.- Returns:
- This builder for chaining.
-
getData
public com.google.protobuf.ByteString getData()The HTTP request/response body as raw binary.
bytes data = 2;
- Specified by:
getData
in interfaceHttpBodyOrBuilder
- Returns:
- The data.
-
setData
The HTTP request/response body as raw binary.
bytes data = 2;
- Parameters:
value
- The data to set.- Returns:
- This builder for chaining.
-
clearData
The HTTP request/response body as raw binary.
bytes data = 2;
- Returns:
- This builder for chaining.
-
getExtensionsList
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
- Specified by:
getExtensionsList
in interfaceHttpBodyOrBuilder
-
getExtensionsCount
public int getExtensionsCount()Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
- Specified by:
getExtensionsCount
in interfaceHttpBodyOrBuilder
-
getExtensions
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;
- Specified by:
getExtensions
in interfaceHttpBodyOrBuilder
-
setExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
setExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
addExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
addExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
addExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
addExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
addAllExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
clearExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
removeExtensions
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
getExtensionsBuilder
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;
-
getExtensionsOrBuilder
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;
- Specified by:
getExtensionsOrBuilder
in interfaceHttpBodyOrBuilder
-
getExtensionsOrBuilderList
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
- Specified by:
getExtensionsOrBuilderList
in interfaceHttpBodyOrBuilder
-
addExtensionsBuilder
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;
-
addExtensionsBuilder
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;
-
getExtensionsBuilderList
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;
-
setUnknownFields
- Specified by:
setUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
setUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-
mergeUnknownFields
- Specified by:
mergeUnknownFields
in interfacecom.google.protobuf.Message.Builder
- Overrides:
mergeUnknownFields
in classcom.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
-