Sha256: 96875e131f78478a2d2863d6753236405dfc402c768d73fd7cab0eefc7ed6d47

Contents?: true

Size: 1.9 KB

Versions: 266

Compression:

Stored size: 1.9 KB

Contents

# frozen_string_literal: true

module Files
  class FileMigration
    attr_reader :options, :attributes

    def initialize(attributes = {}, options = {})
      @attributes = attributes || {}
      @options = options || {}
    end

    # int64 - File migration ID
    def id
      @attributes[:id]
    end

    # string - Source path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
    def path
      @attributes[:path]
    end

    # string - Destination path
    def dest_path
      @attributes[:dest_path]
    end

    # int64 - Number of files processed
    def files_moved
      @attributes[:files_moved]
    end

    # int64 - Deprecated: used to return a count of the applicable files.  Currently returns 0 always.  On remote servers, it is not possible to reliably determine the number of affected files for every migration operation.
    def files_total
      @attributes[:files_total]
    end

    # string - The type of operation
    def operation
      @attributes[:operation]
    end

    # string - Region
    def region
      @attributes[:region]
    end

    # string - Status
    def status
      @attributes[:status]
    end

    # string - Link to download the log file for this migration.
    def log_url
      @attributes[:log_url]
    end

    # Parameters:
    #   id (required) - int64 - File Migration ID.
    def self.find(id, params = {}, options = {})
      params ||= {}
      params[:id] = id
      raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
      raise MissingParameterError.new("Parameter missing: id") unless params[:id]

      response, options = Api.send_request("/file_migrations/#{params[:id]}", :get, params, options)
      FileMigration.new(response.data, options)
    end

    def self.get(id, params = {}, options = {})
      find(id, params, options)
    end
  end
end

Version data entries

266 entries across 266 versions & 1 rubygems

Version Path
files.com-1.0.309 lib/files.com/models/file_migration.rb
files.com-1.0.308 lib/files.com/models/file_migration.rb
files.com-1.0.307 lib/files.com/models/file_migration.rb
files.com-1.0.306 lib/files.com/models/file_migration.rb
files.com-1.0.305 lib/files.com/models/file_migration.rb
files.com-1.0.304 lib/files.com/models/file_migration.rb