Class: DropboxApi::Results::RelocationBatchResult

Inherits:
Base
  • Object
show all
Defined in:
lib/dropbox_api/results/relocation_batch_result.rb

Overview

Result returned by Client#copy_batch or Client#move_batch that may either launch an asynchronous job or complete synchronously.

The value will be either :in_progress or a list of job statuses.

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DropboxApi::Results::Base

Class Method Details

.new(result_data) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/dropbox_api/results/relocation_batch_result.rb', line 7

def self.new(result_data)
  case result_data[".tag"]
  when "in_progress"
    :in_progress
  when "complete"
    result_data["entries"].map do |entry|
      DropboxApi::Results::RelocationBatchResultEntry.new(entry)
    end
  else
    raise NotImplementedError, "Unknown result type: #{result_data['.tag']}"
  end
end