google-apis-core/lib/google/apis/core/base_service.rb
def batch_upload(options = nil)
          batch_command = BatchUploadCommand.new(:put, Addressable::URI.parse(root_url + upload_path))
          batch_command.options = request_options.merge(options)
          apply_command_defaults(batch_command)
          begin
            start_batch(batch_command)
            yield self
          ensure
            end_batch
          end
          batch_command.execute(client)
        end
# Perform a batch upload request. Calls made within the block are sent in a single network
# request to the server. Batch uploads are useful for uploading multiple small files. For larger
# files, use single requests which use a resumable upload protocol.
#
# @example
#   service.batch do |s|
#     s.insert_item(upload_source: 'file1.txt') do |res, err|
#       # process response for 1st call
#     end
#     # ...
#     s.insert_item(upload_source: 'fileN.txt') do |res, err|
#       # process response for Nth call
#     end
#   end
#
# @param [Hash, Google::Apis::RequestOptions] options
#  Request-specific options
# @yield [self]
# @return [void]
Perform a batch upload request. Calls made within the block are sent in a single network
request to the server. Batch uploads are useful for uploading multiple small files. For larger
files, use single requests which use a resumable upload protocol.
Perform a batch upload request . Calls made within the block are sent in a single network request to the server . Batch uploads are useful for uploading multiple small files . For larger files use single requests which use a resumable upload protocol .
def batch_upload(options = nil)
          batch_command = BatchUploadCommand.new(:put, Addressable::URI.parse(root_url + upload_path))
          batch_command.options = request_options.merge(options)
          apply_command_defaults(batch_command)
          begin
            start_batch(batch_command)
            yield self
          ensure
            end_batch
          end
          batch_command.execute(client)
        end
def batch_upload ( options = nil ) batch_command = BatchUploadCommand . new ( :put , Addressable :: URI . parse ( root_url + upload_path ) ) batch_command . options = request_options . merge ( options ) apply_command_defaults ( batch_command ) begin start_batch ( batch_command ) yield self ensure end_batch end batch_command . execute ( client ) end
Perform a batch upload request.
Perform a batch upload request .
None
void
options
options Request-specific options
options Request - specific options
]
None
example
service.batch do |s| s.insert_item(upload_source: 'file1.txt') do |res, err| # process response for 1st call end # ... s.insert_item(upload_source: 'fileN.txt') do |res, err| # process response for Nth call end end
service . batch do |s| s . insert_item ( upload_source : ' file1 . txt ' ) do |res err| # process response for 1st call end # ... s . insert_item ( upload_source : ' fileN . txt ' ) do |res err| # process response for Nth call end end