class Twilio::REST::Wireless::V1::CommandInstance
Public Class Methods
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
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
@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
@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
@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
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
@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
@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 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
@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
@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 the CommandInstance
@return [CommandInstance] Fetched CommandInstance
# File lib/twilio-ruby/rest/wireless/v1/command.rb 388 def fetch 389 context.fetch 390 end
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
@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
@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
@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
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
@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
@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