Sha256: 5b4f1d1cd89ad0bc3759b3316499995d7d20899b2eabefac41c6c68a3247283b

Contents?: true

Size: 1.62 KB

Versions: 69

Compression:

Stored size: 1.62 KB

Contents

# frozen_string_literal: true

module Files
  class SyncJob
    attr_reader :options, :attributes

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

    # date-time - Job enqueued at
    def queued_at
      @attributes[:queued_at]
    end

    # date-time - Job updated at
    def updated_at
      @attributes[:updated_at]
    end

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

    # string - Most recent reported status of sync worker
    def regional_worker_status
      @attributes[:regional_worker_status]
    end

    # string -
    def uuid
      @attributes[:uuid]
    end

    # int64 -
    def folder_behavior_id
      @attributes[:folder_behavior_id]
    end

    # Parameters:
    #   cursor - string - Used for pagination.  Send a cursor value to resume an existing list from the point at which you left off.  Get a cursor from an existing list via the X-Files-Cursor-Next header.
    #   per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
    def self.list(params = {}, options = {})
      raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params.dig(:cursor) and !params.dig(:cursor).is_a?(String)
      raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer)

      List.new(SyncJob, params) do
        Api.send_request("/sync_jobs", :get, params, options)
      end
    end

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

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
files.com-1.0.228 lib/files.com/models/sync_job.rb
files.com-1.0.227 lib/files.com/models/sync_job.rb
files.com-1.0.226 lib/files.com/models/sync_job.rb
files.com-1.0.225 lib/files.com/models/sync_job.rb
files.com-1.0.224 lib/files.com/models/sync_job.rb
files.com-1.0.223 lib/files.com/models/sync_job.rb
files.com-1.0.222 lib/files.com/models/sync_job.rb
files.com-1.0.221 lib/files.com/models/sync_job.rb
files.com-1.0.220 lib/files.com/models/sync_job.rb
files.com-1.0.219 lib/files.com/models/sync_job.rb
files.com-1.0.218 lib/files.com/models/sync_job.rb
files.com-1.0.217 lib/files.com/models/sync_job.rb
files.com-1.0.216 lib/files.com/models/sync_job.rb
files.com-1.0.215 lib/files.com/models/sync_job.rb
files.com-1.0.214 lib/files.com/models/sync_job.rb
files.com-1.0.213 lib/files.com/models/sync_job.rb
files.com-1.0.212 lib/files.com/models/sync_job.rb
files.com-1.0.211 lib/files.com/models/sync_job.rb
files.com-1.0.210 lib/files.com/models/sync_job.rb
files.com-1.0.209 lib/files.com/models/sync_job.rb