class Twilio::REST::Preview::Wireless::SimContext::UsageInstance

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.

Public Class Methods

new(version, payload, sim_sid: nil) click to toggle source

Initialize the UsageInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sim_sid The sim_sid @return [UsageInstance] UsageInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
120 def initialize(version, payload, sim_sid: nil)
121   super(version)
122 
123   # Marshaled Properties
124   @properties = {
125       'sim_sid' => payload['sim_sid'],
126       'sim_unique_name' => payload['sim_unique_name'],
127       'account_sid' => payload['account_sid'],
128       'period' => payload['period'],
129       'commands_usage' => payload['commands_usage'],
130       'commands_costs' => payload['commands_costs'],
131       'data_usage' => payload['data_usage'],
132       'data_costs' => payload['data_costs'],
133       'url' => payload['url'],
134   }
135 
136   # Context
137   @instance_context = nil
138   @params = {'sim_sid' => sim_sid, }
139 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The account_sid

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
166 def account_sid
167   @properties['account_sid']
168 end
commands_costs() click to toggle source

@return [Hash] The commands_costs

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
184 def commands_costs
185   @properties['commands_costs']
186 end
commands_usage() click to toggle source

@return [Hash] The commands_usage

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
178 def commands_usage
179   @properties['commands_usage']
180 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [UsageContext] UsageContext for this UsageInstance

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
145 def context
146   unless @instance_context
147     @instance_context = UsageContext.new(@version, @params['sim_sid'], )
148   end
149   @instance_context
150 end
data_costs() click to toggle source

@return [Hash] The data_costs

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
196 def data_costs
197   @properties['data_costs']
198 end
data_usage() click to toggle source

@return [Hash] The data_usage

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
190 def data_usage
191   @properties['data_usage']
192 end
fetch(end_: :unset, start: :unset) click to toggle source

Fetch the UsageInstance @param [String] end_ The end @param [String] start The start @return [UsageInstance] Fetched UsageInstance

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
211 def fetch(end_: :unset, start: :unset)
212   context.fetch(end_: end_, start: start, )
213 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
224 def inspect
225   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
226   "<Twilio.Preview.Wireless.UsageInstance #{values}>"
227 end
period() click to toggle source

@return [Hash] The period

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
172 def period
173   @properties['period']
174 end
sim_sid() click to toggle source

@return [String] The sim_sid

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
154 def sim_sid
155   @properties['sim_sid']
156 end
sim_unique_name() click to toggle source

@return [String] The sim_unique_name

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
160 def sim_unique_name
161   @properties['sim_unique_name']
162 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
217 def to_s
218   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
219   "<Twilio.Preview.Wireless.UsageInstance #{values}>"
220 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/wireless/sim/usage.rb
202 def url
203   @properties['url']
204 end