class Twilio::REST::Supersim::V1::SimInstance
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the SimInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The SID of the Sim resource to fetch. @return [SimInstance] SimInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 288 def initialize(version, payload, sid: nil) 289 super(version) 290 291 # Marshaled Properties 292 @properties = { 293 'sid' => payload['sid'], 294 'unique_name' => payload['unique_name'], 295 'account_sid' => payload['account_sid'], 296 'iccid' => payload['iccid'], 297 'status' => payload['status'], 298 'fleet_sid' => payload['fleet_sid'], 299 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 300 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 301 'url' => payload['url'], 302 'links' => payload['links'], 303 } 304 305 # Context 306 @instance_context = nil 307 @params = {'sid' => sid || @properties['sid'], } 308 end
Public Instance Methods
@return [String] The SID of the Account that the Super SIM belongs to
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 335 def account_sid 336 @properties['account_sid'] 337 end
Access the billing_periods
@return [billing_periods] billing_periods
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 422 def billing_periods 423 context.billing_periods 424 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [SimContext] SimContext
for this SimInstance
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 314 def context 315 unless @instance_context 316 @instance_context = SimContext.new(@version, @params['sid'], ) 317 end 318 @instance_context 319 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 359 def date_created 360 @properties['date_created'] 361 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 365 def date_updated 366 @properties['date_updated'] 367 end
Fetch the SimInstance
@return [SimInstance] Fetched SimInstance
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 384 def fetch 385 context.fetch 386 end
@return [String] The unique ID of the Fleet configured for this SIM
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 353 def fleet_sid 354 @properties['fleet_sid'] 355 end
@return [String] The ICCID associated with the SIM
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 341 def iccid 342 @properties['iccid'] 343 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 435 def inspect 436 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 437 "<Twilio.Supersim.V1.SimInstance #{values}>" 438 end
@return [String] The links
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 377 def links 378 @properties['links'] 379 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 323 def sid 324 @properties['sid'] 325 end
@return [sim.Status] The status of the Super SIM
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 347 def status 348 @properties['status'] 349 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 428 def to_s 429 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 430 "<Twilio.Supersim.V1.SimInstance #{values}>" 431 end
@return [String] An application-defined string that uniquely identifies the resource
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 329 def unique_name 330 @properties['unique_name'] 331 end
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 408 def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset, account_sid: :unset) 409 context.update( 410 unique_name: unique_name, 411 status: status, 412 fleet: fleet, 413 callback_url: callback_url, 414 callback_method: callback_method, 415 account_sid: account_sid, 416 ) 417 end
@return [String] The absolute URL of the Sim Resource
# File lib/twilio-ruby/rest/supersim/v1/sim.rb 371 def url 372 @properties['url'] 373 end