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](www.twilio.com/docs/iam/api/account) that created the Command resource.
-
#command ⇒ String
The message being sent to or from the SIM.
- #command_mode ⇒ CommandMode
-
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
-
#delete ⇒ Boolean
Delete the CommandInstance.
-
#delivery_receipt_requested ⇒ Boolean
Whether to request a delivery receipt.
- #direction ⇒ Direction
-
#fetch ⇒ CommandInstance
Fetch the 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 we created to identify the Command resource.
-
#sim_sid ⇒ String
The SID of the [Sim resource](www.twilio.com/docs/iot/wireless/api/sim-resource) that the Command was sent to or from.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
- #transport ⇒ Transport
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CommandInstance
Initialize the CommandInstance
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 531 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](www.twilio.com/docs/iam/api/account) that created the Command resource.
575 576 577 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 575 def account_sid @properties['account_sid'] end |
#command ⇒ String
Returns The message being sent to or from the SIM. For text mode messages, this can be up to 160 characters. For binary mode messages, this is a series of up to 140 bytes of data encoded using base64.
587 588 589 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 587 def command @properties['command'] end |
#command_mode ⇒ CommandMode
593 594 595 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 593 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
560 561 562 563 564 565 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 560 def context unless @instance_context @instance_context = CommandContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
623 624 625 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 623 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [ISO 8601](www.iso.org/iso-8601-date-and-time-format.html) format.
629 630 631 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 629 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CommandInstance
642 643 644 645 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 642 def delete context.delete end |
#delivery_receipt_requested ⇒ Boolean
Returns Whether to request a delivery receipt.
605 606 607 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 605 def delivery_receipt_requested @properties['delivery_receipt_requested'] end |
#direction ⇒ Direction
617 618 619 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 617 def direction @properties['direction'] end |
#fetch ⇒ CommandInstance
Fetch the CommandInstance
650 651 652 653 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 650 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
664 665 666 667 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 664 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that we created to identify the Command resource.
569 570 571 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 569 def sid @properties['sid'] end |
#sim_sid ⇒ String
Returns The SID of the [Sim resource](www.twilio.com/docs/iot/wireless/api/sim-resource) that the Command was sent to or from.
581 582 583 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 581 def sim_sid @properties['sim_sid'] end |
#status ⇒ Status
611 612 613 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 611 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
657 658 659 660 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 657 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#transport ⇒ Transport
599 600 601 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 599 def transport @properties['transport'] end |
#url ⇒ String
Returns The absolute URL of the resource.
635 636 637 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 635 def url @properties['url'] end |