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 Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • clear

      public HttpBody.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • getDefaultInstanceForType

      public HttpBody getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public HttpBody build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public HttpBody buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      public HttpBody.Builder clone()
      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • setField

      public HttpBody.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • clearField

      public HttpBody.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • clearOneof

      public HttpBody.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.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 interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • addRepeatedField

      public HttpBody.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • mergeFrom

      public HttpBody.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<HttpBody.Builder>
    • mergeFrom

      public HttpBody.Builder mergeFrom(HttpBody other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.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 interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<HttpBody.Builder>
      Throws:
      IOException
    • getContentType

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

      public HttpBody.Builder setContentType(String value)
       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

      public HttpBody.Builder clearContentType()
       The HTTP Content-Type header value specifying the content type of the body.
       
      string content_type = 1;
      Returns:
      This builder for chaining.
    • setContentTypeBytes

      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;
      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 interface HttpBodyOrBuilder
      Returns:
      The data.
    • setData

      public HttpBody.Builder setData(com.google.protobuf.ByteString value)
       The HTTP request/response body as raw binary.
       
      bytes data = 2;
      Parameters:
      value - The data to set.
      Returns:
      This builder for chaining.
    • clearData

      public HttpBody.Builder clearData()
       The HTTP request/response body as raw binary.
       
      bytes data = 2;
      Returns:
      This builder for chaining.
    • 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;
      Specified by:
      getExtensionsList in interface HttpBodyOrBuilder
    • 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 interface HttpBodyOrBuilder
    • getExtensions

      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;
      Specified by:
      getExtensions in interface HttpBodyOrBuilder
    • setExtensions

      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;
    • setExtensions

      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;
    • addExtensions

      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;
    • addExtensions

      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;
    • addExtensions

      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;
    • addExtensions

      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;
    • addAllExtensions

      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;
    • 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;
    • removeExtensions

      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;
    • getExtensionsBuilder

      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;
    • getExtensionsOrBuilder

      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;
      Specified by:
      getExtensionsOrBuilder in interface HttpBodyOrBuilder
    • 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;
      Specified by:
      getExtensionsOrBuilderList in interface HttpBodyOrBuilder
    • 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

      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;
    • 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;
    • setUnknownFields

      public final HttpBody.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>
    • mergeUnknownFields

      public final HttpBody.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<HttpBody.Builder>