Class: Files::FileMigration
- Inherits:
-
Object
- Object
- Files::FileMigration
- Defined in:
- lib/files.com/models/file_migration.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
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - int64 - File Migration ID.
- .get(id, params = {}, options = {}) ⇒ Object
Instance Method Summary collapse
-
#dest_path ⇒ Object
string - Destination path.
-
#files_moved ⇒ Object
int64 - Number of files processed.
-
#files_total ⇒ Object
int64 - Total number of files to process.
-
#id ⇒ Object
int64 - File migration ID.
-
#initialize(attributes = {}, options = {}) ⇒ FileMigration
constructor
A new instance of FileMigration.
-
#log_url ⇒ Object
string - Link to download the log file for this migration.
-
#operation ⇒ Object
string - The type of operation.
-
#path ⇒ Object
string - Source path This must be slash-delimited, but it must neither start nor end with a slash.
-
#region ⇒ Object
string - Region.
-
#status ⇒ Object
string - Status.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ FileMigration
Returns a new instance of FileMigration.
7 8 9 10 |
# File 'lib/files.com/models/file_migration.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/file_migration.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/file_migration.rb', line 5 def @options end |
Class Method Details
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - int64 - File Migration ID.
59 60 61 62 63 64 65 66 67 |
# File 'lib/files.com/models/file_migration.rb', line 59 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/file_migrations/#{params[:id]}", :get, params, ) FileMigration.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
69 70 71 |
# File 'lib/files.com/models/file_migration.rb', line 69 def self.get(id, params = {}, = {}) find(id, params, ) end |
Instance Method Details
#dest_path ⇒ Object
string - Destination path
23 24 25 |
# File 'lib/files.com/models/file_migration.rb', line 23 def dest_path @attributes[:dest_path] end |
#files_moved ⇒ Object
int64 - Number of files processed
28 29 30 |
# File 'lib/files.com/models/file_migration.rb', line 28 def files_moved @attributes[:files_moved] end |
#files_total ⇒ Object
int64 - Total number of files to process
33 34 35 |
# File 'lib/files.com/models/file_migration.rb', line 33 def files_total @attributes[:files_total] end |
#id ⇒ Object
int64 - File migration ID
13 14 15 |
# File 'lib/files.com/models/file_migration.rb', line 13 def id @attributes[:id] end |
#log_url ⇒ Object
string - Link to download the log file for this migration.
53 54 55 |
# File 'lib/files.com/models/file_migration.rb', line 53 def log_url @attributes[:log_url] end |
#operation ⇒ Object
string - The type of operation
38 39 40 |
# File 'lib/files.com/models/file_migration.rb', line 38 def operation @attributes[:operation] end |
#path ⇒ Object
string - Source path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
18 19 20 |
# File 'lib/files.com/models/file_migration.rb', line 18 def path @attributes[:path] end |
#region ⇒ Object
string - Region
43 44 45 |
# File 'lib/files.com/models/file_migration.rb', line 43 def region @attributes[:region] end |
#status ⇒ Object
string - Status
48 49 50 |
# File 'lib/files.com/models/file_migration.rb', line 48 def status @attributes[:status] end |