Class: Twilio::REST::Supersim::V1::SimInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Supersim::V1::SimInstance
- Defined in:
- lib/twilio-ruby/rest/supersim/v1/sim.rb
Overview
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 [email protected].
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that the Super SIM belongs to.
-
#context ⇒ SimContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#fetch ⇒ SimInstance
Fetch the SimInstance.
-
#fleet_sid ⇒ String
The unique ID of the Fleet configured for this SIM.
-
#iccid ⇒ String
The ICCID associated with the SIM.
-
#initialize(version, payload, sid: nil) ⇒ SimInstance
constructor
Initialize the SimInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#status ⇒ sim.Status
The status of the Super SIM.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the resource.
-
#update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset) ⇒ SimInstance
Update the SimInstance.
-
#url ⇒ String
The absolute URL of the Sim Resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SimInstance
Initialize the SimInstance
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 252 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'iccid' => payload['iccid'], 'status' => payload['status'], 'fleet_sid' => payload['fleet_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
298 299 300 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 298 def account_sid @properties['account_sid'] end |
#context ⇒ SimContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 277 def context unless @instance_context @instance_context = SimContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
322 323 324 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 322 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
328 329 330 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 328 def date_updated @properties['date_updated'] end |
#fetch ⇒ SimInstance
Fetch the SimInstance
341 342 343 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 341 def fetch context.fetch end |
#fleet_sid ⇒ String
316 317 318 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 316 def fleet_sid @properties['fleet_sid'] end |
#iccid ⇒ String
304 305 306 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 304 def iccid @properties['iccid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
380 381 382 383 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 380 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Supersim.V1.SimInstance #{values}>" end |
#sid ⇒ String
286 287 288 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 286 def sid @properties['sid'] end |
#status ⇒ sim.Status
310 311 312 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 310 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
373 374 375 376 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 373 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Supersim.V1.SimInstance #{values}>" end |
#unique_name ⇒ String
292 293 294 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 292 def unique_name @properties['unique_name'] end |
#update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset) ⇒ SimInstance
Update the SimInstance
361 362 363 364 365 366 367 368 369 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 361 def update(unique_name: :unset, status: :unset, fleet: :unset, callback_url: :unset, callback_method: :unset) context.update( unique_name: unique_name, status: status, fleet: fleet, callback_url: callback_url, callback_method: callback_method, ) end |
#url ⇒ String
334 335 336 |
# File 'lib/twilio-ruby/rest/supersim/v1/sim.rb', line 334 def url @properties['url'] end |