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

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, sid) click to toggle source

Initialize the SimContext @param [Version] version Version that contains the resource @param [String] sid The sid @return [SimContext] SimContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
189 def initialize(version, sid)
190   super(version)
191 
192   # Path Solution
193   @solution = {sid: sid, }
194   @uri = "/Sims/#{@solution[:sid]}"
195 
196   # Dependents
197   @usage = nil
198 end

Public Instance Methods

fetch() click to toggle source

Fetch the SimInstance @return [SimInstance] Fetched SimInstance

    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
203 def fetch
204   payload = @version.fetch('GET', @uri)
205 
206   SimInstance.new(@version, payload, sid: @solution[:sid], )
207 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
270 def inspect
271   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
272   "#<Twilio.Preview.Wireless.SimContext #{context}>"
273 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
263 def to_s
264   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
265   "#<Twilio.Preview.Wireless.SimContext #{context}>"
266 end
update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset) click to toggle source

Update the SimInstance @param [String] unique_name The unique_name @param [String] callback_method The callback_method @param [String] callback_url The callback_url @param [String] friendly_name The friendly_name @param [String] rate_plan The rate_plan @param [String] status The status @param [String] commands_callback_method The commands_callback_method @param [String] commands_callback_url The commands_callback_url @param [String] sms_fallback_method The sms_fallback_method @param [String] sms_fallback_url The sms_fallback_url @param [String] sms_method The sms_method @param [String] sms_url The sms_url @param [String] voice_fallback_method The voice_fallback_method @param [String] voice_fallback_url The voice_fallback_url @param [String] voice_method The voice_method @param [String] voice_url The voice_url @return [SimInstance] Updated SimInstance

    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
228 def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset)
229   data = Twilio::Values.of({
230       'UniqueName' => unique_name,
231       'CallbackMethod' => callback_method,
232       'CallbackUrl' => callback_url,
233       'FriendlyName' => friendly_name,
234       'RatePlan' => rate_plan,
235       'Status' => status,
236       'CommandsCallbackMethod' => commands_callback_method,
237       'CommandsCallbackUrl' => commands_callback_url,
238       'SmsFallbackMethod' => sms_fallback_method,
239       'SmsFallbackUrl' => sms_fallback_url,
240       'SmsMethod' => sms_method,
241       'SmsUrl' => sms_url,
242       'VoiceFallbackMethod' => voice_fallback_method,
243       'VoiceFallbackUrl' => voice_fallback_url,
244       'VoiceMethod' => voice_method,
245       'VoiceUrl' => voice_url,
246   })
247 
248   payload = @version.update('POST', @uri, data: data)
249 
250   SimInstance.new(@version, payload, sid: @solution[:sid], )
251 end
usage() click to toggle source

Access the usage @return [UsageList] @return [UsageContext]

    # File lib/twilio-ruby/rest/preview/wireless/sim.rb
257 def usage
258   UsageContext.new(@version, @solution[:sid], )
259 end