Class: Files::Sync

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Sync.



7
8
9
10
# File 'lib/files.com/models/sync.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.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

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



386
387
388
# File 'lib/files.com/models/sync.rb', line 386

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

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

Parameters:

delete_empty_folders - boolean - Delete empty folders after sync?
description - string - Description for this sync job
dest_path - string - Absolute destination path for the sync
dest_remote_server_id - int64 - Remote server ID for the destination (if remote)
disabled - boolean - Is this sync disabled?
exclude_patterns - array(string) - Array of glob patterns to exclude
holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
include_patterns - array(string) - Array of glob patterns to include
interval - string - If trigger is `daily`, this specifies how often to run this sync.  One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
keep_after_copy - boolean - Keep files after copying?
name - string - Name for this sync job
recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
src_path - string - Absolute source path for the sync
src_remote_server_id - int64 - Remote server ID for the source (if remote)
sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
trigger - string - Trigger type: daily, custom_schedule, or manual
trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.
workspace_id - int64 - Workspace ID this sync belongs to


428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
# File 'lib/files.com/models/sync.rb', line 428

def self.create(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: exclude_patterns must be an Array") if params[:exclude_patterns] and !params[:exclude_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: include_patterns must be an Array") if params[:include_patterns] and !params[:include_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sync_interval_minutes must be an Integer") if params[:sync_interval_minutes] and !params[:sync_interval_minutes].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: workspace_id must be an Integer") if params[:workspace_id] and !params[:workspace_id].is_a?(Integer)

  response, options = Api.send_request("/syncs", :post, params, options)
  Sync.new(response.data, options)
end

.delete(id, params = {}, options = {}) ⇒ Object



522
523
524
525
526
527
528
529
530
# File 'lib/files.com/models/sync.rb', line 522

def self.delete(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]

  Api.send_request("/syncs/#{params[:id]}", :delete, params, options)
  nil
end

.destroy(id, params = {}, options = {}) ⇒ Object



532
533
534
535
# File 'lib/files.com/models/sync.rb', line 532

def self.destroy(id, params = {}, options = {})
  delete(id, params, options)
  nil
end

.dry_run(id, params = {}, options = {}) ⇒ Object

Dry Run Sync



453
454
455
456
457
458
459
460
461
# File 'lib/files.com/models/sync.rb', line 453

def self.dry_run(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]

  Api.send_request("/syncs/#{params[:id]}/dry_run", :post, params, options)
  nil
end

.find(id, params = {}, options = {}) ⇒ Object

Parameters:

id (required) - int64 - Sync ID.


392
393
394
395
396
397
398
399
400
# File 'lib/files.com/models/sync.rb', line 392

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("/syncs/#{params[:id]}", :get, params, options)
  Sync.new(response.data, options)
end

.get(id, params = {}, options = {}) ⇒ Object



402
403
404
# File 'lib/files.com/models/sync.rb', line 402

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

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

Parameters:

cursor - string - Used for pagination.  When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`.  Send one of those cursor value here to resume an existing list from the next available record.  Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
per_page - int64 - Number of records to show per page.  (Max: 10,000, 1,000 or less is recommended).
sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id` or `name`.
filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `workspace_id`, `disabled`, `src_remote_server_id` or `dest_remote_server_id`. Valid field combinations are `[ workspace_id, disabled ]`, `[ workspace_id, src_remote_server_id ]`, `[ workspace_id, dest_remote_server_id ]`, `[ disabled, src_remote_server_id ]`, `[ disabled, dest_remote_server_id ]`, `[ workspace_id, disabled, src_remote_server_id ]` or `[ workspace_id, disabled, dest_remote_server_id ]`.


375
376
377
378
379
380
381
382
383
384
# File 'lib/files.com/models/sync.rb', line 375

def self.list(params = {}, options = {})
  raise InvalidParameterError.new("Bad parameter: cursor must be an String") if params[:cursor] and !params[:cursor].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params[:per_page] and !params[:per_page].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sort_by must be an Hash") if params[:sort_by] and !params[:sort_by].is_a?(Hash)
  raise InvalidParameterError.new("Bad parameter: filter must be an Hash") if params[:filter] and !params[:filter].is_a?(Hash)

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

.manual_run(id, params = {}, options = {}) ⇒ Object

Manually Run Sync



464
465
466
467
468
469
470
471
472
# File 'lib/files.com/models/sync.rb', line 464

def self.manual_run(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]

  Api.send_request("/syncs/#{params[:id]}/manual_run", :post, params, options)
  nil
