Sha256: 3a4a98a04648d13c70c678e1ece2e4f9d0da2bf80b860be28902d98f3327de91

Contents?: true

Size: 1.84 KB

Versions: 43

Compression:

Stored size: 1.84 KB

Contents

# frozen_string_literal: true

module Files
  class RegionalMigration
    attr_reader :options, :attributes

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

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

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

    # int64 - Total number of files
    def files_total
      @attributes[:files_total]
    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 - Region
    def region
      @attributes[:region]
    end

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

    # Parameters:
    #   page - integer - Current page number.
    #   per_page - integer - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
    #   action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
    def self.list(params = {}, options = {})
      raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer)
      raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)
      raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String)

      response, options = Api.send_request("/regional_migrations", :get, params, options)
      response.data.map { |object| RegionalMigration.new(object, options) }
    end

    def self.all(params = {}, options = {})
      list(params, options)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
files.com-1.0.29 lib/files.com/models/regional_migration.rb
files.com-1.0.28 lib/files.com/models/regional_migration.rb
files.com-1.0.27 lib/files.com/models/regional_migration.rb
files.com-1.0.26 lib/files.com/models/regional_migration.rb
files.com-1.0.25 lib/files.com/models/regional_migration.rb
files.com-1.0.24 lib/files.com/models/regional_migration.rb
files.com-1.0.23 lib/files.com/models/regional_migration.rb
files.com-1.0.22 lib/files.com/models/regional_migration.rb
files.com-1.0.21 lib/files.com/models/regional_migration.rb
files.com-1.0.20 lib/files.com/models/regional_migration.rb
files.com-1.0.19 lib/files.com/models/regional_migration.rb
files.com-1.0.18 lib/files.com/models/regional_migration.rb
files.com-1.0.17 lib/files.com/models/regional_migration.rb
files.com-1.0.16 lib/files.com/models/regional_migration.rb
files.com-1.0.15 lib/files.com/models/regional_migration.rb
files.com-1.0.14 lib/files.com/models/regional_migration.rb
files.com-1.0.13 lib/files.com/models/regional_migration.rb
files.com-1.0.12 lib/files.com/models/regional_migration.rb
files.com-1.0.11 lib/files.com/models/regional_migration.rb
files.com-1.0.10 lib/files.com/models/regional_migration.rb