Class: Files::UsageSnapshot
- Inherits:
-
Object
- Object
- Files::UsageSnapshot
- Defined in:
- lib/files.com/models/usage_snapshot.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: page - int64 - Current page number.
Instance Method Summary collapse
-
#created_at ⇒ Object
date-time - Site usage report created at date/time.
-
#current_storage ⇒ Object
double - Current site usage as of report.
-
#deleted_files_counted_in_minimum ⇒ Object
double - Usage for files that are deleted but uploaded within last 30 days.
-
#deleted_files_storage ⇒ Object
double - Usage for files that are deleted but retained as backups.
-
#end_at ⇒ Object
date-time - Site usage report end date/time.
-
#high_water_storage ⇒ Object
double - Site usage report highest usage in time period.
-
#id ⇒ Object
int64 - Site usage ID.
-
#initialize(attributes = {}, options = {}) ⇒ UsageSnapshot
constructor
A new instance of UsageSnapshot.
-
#root_storage ⇒ Object
double - Usage for root folder.
-
#start_at ⇒ Object
date-time - Site usage report start date/time.
-
#total_downloads ⇒ Object
int64 - Number of downloads in report time period.
-
#total_uploads ⇒ Object
int64 - Number of uploads in time period.
-
#updated_at ⇒ Object
date-time - The last time this site usage report was updated.
-
#usage_by_top_level_dir ⇒ Object
object - A map of root folders to their total usage.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ UsageSnapshot
Returns a new instance of UsageSnapshot.
7 8 9 10 |
# File 'lib/files.com/models/usage_snapshot.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/usage_snapshot.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/usage_snapshot.rb', line 5 def @options end |
Class Method Details
.all(params = {}, options = {}) ⇒ Object
92 93 94 |
# File 'lib/files.com/models/usage_snapshot.rb', line 92 def self.all(params = {}, = {}) list(params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
page - int64 - Current page number.
per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
81 82 83 84 85 86 87 88 89 90 |
# File 'lib/files.com/models/usage_snapshot.rb', line 81 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String) response, = Api.send_request("/usage_snapshots", :get, params, ) response.data.map do |entity_data| UsageSnapshot.new(entity_data, ) end end |
Instance Method Details
#created_at ⇒ Object
date-time - Site usage report created at date/time
28 29 30 |
# File 'lib/files.com/models/usage_snapshot.rb', line 28 def created_at @attributes[:created_at] end |
#current_storage ⇒ Object
double - Current site usage as of report
33 34 35 |
# File 'lib/files.com/models/usage_snapshot.rb', line 33 def current_storage @attributes[:current_storage] end |
#deleted_files_counted_in_minimum ⇒ Object
double - Usage for files that are deleted but uploaded within last 30 days
68 69 70 |
# File 'lib/files.com/models/usage_snapshot.rb', line 68 def deleted_files_counted_in_minimum @attributes[:deleted_files_counted_in_minimum] end |
#deleted_files_storage ⇒ Object
double - Usage for files that are deleted but retained as backups
73 74 75 |
# File 'lib/files.com/models/usage_snapshot.rb', line 73 def deleted_files_storage @attributes[:deleted_files_storage] end |
#end_at ⇒ Object
date-time - Site usage report end date/time
23 24 25 |
# File 'lib/files.com/models/usage_snapshot.rb', line 23 def end_at @attributes[:end_at] end |
#high_water_storage ⇒ Object
double - Site usage report highest usage in time period
38 39 40 |
# File 'lib/files.com/models/usage_snapshot.rb', line 38 def high_water_storage @attributes[:high_water_storage] end |
#id ⇒ Object
int64 - Site usage ID
13 14 15 |
# File 'lib/files.com/models/usage_snapshot.rb', line 13 def id @attributes[:id] end |
#root_storage ⇒ Object
double - Usage for root folder
63 64 65 |
# File 'lib/files.com/models/usage_snapshot.rb', line 63 def root_storage @attributes[:root_storage] end |
#start_at ⇒ Object
date-time - Site usage report start date/time
18 19 20 |
# File 'lib/files.com/models/usage_snapshot.rb', line 18 def start_at @attributes[:start_at] end |
#total_downloads ⇒ Object
int64 - Number of downloads in report time period
43 44 45 |
# File 'lib/files.com/models/usage_snapshot.rb', line 43 def total_downloads @attributes[:total_downloads] end |
#total_uploads ⇒ Object
int64 - Number of uploads in time period
48 49 50 |
# File 'lib/files.com/models/usage_snapshot.rb', line 48 def total_uploads @attributes[:total_uploads] end |
#updated_at ⇒ Object
date-time - The last time this site usage report was updated
53 54 55 |
# File 'lib/files.com/models/usage_snapshot.rb', line 53 def updated_at @attributes[:updated_at] end |
#usage_by_top_level_dir ⇒ Object
object - A map of root folders to their total usage
58 59 60 |
# File 'lib/files.com/models/usage_snapshot.rb', line 58 def usage_by_top_level_dir @attributes[:usage_by_top_level_dir] end |