Class: Google::Apis::Core::BatchUploadCommand

Inherits:
BatchCommand show all
Defined in:
lib/google/apis/core/batch.rb

Overview

Wrapper request for batching multiple uploads in a single server request

Constant Summary

Constants inherited from BatchCommand

Google::Apis::Core::BatchCommand::MULTIPART_MIXED

Constants inherited from HttpCommand

HttpCommand::RETRIABLE_ERRORS

Instance Attribute Summary

Attributes inherited from HttpCommand

#body, #connection, #header, #method, #options, #params, #query, #url

Instance Method Summary collapse

Methods inherited from BatchCommand

#add, #initialize

Methods inherited from HttpCommand

#allow_form_encoding?, #apply_request_options, #authorization_refreshable?, #check_status, #decode_response_body, #error, #execute, #initialize, #process_response, #success

Methods included from Logging

#logger

Constructor Details

This class inherits a constructor from Google::Apis::Core::BatchCommand

Instance Method Details

#ensure_valid_command(command) ⇒ Object



143
144
145
146
# File 'lib/google/apis/core/batch.rb', line 143

def ensure_valid_command(command)
  fail Google::Apis::ClientError, 'Can only include upload commands in batch' \
    unless command.is_a?(Google::Apis::Core::BaseUploadCommand)
end

#prepare!Object



148
149
150
151
# File 'lib/google/apis/core/batch.rb', line 148

def prepare!
  header['X-Goog-Upload-Protocol'] = 'batch'
  super
end