Class: Files::SyncJob

Inherits:
Object
  • Object
show all
Defined in:
lib/files.com/models/sync_job.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}, options = {}) ⇒ SyncJob

Returns a new instance of SyncJob.



7
8
9
10
# File 'lib/files.com/models/sync_job.rb', line 7

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



5
6
7
# File 'lib/files.com/models/sync_job.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/files.com/models/sync_job.rb', line 5

def options
  @options
end

Class Method Details

.all(params = {}, options = {}) ⇒ Object



54
55
56
# File 'lib/files.com/models/sync_job.rb', line 54

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

.list(params = {}, options = {}) ⇒ Object

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 either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).


45
46
47
48
49
50
51
52
# File 'lib/files.com/models/sync_job.rb', line 45

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

Instance Method Details

#folder_behavior_idObject

int64 -



38
39
40
# File 'lib/files.com/models/sync_job.rb', line 38

def folder_behavior_id
  @attributes[:folder_behavior_id]
end

#queued_atObject

date-time - Job enqueued at



13
14
15
# File 'lib/files.com/models/sync_job.rb', line 13

def queued_at
  @attributes[:queued_at]
end

#regional_worker_statusObject

string - Most recent reported status of sync worker



28
29
30
# File 'lib/files.com/models/sync_job.rb', line 28

def regional_worker_status
  @attributes[:regional_worker_status]
end

#statusObject

string - Status of the job



23
24
25
# File 'lib/files.com/models/sync_job.rb', line 23

def status
  @attributes[:status]
end

#updated_atObject

date-time - Job updated at



18
19
20
# File 'lib/files.com/models/sync_job.rb', line 18

def updated_at
  @attributes[:updated_at]
end

#uuidObject

string -



33
34
35
# File 'lib/files.com/models/sync_job.rb', line 33

def uuid
  @attributes[:uuid]
end