Class: Files::SyncJob
- Inherits:
-
Object
- Object
- Files::SyncJob
- Defined in:
- lib/files.com/models/sync_job.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
- .all(params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: cursor - string - Used for pagination.
Instance Method Summary collapse
-
#folder_behavior_id ⇒ Object
int64 -.
-
#initialize(attributes = {}, options = {}) ⇒ SyncJob
constructor
A new instance of SyncJob.
-
#queued_at ⇒ Object
date-time - Job enqueued at.
-
#regional_worker_status ⇒ Object
string - Most recent reported status of sync worker.
-
#status ⇒ Object
string - Status of the job.
-
#updated_at ⇒ Object
date-time - Job updated at.
-
#uuid ⇒ Object
string -.
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 = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/sync_job.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/sync_job.rb', line 5 def @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 = {}, = {}) list(params, ) 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 = {}, = {}) 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, ) end end |
Instance Method Details
#folder_behavior_id ⇒ Object
int64 -
38 39 40 |
# File 'lib/files.com/models/sync_job.rb', line 38 def folder_behavior_id @attributes[:folder_behavior_id] end |
#queued_at ⇒ Object
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_status ⇒ Object
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 |
#status ⇒ Object
string - Status of the job
23 24 25 |
# File 'lib/files.com/models/sync_job.rb', line 23 def status @attributes[:status] end |
#updated_at ⇒ Object
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 |
#uuid ⇒ Object
string -
33 34 35 |
# File 'lib/files.com/models/sync_job.rb', line 33 def uuid @attributes[:uuid] end |