Class: Twilio::REST::Wireless::V1::CommandInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/wireless/v1/command.rb

Instance Method Summary collapse

Constructor Details

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

Initialize the CommandInstance



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 297

def initialize(version, payload , sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'sid' => payload['sid'],
        'account_sid' => payload['account_sid'],
        'sim_sid' => payload['sim_sid'],
        'command' => payload['command'],
        'command_mode' => payload['command_mode'],
        'transport' => payload['transport'],
        'delivery_receipt_requested' => payload['delivery_receipt_requested'],
        'status' => payload['status'],
        'direction' => payload['direction'],
        '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_sidString



340
341
342
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 340

def 
    @properties['account_sid']
end

#commandString



352
353
354
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 352

def command
    @properties['command']
end

#command_modeCommandMode



358
359
360
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 358

def command_mode
    @properties['command_mode']
end

#contextCommandContext

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



325
326
327
328
329
330
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 325

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

#date_createdTime



388
389
390
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 388

def date_created
    @properties['date_created']
end

#date_updatedTime



394
395
396
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 394

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the CommandInstance



407
408
409
410
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 407

def delete

    context.delete
end

#delivery_receipt_requestedBoolean



370
371
372
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 370

def delivery_receipt_requested
    @properties['delivery_receipt_requested']
end

#directionDirection



382
383
384
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 382

def direction
    @properties['direction']
end

#fetchCommandInstance

Fetch the CommandInstance



415
416
417
418
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 415

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



429
430
431
432
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 429

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

#sidString



334
335
336
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 334

def sid
    @properties['sid']
end

#sim_sidString



346
347
348
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 346

def sim_sid
    @properties['sim_sid']
end

#statusStatus



376
377
378
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 376

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



422
423
424
425
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 422

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

#transportTransport



364
365
366
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 364

def transport
    @properties['transport']
end

#urlString



400
401
402
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 400

def url
    @properties['url']
end