class Twilio::REST::Wireless::V1::CommandInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the CommandInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The SID of the Command resource to fetch. @return [CommandInstance] CommandInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/wireless/v1/command.rb
278 def initialize(version, payload, sid: nil)
279   super(version)
280 
281   # Marshaled Properties
282   @properties = {
283       'sid' => payload['sid'],
284       'account_sid' => payload['account_sid'],
285       'sim_sid' => payload['sim_sid'],
286       'command' => payload['command'],
287       'command_mode' => payload['command_mode'],
288       'transport' => payload['transport'],
289       'delivery_receipt_requested' => payload['delivery_receipt_requested'],
290       'status' => payload['status'],
291       'direction' => payload['direction'],
292       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
293       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
294       'url' => payload['url'],
295   }
296 
297   # Context
298   @instance_context = nil
299   @params = {'sid' => sid || @properties['sid'], }
300 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
321 def account_sid
322   @properties['account_sid']
323 end
command() click to toggle source

@return [String] The message being sent to or from the SIM

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
333 def command
334   @properties['command']
335 end
command_mode() click to toggle source

@return [command.CommandMode] The mode used to send the SMS message

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
339 def command_mode
340   @properties['command_mode']
341 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CommandContext] CommandContext for this CommandInstance

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
306 def context
307   unless @instance_context
308     @instance_context = CommandContext.new(@version, @params['sid'], )
309   end
310   @instance_context
311 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was created

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
369 def date_created
370   @properties['date_created']
371 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the resource was last updated format

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
375 def date_updated
376   @properties['date_updated']
377 end
delete() click to toggle source

Delete the CommandInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
395 def delete
396   context.delete
397 end
delivery_receipt_requested() click to toggle source

@return [Boolean] Whether to request a delivery receipt

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
351 def delivery_receipt_requested
352   @properties['delivery_receipt_requested']
353 end
direction() click to toggle source

@return [command.Direction] The direction of the Command

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
363 def direction
364   @properties['direction']
365 end
fetch() click to toggle source

Fetch the CommandInstance @return [CommandInstance] Fetched CommandInstance

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
388 def fetch
389   context.fetch
390 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
408 def inspect
409   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
410   "<Twilio.Wireless.V1.CommandInstance #{values}>"
411 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
315 def sid
316   @properties['sid']
317 end
sim_sid() click to toggle source

@return [String] The SID of the Sim resource that the Command was sent to or from

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
327 def sim_sid
328   @properties['sim_sid']
329 end
status() click to toggle source

@return [command.Status] The status of the Command

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
357 def status
358   @properties['status']
359 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
401 def to_s
402   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
403   "<Twilio.Wireless.V1.CommandInstance #{values}>"
404 end
transport() click to toggle source

@return [command.Transport] The type of transport used

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
345 def transport
346   @properties['transport']
347 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/wireless/v1/command.rb
381 def url
382   @properties['url']
383 end