Class: Twilio::REST::Preview::Wireless::SimInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/wireless/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

Constructor Details

#initialize(version, payload, sid: nil) ⇒ SimInstance

Initialize the SimInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The sid


285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 285

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'unique_name' => payload['unique_name'],
      'account_sid' => payload['account_sid'],
      'rate_plan_sid' => payload['rate_plan_sid'],
      'friendly_name' => payload['friendly_name'],
      'iccid' => payload['iccid'],
      'e_id' => payload['e_id'],
      'status' => payload['status'],
      'commands_callback_url' => payload['commands_callback_url'],
      'commands_callback_method' => payload['commands_callback_method'],
      'sms_fallback_method' => payload['sms_fallback_method'],
      'sms_fallback_url' => payload['sms_fallback_url'],
      'sms_method' => payload['sms_method'],
      'sms_url' => payload['sms_url'],
      'voice_fallback_method' => payload['voice_fallback_method'],
      'voice_fallback_url' => payload['voice_fallback_url'],
      'voice_method' => payload['voice_method'],
      'voice_url' => payload['voice_url'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
      'links' => payload['links'],
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


344
345
346
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 344

def 
  @properties['account_sid']
end

#commands_callback_methodString

Returns The commands_callback_method.

Returns:

  • (String)

    The commands_callback_method


386
387
388
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 386

def commands_callback_method
  @properties['commands_callback_method']
end

#commands_callback_urlString

Returns The commands_callback_url.

Returns:

  • (String)

    The commands_callback_url


380
381
382
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 380

def commands_callback_url
  @properties['commands_callback_url']
end

#contextSimContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:

  • (SimContext)

    SimContext for this SimInstance


323
324
325
326
327
328
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 323

def context
  unless @instance_context
    @instance_context = SimContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#date_createdTime

Returns The date_created.

Returns:

  • (Time)

    The date_created


440
441
442
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 440

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date_updated.

Returns:

  • (Time)

    The date_updated


446
447
448
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 446

def date_updated
  @properties['date_updated']
end

#e_idString

Returns The e_id.

Returns:

  • (String)

    The e_id


368
369
370
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 368

def e_id
  @properties['e_id']
end

#fetchSimInstance

Fetch the SimInstance

Returns:


465
466
467
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 465

def fetch
  context.fetch
end

#friendly_nameString

Returns The friendly_name.

Returns:

  • (String)

    The friendly_name


356
357
358
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 356

def friendly_name
  @properties['friendly_name']
end

#iccidString

Returns The iccid.

Returns:

  • (String)

    The iccid


362
363
364
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 362

def iccid
  @properties['iccid']
end

#inspectObject

Provide a detailed, user friendly representation


525
526
527
528
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 525

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Wireless.SimInstance #{values}>"
end

Returns The links.

Returns:

  • (String)

    The links


458
459
460
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 458

def links
  @properties['links']
end

#rate_plan_sidString

Returns The rate_plan_sid.

Returns:

  • (String)

    The rate_plan_sid


350
351
352
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 350

def rate_plan_sid
  @properties['rate_plan_sid']
end

#sidString

Returns The sid.

Returns:

  • (String)

    The sid


332
333
334
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 332

def sid
  @properties['sid']
end

#sms_fallback_methodString

Returns The sms_fallback_method.

Returns:

  • (String)

    The sms_fallback_method


392
393
394
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 392

def sms_fallback_method
  @properties['sms_fallback_method']
end

#sms_fallback_urlString

Returns The sms_fallback_url.

Returns:

  • (String)

    The sms_fallback_url


398
399
400
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 398

def sms_fallback_url
  @properties['sms_fallback_url']
end

#sms_methodString

Returns The sms_method.

Returns:

  • (String)

    The sms_method


404
405
406
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 404

def sms_method
  @properties['sms_method']
end

#sms_urlString

Returns The sms_url.

Returns:

  • (String)

    The sms_url


410
411
412
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 410

def sms_url
  @properties['sms_url']
end

#statusString

Returns The status.

Returns:

  • (String)

    The status


374
375
376
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 374

def status
  @properties['status']
end

#to_sObject

Provide a user friendly representation


518
519
520
521
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 518

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Wireless.SimInstance #{values}>"
end

#unique_nameString

Returns The unique_name.

Returns:

  • (String)

    The unique_name


338
339
340
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 338

def unique_name
  @properties['unique_name']
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) ⇒ SimInstance

Update the SimInstance

Parameters:

  • unique_name (String) (defaults to: :unset)

    The unique_name

  • callback_method (String) (defaults to: :unset)

    The callback_method

  • callback_url (String) (defaults to: :unset)

    The callback_url

  • friendly_name (String) (defaults to: :unset)

    The friendly_name

  • rate_plan (String) (defaults to: :unset)

    The rate_plan

  • status (String) (defaults to: :unset)

    The status

  • commands_callback_method (String) (defaults to: :unset)

    The commands_callback_method

  • commands_callback_url (String) (defaults to: :unset)

    The commands_callback_url

  • sms_fallback_method (String) (defaults to: :unset)

    The sms_fallback_method

  • sms_fallback_url (String) (defaults to: :unset)

    The sms_fallback_url

  • sms_method (String) (defaults to: :unset)

    The sms_method

  • sms_url (String) (defaults to: :unset)

    The sms_url

  • voice_fallback_method (String) (defaults to: :unset)

    The voice_fallback_method

  • voice_fallback_url (String) (defaults to: :unset)

    The voice_fallback_url

  • voice_method (String) (defaults to: :unset)

    The voice_method

  • voice_url (String) (defaults to: :unset)

    The voice_url

Returns:


488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 488

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)
  context.update(
      unique_name: unique_name,
      callback_method: callback_method,
      callback_url: callback_url,
      friendly_name: friendly_name,
      rate_plan: rate_plan,
      status: status,
      commands_callback_method: commands_callback_method,
      commands_callback_url: commands_callback_url,
      sms_fallback_method: sms_fallback_method,
      sms_fallback_url: sms_fallback_url,
      sms_method: sms_method,
      sms_url: sms_url,
      voice_fallback_method: voice_fallback_method,
      voice_fallback_url: voice_fallback_url,
      voice_method: voice_method,
      voice_url: voice_url,
  )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


452
453
454
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 452

def url
  @properties['url']
end

#usageusage

Access the usage

Returns:


512
513
514
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 512

def usage
  context.usage
end

#voice_fallback_methodString

Returns The voice_fallback_method.

Returns:

  • (String)

    The voice_fallback_method


416
417
418
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 416

def voice_fallback_method
  @properties['voice_fallback_method']
end

#voice_fallback_urlString

Returns The voice_fallback_url.

Returns:

  • (String)

    The voice_fallback_url


422
423
424
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 422

def voice_fallback_url
  @properties['voice_fallback_url']
end

#voice_methodString

Returns The voice_method.

Returns:

  • (String)

    The voice_method


428
429
430
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 428

def voice_method
  @properties['voice_method']
end

#voice_urlString

Returns The voice_url.

Returns:

  • (String)

    The voice_url


434
435
436
# File 'lib/twilio-ruby/rest/preview/wireless/sim.rb', line 434

def voice_url
  @properties['voice_url']
end