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 SID of the Account that created the resource.
-
#command ⇒ String
The message being sent to or from the SIM.
-
#command_mode ⇒ command.CommandMode
The mode used to send the SMS message.
-
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated format.
-
#delete ⇒ Boolean
Deletes the CommandInstance.
-
#delivery_receipt_requested ⇒ Boolean
Whether to request a delivery receipt.
-
#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
The unique string that identifies the resource.
-
#sim_sid ⇒ String
The SID of the Sim resource that the Command was sent to or from.
-
#status ⇒ command.Status
The status of the Command.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transport ⇒ command.Transport
The type of transport used.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CommandInstance
Initialize the CommandInstance
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 291 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 SID of the Account that created the resource.
334 335 336 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 334 def account_sid @properties['account_sid'] end |
#command ⇒ String
Returns The message being sent to or from the SIM.
346 347 348 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 346 def command @properties['command'] end |
#command_mode ⇒ command.CommandMode
Returns The mode used to send the SMS message.
352 353 354 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 352 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
319 320 321 322 323 324 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 319 def context unless @instance_context @instance_context = CommandContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
382 383 384 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 382 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated format.
388 389 390 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 388 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the CommandInstance
408 409 410 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 408 def delete context.delete end |
#delivery_receipt_requested ⇒ Boolean
Returns Whether to request a delivery receipt.
364 365 366 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 364 def delivery_receipt_requested @properties['delivery_receipt_requested'] end |
#direction ⇒ command.Direction
Returns The direction of the Command.
376 377 378 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 376 def direction @properties['direction'] end |
#fetch ⇒ CommandInstance
Fetch a CommandInstance
401 402 403 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 401 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
421 422 423 424 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 421 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that identifies the resource.
328 329 330 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 328 def sid @properties['sid'] end |
#sim_sid ⇒ String
Returns The SID of the Sim resource that the Command was sent to or from.
340 341 342 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 340 def sim_sid @properties['sim_sid'] end |
#status ⇒ command.Status
Returns The status of the Command.
370 371 372 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 370 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
414 415 416 417 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 414 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#transport ⇒ command.Transport
Returns The type of transport used.
358 359 360 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 358 def transport @properties['transport'] end |
#url ⇒ String
Returns The absolute URL of the resource.
394 395 396 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 394 def url @properties['url'] end |