class Beaver::BillingStatement

BillingStatement Model.

Attributes

amount[RW]

Owner structure to be used in any resource where an account is the owner @return [Integer]

api_version[RW]

Owner structure to be used in any resource where an account is the owner @return [String]

create_time[RW]

Owner structure to be used in any resource where an account is the owner @return [Integer]

currency[RW]

Owner structure to be used in any resource where an account is the owner @return [CurrencyEnum]

id[RW]

TODO: Write general description for this method @return [String]

month[RW]

Owner structure to be used in any resource where an account is the owner @return [Integer]

owner[RW]

Owner structure to be used in any resource where an account is the owner @return [OwnerIsAccount]

path[RW]

TODO: Write general description for this method @return [String]

resource[RW]

TODO: Write general description for this method @return [String]

year[RW]

Owner structure to be used in any resource where an account is the owner @return [Integer]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/beaver/models/billing_statement.rb, line 88
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  resource = hash['resource']
  path = hash['path']
  owner = OwnerIsAccount.from_hash(hash['owner']) if hash['owner']
  create_time = hash['create_time']
  amount = hash['amount']
  currency = hash['currency']
  month = hash['month']
  year = hash['year']
  api_version = hash['api_version']

  # Create object from extracted values.
  BillingStatement.new(id,
                       resource,
                       path,
                       owner,
                       create_time,
                       amount,
                       currency,
                       month,
                       year,
                       api_version)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/beaver/models/billing_statement.rb, line 50
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['resource'] = 'resource'
  @_hash['path'] = 'path'
  @_hash['owner'] = 'owner'
  @_hash['create_time'] = 'create_time'
  @_hash['amount'] = 'amount'
  @_hash['currency'] = 'currency'
  @_hash['month'] = 'month'
  @_hash['year'] = 'year'
  @_hash['api_version'] = 'api_version'
  @_hash
end
new(id = nil, resource = nil, path = nil, owner = nil, create_time = nil, amount = nil, currency = nil, month = nil, year = nil, api_version = nil) click to toggle source
# File lib/beaver/models/billing_statement.rb, line 65
def initialize(id = nil,
               resource = nil,
               path = nil,
               owner = nil,
               create_time = nil,
               amount = nil,
               currency = nil,
               month = nil,
               year = nil,
               api_version = nil)
  @id = id
  @resource = resource
  @path = path
  @owner = owner
  @create_time = create_time
  @amount = amount
  @currency = currency
  @month = month
  @year = year
  @api_version = api_version
end