end

.update(id, params = {}, options = {}) ⇒ Object

Parameters:

delete_empty_folders - boolean - Delete empty folders after sync?
description - string - Description for this sync job
dest_path - string - Absolute destination path for the sync
dest_remote_server_id - int64 - Remote server ID for the destination (if remote)
disabled - boolean - Is this sync disabled?
exclude_patterns - array(string) - Array of glob patterns to exclude
holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
include_patterns - array(string) - Array of glob patterns to include
interval - string - If trigger is `daily`, this specifies how often to run this sync.  One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
keep_after_copy - boolean - Keep files after copying?
name - string - Name for this sync job
recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
src_path - string - Absolute source path for the sync
src_remote_server_id - int64 - Remote server ID for the source (if remote)
sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
trigger - string - Trigger type: daily, custom_schedule, or manual
trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.


495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/files.com/models/sync.rb', line 495

def self.update(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 InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: exclude_patterns must be an Array") if params[:exclude_patterns] and !params[:exclude_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: include_patterns must be an Array") if params[:include_patterns] and !params[:include_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sync_interval_minutes must be an Integer") if params[:sync_interval_minutes] and !params[:sync_interval_minutes].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  response, options = Api.send_request("/syncs/#{params[:id]}", :patch, params, options)
  Sync.new(response.data, options)
end

Instance Method Details

#created_atObject

date-time - When this sync was created



193
194
195
# File 'lib/files.com/models/sync.rb', line 193

def created_at
  @attributes[:created_at]
end

#delete(params = {}) ⇒ Object



344
345
346
347
348
349
350
351
352
# File 'lib/files.com/models/sync.rb', line 344

def delete(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[: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]

  Api.send_request("/syncs/#{@attributes[:id]}", :delete, params, @options)
end

#delete_empty_foldersObject

boolean - Delete empty folders after sync?



139
140
141
# File 'lib/files.com/models/sync.rb', line 139

def delete_empty_folders
  @attributes[:delete_empty_folders]
end

#delete_empty_folders=(value) ⇒ Object



143
144
145
# File 'lib/files.com/models/sync.rb', line 143

def delete_empty_folders=(value)
  @attributes[:delete_empty_folders] = value
end

#descriptionObject

string - Description for this sync job



31
32
33
# File 'lib/files.com/models/sync.rb', line 31

def description
  @attributes[:description]
end

#description=(value) ⇒ Object



35
36
37
# File 'lib/files.com/models/sync.rb', line 35

def description=(value)
  @attributes[:description] = value
end

#dest_pathObject

string - Absolute destination path for the sync



76
77
78
# File 'lib/files.com/models/sync.rb', line 76

def dest_path
  @attributes[:dest_path]
end

#dest_path=(value) ⇒ Object



80
81
82
# File 'lib/files.com/models/sync.rb', line 80

def dest_path=(value)
  @attributes[:dest_path] = value
end

#dest_remote_server_idObject

int64 - Remote server ID for the destination (if remote)



94
95
96
# File 'lib/files.com/models/sync.rb', line 94

def dest_remote_server_id
  @attributes[:dest_remote_server_id]
end

#dest_remote_server_id=(value) ⇒ Object



98
99
100
# File 'lib/files.com/models/sync.rb', line 98

def dest_remote_server_id=(value)
  @attributes[:dest_remote_server_id] = value
end

#dest_site_idObject

int64 - Destination site ID if syncing to a child or partner site



112
113
114
# File 'lib/files.com/models/sync.rb', line 112

def dest_site_id
  @attributes[:dest_site_id]
end

#dest_site_id=(value) ⇒ Object



116
117
118
# File 'lib/files.com/models/sync.rb', line 116

def dest_site_id=(value)
  @attributes[:dest_site_id] = value
end

#destroy(params = {}) ⇒ Object



354
355
356
357
# File 'lib/files.com/models/sync.rb', line 354

def destroy(params = {})
  delete(params)
  nil
end

#disabledObject

boolean - Is this sync disabled?



148
149
150
# File 'lib/files.com/models/sync.rb', line 148

def disabled
  @attributes[:disabled]
end

#disabled=(value) ⇒ Object



152
153
154
# File 'lib/files.com/models/sync.rb', line 152

def disabled=(value)
  @attributes[:disabled] = value
end

#dry_run(params = {}) ⇒ Object

Dry Run Sync



275
276
277
278
279
280
281
282
283
# File 'lib/files.com/models/sync.rb', line 275

def dry_run(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[: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]

  Api.send_request("/syncs/#{@attributes[:id]}/dry_run", :post, params, @options)
end

#exclude_patternsObject

array(string) - Array of glob patterns to exclude



184
185
186
# File 'lib/files.com/models/sync.rb', line 184

def exclude_patterns
  @attributes[:exclude_patterns]
end

#exclude_patterns=(value) ⇒ Object



188
189
190
# File 'lib/files.com/models/sync.rb', line 188

def exclude_patterns=(value)
  @attributes[:exclude_patterns] = value
end

#holiday_regionObject

string - If trigger is ‘custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.



257
258
259
# File 'lib/files.com/models/sync.rb', line 257

def holiday_region
  @attributes[:holiday_region]
end

#holiday_region=(value) ⇒ Object



261
262
263
# File 'lib/files.com/models/sync.rb', line 261

def holiday_region=(value)
  @attributes[:holiday_region] = value
end

#idObject

int64 - Sync ID



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

def id
  @attributes[:id]
end

#id=(value) ⇒ Object



17
18
19
# File 'lib/files.com/models/sync.rb', line 17

def id=(value)
  @attributes[:id] = value
end

#include_patternsObject

array(string) - Array of glob patterns to include



175
176
177
# File 'lib/files.com/models/sync.rb', line 175

def include_patterns
  @attributes[:include_patterns]
end

#include_patterns=(value) ⇒ Object



179
180
181
# File 'lib/files.com/models/sync.rb', line 179

def include_patterns=(value)
  @attributes[:include_patterns] = value
end

#intervalObject

string - If trigger is ‘daily`, this specifies how often to run this sync. One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`



212
213
214
# File 'lib/files.com/models/sync.rb', line 212

def interval
  @attributes[:interval]
end

#interval=(value) ⇒ Object



216
217
218
# File 'lib/files.com/models/sync.rb', line 216

def interval=(value)
  @attributes[:interval] = value
end

#keep_after_copyObject

boolean - Keep files after copying?



130
131
132
# File 'lib/files.com/models/sync.rb', line 130

def keep_after_copy
  @attributes[:keep_after_copy]
end

#keep_after_copy=(value) ⇒ Object



134
135
136
# File 'lib/files.com/models/sync.rb', line 134

def keep_after_copy=(value)
  @attributes[:keep_after_copy] = value
end

#latest_sync_runObject

SyncRun - The latest run of this sync



266
267
268
# File 'lib/files.com/models/sync.rb', line 266

def latest_sync_run
  @attributes[:latest_sync_run]
end

#latest_sync_run=(value) ⇒ Object



270
271
272
# File 'lib/files.com/models/sync.rb', line 270

def latest_sync_run=(value)
  @attributes[:latest_sync_run] = value
end

#manual_run(params = {}) ⇒ Object

Manually Run Sync



286
287
288
289
290
291
292
293
294
# File 'lib/files.com/models/sync.rb', line 286

def manual_run(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[: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]

  Api.send_request("/syncs/#{@attributes[:id]}/manual_run", :post, params, @options)
end

#nameObject

string - Name for this sync job



22
23
24
# File 'lib/files.com/models/sync.rb', line 22

def name
  @attributes[:name]
end

#name=(value) ⇒ Object



26
27
28
# File 'lib/files.com/models/sync.rb', line 26

def name=(value)
  @attributes[:name] = value
end

#recurring_dayObject

int64 - If trigger type is ‘daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.



221
222
223
# File 'lib/files.com/models/sync.rb', line 221

def recurring_day
  @attributes[:recurring_day]
end

#recurring_day=(value) ⇒ Object



225
226
227
# File 'lib/files.com/models/sync.rb', line 225

def recurring_day=(value)
  @attributes[:recurring_day] = value
end

#saveObject



359
360
361
362
363
364
365
366
367
368
# File 'lib/files.com/models/sync.rb', line 359

def save
  if @attributes[:id]
    new_obj = update(@attributes)
  else
    new_obj = Sync.create(@attributes, @options)
  end

  @attributes = new_obj.attributes
  true
end

#schedule_days_of_weekObject

array(int64) - If trigger is ‘custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.



230
231
232
# File 'lib/files.com/models/sync.rb', line 230

def schedule_days_of_week
  @attributes[:schedule_days_of_week]
end

#schedule_days_of_week=(value) ⇒ Object



234
235
236
# File 'lib/files.com/models/sync.rb', line 234

def schedule_days_of_week=(value)
  @attributes[:schedule_days_of_week] = value
end

#schedule_time_zoneObject

string - If trigger is ‘custom_schedule`, Custom schedule Time Zone for when the sync should be run.



248
249
250
# File 'lib/files.com/models/sync.rb', line 248

def schedule_time_zone
  @attributes[:schedule_time_zone]
end

#schedule_time_zone=(value) ⇒ Object



252
253
254
# File 'lib/files.com/models/sync.rb', line 252

def schedule_time_zone=(value)
  @attributes[:schedule_time_zone] = value
end

#schedule_times_of_dayObject

array(string) - If trigger is ‘custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.



239
240
241
# File 'lib/files.com/models/sync.rb', line 239

def schedule_times_of_day
  @attributes[:schedule_times_of_day]
end

#schedule_times_of_day=(value) ⇒ Object



243
244
245
# File 'lib/files.com/models/sync.rb', line 243

def schedule_times_of_day=(value)
  @attributes[:schedule_times_of_day] = value
end

#site_idObject

int64 - Site ID this sync belongs to



40
41
42
# File 'lib/files.com/models/sync.rb', line 40

def site_id
  @attributes[:site_id]
end

#site_id=(value) ⇒ Object



44
45
46
# File 'lib/files.com/models/sync.rb', line 44

def site_id=(value)
  @attributes[:site_id] = value
end

#src_pathObject

string - Absolute source path for the sync



67
68
69
# File 'lib/files.com/models/sync.rb', line 67

def src_path
  @attributes[:src_path]
end

#src_path=(value) ⇒ Object



71
72
73
# File 'lib/files.com/models/sync.rb', line 71

def src_path=(value)
  @attributes[:src_path] = value
end

#src_remote_server_idObject

int64 - Remote server ID for the source (if remote)



85
86
87
# File 'lib/files.com/models/sync.rb', line 85

def src_remote_server_id
  @attributes[:src_remote_server_id]
end

#src_remote_server_id=(value) ⇒ Object



89
90
91
# File 'lib/files.com/models/sync.rb', line 89

def src_remote_server_id=(value)
  @attributes[:src_remote_server_id] = value
end

#src_site_idObject

int64 - Source site ID if syncing from a child or partner site



103
104
105
# File 'lib/files.com/models/sync.rb', line 103

def src_site_id
  @attributes[:src_site_id]
end

#src_site_id=(value) ⇒ Object



107
108
109
# File 'lib/files.com/models/sync.rb', line 107

def src_site_id=(value)
  @attributes[:src_site_id] = value
end

#sync_interval_minutesObject

int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the ‘remote_sync_interval` value for the site’s plan. If left blank, the plan’s ‘remote_sync_interval` will be used. This setting is only used if `trigger` is empty.



203
204
205
# File 'lib/files.com/models/sync.rb', line 203

def sync_interval_minutes
  @attributes[:sync_interval_minutes]
end

#sync_interval_minutes=(value) ⇒ Object



207
208
209
# File 'lib/files.com/models/sync.rb', line 207

def sync_interval_minutes=(value)
  @attributes[:sync_interval_minutes] = value
end

#triggerObject

string - Trigger type: daily, custom_schedule, or manual



157
158
159
# File 'lib/files.com/models/sync.rb', line 157

def trigger
  @attributes[:trigger]
end

#trigger=(value) ⇒ Object



161
162
163
# File 'lib/files.com/models/sync.rb', line 161

def trigger=(value)
  @attributes[:trigger] = value
end

#trigger_fileObject

string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.



166
167
168
# File 'lib/files.com/models/sync.rb', line 166

def trigger_file
  @attributes[:trigger_file]
end

#trigger_file=(value) ⇒ Object



170
171
172
# File 'lib/files.com/models/sync.rb', line 170

def trigger_file=(value)
  @attributes[:trigger_file] = value
end

#two_wayObject

boolean - Is this a two-way sync?



121
122
123
# File 'lib/files.com/models/sync.rb', line 121

def two_way
  @attributes[:two_way]
end

#two_way=(value) ⇒ Object



125
126
127
# File 'lib/files.com/models/sync.rb', line 125

def two_way=(value)
  @attributes[:two_way] = value
end

#update(params = {}) ⇒ Object

Parameters:

delete_empty_folders - boolean - Delete empty folders after sync?
description - string - Description for this sync job
dest_path - string - Absolute destination path for the sync
dest_remote_server_id - int64 - Remote server ID for the destination (if remote)
disabled - boolean - Is this sync disabled?
exclude_patterns - array(string) - Array of glob patterns to exclude
holiday_region - string - If trigger is `custom_schedule`, the sync will check if there is a formal, observed holiday for the region, and if so, it will not run.
include_patterns - array(string) - Array of glob patterns to include
interval - string - If trigger is `daily`, this specifies how often to run this sync.  One of: `day`, `week`, `week_end`, `month`, `month_end`, `quarter`, `quarter_end`, `year`, `year_end`
keep_after_copy - boolean - Keep files after copying?
name - string - Name for this sync job
recurring_day - int64 - If trigger type is `daily`, this specifies a day number to run in one of the supported intervals: `week`, `month`, `quarter`, `year`.
schedule_days_of_week - array(int64) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
schedule_time_zone - string - If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
schedule_times_of_day - array(string) - If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
src_path - string - Absolute source path for the sync
src_remote_server_id - int64 - Remote server ID for the source (if remote)
sync_interval_minutes - int64 - Frequency in minutes between syncs. If set, this value must be greater than or equal to the `remote_sync_interval` value for the site's plan. If left blank, the plan's `remote_sync_interval` will be used. This setting is only used if `trigger` is empty.
trigger - string - Trigger type: daily, custom_schedule, or manual
trigger_file - string - Some MFT services request an empty file (known as a trigger file) to signal the sync is complete and they can begin further processing. If trigger_file is set, a zero-byte file will be sent at the end of the sync.


317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/files.com/models/sync.rb', line 317

def update(params = {})
  params ||= {}
  params[:id] = @attributes[:id]
  raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id]
  raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params[:id] and !params[:id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: description must be an String") if params[:description] and !params[:description].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_path must be an String") if params[:dest_path] and !params[:dest_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: dest_remote_server_id must be an Integer") if params[:dest_remote_server_id] and !params[:dest_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: exclude_patterns must be an Array") if params[:exclude_patterns] and !params[:exclude_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: holiday_region must be an String") if params[:holiday_region] and !params[:holiday_region].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: include_patterns must be an Array") if params[:include_patterns] and !params[:include_patterns].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: interval must be an String") if params[:interval] and !params[:interval].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: name must be an String") if params[:name] and !params[:name].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: recurring_day must be an Integer") if params[:recurring_day] and !params[:recurring_day].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: schedule_days_of_week must be an Array") if params[:schedule_days_of_week] and !params[:schedule_days_of_week].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: schedule_time_zone must be an String") if params[:schedule_time_zone] and !params[:schedule_time_zone].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: schedule_times_of_day must be an Array") if params[:schedule_times_of_day] and !params[:schedule_times_of_day].is_a?(Array)
  raise InvalidParameterError.new("Bad parameter: src_path must be an String") if params[:src_path] and !params[:src_path].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: src_remote_server_id must be an Integer") if params[:src_remote_server_id] and !params[:src_remote_server_id].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: sync_interval_minutes must be an Integer") if params[:sync_interval_minutes] and !params[:sync_interval_minutes].is_a?(Integer)
  raise InvalidParameterError.new("Bad parameter: trigger must be an String") if params[:trigger] and !params[:trigger].is_a?(String)
  raise InvalidParameterError.new("Bad parameter: trigger_file must be an String") if params[:trigger_file] and !params[:trigger_file].is_a?(String)
  raise MissingParameterError.new("Parameter missing: id") unless params[:id]

  Api.send_request("/syncs/#{@attributes[:id]}", :patch, params, @options)
end

#updated_atObject

date-time - When this sync was last updated



198
199
200
# File 'lib/files.com/models/sync.rb', line 198

def updated_at
  @attributes[:updated_at]
end

#user_idObject

int64 - User who created or owns this sync



58
59
60
# File 'lib/files.com/models/sync.rb', line 58

def user_id
  @attributes[:user_id]
end

#user_id=(value) ⇒ Object



62
63
64
# File 'lib/files.com/models/sync.rb', line 62

def user_id=(value)
  @attributes[:user_id] = value
end

#workspace_idObject

int64 - Workspace ID this sync belongs to



49
50
51
# File 'lib/files.com/models/sync.rb', line 49

def workspace_id
  @attributes[:workspace_id]
end

#workspace_id=(value) ⇒ Object



53
54
55
# File 'lib/files.com/models/sync.rb', line 53

def workspace_id=(value)
  @attributes[:workspace_id] = value
end