Class HttpBody

java.lang.Object
com.google.protobuf.AbstractMessageLite<MessageType,BuilderType>
com.google.protobuf.GeneratedMessageLite<HttpBody,HttpBody.Builder>
com.google.api.HttpBody
All Implemented Interfaces:
HttpBodyOrBuilder, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder

public final class HttpBody extends com.google.protobuf.GeneratedMessageLite<HttpBody,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
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Message that represents an arbitrary HTTP body.

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageLite

    com.google.protobuf.GeneratedMessageLite.DefaultInstanceBasedParser<T extends com.google.protobuf.GeneratedMessageLite<T,?>>, com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends com.google.protobuf.GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageLite.GeneratedExtension<ContainingType extends com.google.protobuf.MessageLite,Type extends Object>, com.google.protobuf.GeneratedMessageLite.MethodToInvoke, com.google.protobuf.GeneratedMessageLite.SerializedForm

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessageLite

    unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final Object
    dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
     
    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
    The HTTP request/response body as raw binary.
    static HttpBody
     
    com.google.protobuf.Any
    getExtensions(int index)
    Application specific response metadata.
    int
    Application specific response metadata.
    List<com.google.protobuf.Any>
    Application specific response metadata.
    com.google.protobuf.AnyOrBuilder
    Application specific response metadata.
    List<? extends com.google.protobuf.AnyOrBuilder>
    Application specific response metadata.
     
    newBuilder(HttpBody prototype)
     
    static HttpBody
     
    static HttpBody
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static HttpBody
    parseFrom(byte[] data)
     
    static HttpBody
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static HttpBody
    parseFrom(com.google.protobuf.ByteString data)
     
    static HttpBody
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static HttpBody
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static HttpBody
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static HttpBody
     
    static HttpBody
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static HttpBody
     
    static HttpBody
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<HttpBody>
     

    Methods inherited from class com.google.protobuf.GeneratedMessageLite

    createBuilder, createBuilder, dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, getSerializedSize, hashCode, isInitialized, isInitialized, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newMessageInfo, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, registerDefaultInstance, toBuilder, toString, writeTo

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder

    getDefaultInstanceForType, isInitialized
  • Field Details

  • Method Details

    • getContentType

      public String getContentType()
       The HTTP Content-Type header value specifying the content type of the body.
       
      string content_type = 1 [json_name = "contentType"];
      Specified by:
      getContentType in interface HttpBodyOrBuilder
      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 [json_name = "contentType"];
      Specified by:
      getContentTypeBytes in interface HttpBodyOrBuilder
      Returns:
      The bytes for contentType.
    • getData

      public com.google.protobuf.ByteString getData()
       The HTTP request/response body as raw binary.
       
      bytes data = 2 [json_name = "data"];
      Specified by:
      getData in interface HttpBodyOrBuilder
      Returns:
      The data.
    • getExtensionsList

      public 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 [json_name = "extensions"];
      Specified by:
      getExtensionsList in interface HttpBodyOrBuilder
    • getExtensionsOrBuilderList

      public 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 [json_name = "extensions"];
    • getExtensionsCount

      public int getExtensionsCount()
       Application specific response metadata. Must be set in the first response
       for streaming APIs.
       
      repeated .google.protobuf.Any extensions = 3 [json_name = "extensions"];
      Specified by:
      getExtensionsCount in interface HttpBodyOrBuilder
    • 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 [json_name = "extensions"];
      Specified by:
      getExtensions in interface HttpBodyOrBuilder
    • 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 [json_name = "extensions"];
    • parseFrom

      public static HttpBody parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static HttpBody parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static HttpBody parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static HttpBody parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static HttpBody parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static HttpBody parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static HttpBody parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilder

      public static HttpBody.Builder newBuilder()
    • newBuilder

      public static HttpBody.Builder newBuilder(HttpBody prototype)
    • dynamicMethod

      protected final Object dynamicMethod(com.google.protobuf.GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
      Specified by:
      dynamicMethod in class com.google.protobuf.GeneratedMessageLite<HttpBody,HttpBody.Builder>
    • getDefaultInstance

      public static HttpBody getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<HttpBody> parser()