class Twilio::REST::Supersim::V1::SimContext

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

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 of the Sim resource to fetch. @return [SimContext] SimContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
197 def initialize(version, sid)
198   super(version)
199 
200   # Path Solution
201   @solution = {sid: sid, }
202   @uri = "/Sims/#{@solution[:sid]}"
203 
204   # Dependents
205   @billing_periods = nil
206 end

Public Instance Methods

billing_periods() click to toggle source

Access the billing_periods @return [BillingPeriodList] @return [BillingPeriodContext]

    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
256 def billing_periods
257   unless @billing_periods
258     @billing_periods = BillingPeriodList.new(@version, sim_sid: @solution[:sid], )
259   end
260 
261   @billing_periods
262 end
fetch() click to toggle source

Fetch the SimInstance @return [SimInstance] Fetched SimInstance

    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
211 def fetch
212   payload = @version.fetch('GET', @uri)
213 
214   SimInstance.new(@version, payload, sid: @solution[:sid], )
215 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
273 def inspect
274   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
275   "#<Twilio.Supersim.V1.SimContext #{context}>"
276 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
266 def to_s
267   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
268   "#<Twilio.Supersim.V1.SimContext #{context}>"
269 end
update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset) click to toggle source

Update the SimInstance @param [String] unique_name An application-defined string that uniquely

identifies the resource. It can be used in place of the resource's `sid` in the
URL to address the resource.

@param [sim.StatusUpdate] status The new status of the resource. Can be:

`ready`, `active`, or `inactive`. See the {Super SIM Status
Values}[https://www.twilio.com/docs/iot/supersim/api/sim-resource#status-values]
for more info.

@param [String] fleet The SID or unique name of the Fleet to which the SIM

resource should be assigned.

@param [String] callback_url The URL we should call using the `callback_method`

after an asynchronous update has finished.

@param [String] callback_method The HTTP method we should use to call

`callback_url`. Can be: `GET` or `POST` and the default is POST.

@param [String] account_sid The SID of the Account to which the Sim resource

should belong. The Account SID can only be that of the requesting Account or
that of a Subaccount of the requesting Account. Only valid when the Sim
resource's status is new.

@return [SimInstance] Updated SimInstance

    # File lib/twilio-ruby/rest/supersim/v1/sim.rb
237 def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset)
238   data = Twilio::Values.of({
239       'UniqueName' => unique_name,
240       'Status' => status,
241       'Fleet' => fleet,
242       'CallbackUrl' => callback_url,
243       'CallbackMethod' => callback_method,
244       'AccountSid' => account_sid,
245   })
246 
247   payload = @version.update('POST', @uri, data: data)
248 
249   SimInstance.new(@version, payload, sid: @solution[:sid], )
250 end