Class: Files::UsageSnapshot

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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 = {}, 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/usage_snapshot.rb', line 5

def attributes
  @attributes
end

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

Class Method Details

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



99
100
101
# File 'lib/files.com/models/usage_snapshot.rb', line 99

def self.all(params = {}, options = {})
  list(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).


90
91
92
93
94
95
96
97
# File 'lib/files.com/models/usage_snapshot.rb', line 90

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)

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

Instance Method Details

#bytes_sentObject

double - Transfer Usage for period - Outbound GB from Files Native Storage



73
74
75
# File 'lib/files.com/models/usage_snapshot.rb', line 73

def bytes_sent
  @attributes[:bytes_sent]
end

#current_storageObject

double - Current total Storage Usage GB as of end date (not necessarily high water mark, which is used for billing)



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

def current_storage
  @attributes[:current_storage]
end

#deleted_files_counted_in_minimumObject

double - Storage Usage for files that are deleted but uploaded within last 30 days as of end date (not necessarily high water mark, which is used for billing)



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

def deleted_files_counted_in_minimum
  @attributes[:deleted_files_counted_in_minimum]
end

#deleted_files_storageObject

double - Storage Usage for files that are deleted but retained as backups as of end date (not necessarily high water mark, which is used for billing)



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

def deleted_files_storage
  @attributes[:deleted_files_storage]
end

#end_atObject

date-time - Usage snapshot 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_storageObject

double - Highest Storage Usage GB recorded in time period (used for billing)



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

def high_water_storage
  @attributes[:high_water_storage]
end

#high_water_user_countObject

double - Highest user count number in time period



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

def high_water_user_count
  @attributes[:high_water_user_count]
end

#idObject

int64 - Usage snapshot ID



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

def id
  @attributes[:id]
end

#root_storageObject

double - Storage Usage for root folder as of end date (not necessarily high water mark, which is used for billing)



48
49
50
# File 'lib/files.com/models/usage_snapshot.rb', line 48

def root_storage
  @attributes[:root_storage]
end

#start_atObject

date-time - Usage snapshot start date/time



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

def start_at
  @attributes[:start_at]
end

#sync_bytes_receivedObject

double - Transfer Usage for period - Inbound GB to Remote Servers (Sync/Mount)



78
79
80
# File 'lib/files.com/models/usage_snapshot.rb', line 78

def sync_bytes_received
  @attributes[:sync_bytes_received]
end

#sync_bytes_sentObject

double - Transfer Usage for period - Outbound GB from Remote Servers (Sync/Mount)



83
84
85
# File 'lib/files.com/models/usage_snapshot.rb', line 83

def sync_bytes_sent
  @attributes[:sync_bytes_sent]
end

#total_billable_transfer_usageObject

double - Transfer usage for period - Total Billable amount



68
69
70
# File 'lib/files.com/models/usage_snapshot.rb', line 68

def total_billable_transfer_usage
  @attributes[:total_billable_transfer_usage]
end

#total_billable_usageObject

double - Storage + Transfer Usage - Total Billable amount



63
64
65
# File 'lib/files.com/models/usage_snapshot.rb', line 63

def total_billable_usage
  @attributes[:total_billable_usage]
end

#usage_by_top_level_dirObject

object - Storage Usage - map of root folders to their usage as of end date (not necessarily high water mark, which is used for billing)



43
44
45
# File 'lib/files.com/models/usage_snapshot.rb', line 43

def usage_by_top_level_dir
  @attributes[:usage_by_top_level_dir]
end