Class: Twilio::REST::Api::V2010::AccountContext::BalanceInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/balance.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil) ⇒ BalanceInstance

Initialize the BalanceInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil) —

    The SID of the Account that created this Balance resource.

  • sid (String) —

    The SID of the Call resource to fetch.



129
130
131
132
133
134
135
136
137
138
139
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 129

def initialize(version, payload , account_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'balance' => payload['balance'],
        'currency' => payload['currency'],
    }
end

Instance Method Details

#account_sid ⇒ String

Returns The unique SID identifier of the Account.

Returns:

  • (String) —

    The unique SID identifier of the Account.



144
145
146
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 144

def 
    @properties['account_sid']
end

#balance ⇒ String

Returns The balance of the Account, in units specified by the unit parameter. Balance changes may not be reflected immediately. Child accounts do not contain balance information.

Returns:

  • (String) —

    The balance of the Account, in units specified by the unit parameter. Balance changes may not be reflected immediately. Child accounts do not contain balance information



150
151
152
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 150

def balance
    @properties['balance']
end

#currency ⇒ String

Returns The units of currency for the account balance.

Returns:

  • (String) —

    The units of currency for the account balance



156
157
158
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 156

def currency
    @properties['currency']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



168
169
170
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 168

def inspect
    "<Twilio.Api.V2010.BalanceInstance>"
end

#to_s ⇒ Object

Provide a user friendly representation



162
163
164
# File 'lib/twilio-ruby/rest/api/v2010/account/balance.rb', line 162

def to_s
    "<Twilio.Api.V2010.BalanceInstance>"
end