Class: Twilio::REST::Wireless::V1::CommandInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Wireless::V1::CommandInstance
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/command.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique id of the Account that this Command belongs to.
-
#command ⇒ String
The message being sent to or from the SIM.
-
#command_mode ⇒ command.CommandMode
A string representing which mode the SMS was sent or received using.
-
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this resource was created, given as GMT in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this resource was last updated, given as GMT in ISO 8601 format.
-
#delivery_receipt_requested ⇒ Boolean
The delivery_receipt_requested.
-
#direction ⇒ command.Direction
The direction of the Command.
-
#fetch ⇒ CommandInstance
Fetch a CommandInstance.
-
#initialize(version, payload, sid: nil) ⇒ CommandInstance
constructor
Initialize the CommandInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A 34 character string that uniquely identifies this resource.
-
#sim_sid ⇒ String
The unique ID of the SIM that this Command was sent to or from.
-
#status ⇒ command.Status
A string representing the status of the Command.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transport ⇒ command.Transport
The transport.
-
#url ⇒ String
The URL for this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CommandInstance
Initialize the CommandInstance
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 266 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_sid ⇒ String
Returns The unique id of the Account that this Command belongs to.
309 310 311 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 309 def account_sid @properties['account_sid'] end |
#command ⇒ String
Returns The message being sent to or from the SIM.
321 322 323 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 321 def command @properties['command'] end |
#command_mode ⇒ command.CommandMode
Returns A string representing which mode the SMS was sent or received using.
327 328 329 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 327 def command_mode @properties['command_mode'] end |
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
294 295 296 297 298 299 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 294 def context unless @instance_context @instance_context = CommandContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this resource was created, given as GMT in ISO 8601 format.
357 358 359 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 357 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this resource was last updated, given as GMT in ISO 8601 format.
363 364 365 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 363 def date_updated @properties['date_updated'] end |
#delivery_receipt_requested ⇒ Boolean
Returns The delivery_receipt_requested.
339 340 341 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 339 def delivery_receipt_requested @properties['delivery_receipt_requested'] end |
#direction ⇒ command.Direction
Returns The direction of the Command.
351 352 353 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 351 def direction @properties['direction'] end |
#fetch ⇒ CommandInstance
Fetch a CommandInstance
376 377 378 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 376 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
389 390 391 392 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 389 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this resource.
303 304 305 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 303 def sid @properties['sid'] end |
#sim_sid ⇒ String
Returns The unique ID of the SIM that this Command was sent to or from.
315 316 317 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 315 def sim_sid @properties['sim_sid'] end |
#status ⇒ command.Status
Returns A string representing the status of the Command.
345 346 347 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 345 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
382 383 384 385 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 382 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#transport ⇒ command.Transport
Returns The transport.
333 334 335 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 333 def transport @properties['transport'] end |
#url ⇒ String
Returns The URL for this resource.
369 370 371 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 369 def url @properties['url'] end |