Class: Twilio::REST::Events::V1::SinkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::SinkInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/sink.rb
Instance Method Summary collapse
-
#context ⇒ SinkContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Sink was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Sink was updated, given in ISO 8601 format.
-
#delete ⇒ Boolean
Delete the SinkInstance.
-
#description ⇒ String
A human readable description for the Sink.
-
#fetch ⇒ SinkInstance
Fetch the SinkInstance.
-
#initialize(version, payload, sid: nil) ⇒ SinkInstance
constructor
Initialize the SinkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
Contains a dictionary of URL links to nested resources of this Sink.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Sink.
-
#sink_configuration ⇒ Hash
The information required for Twilio to connect to the provided Sink encoded as JSON.
-
#sink_test ⇒ sink_test
Access the sink_test.
- #sink_type ⇒ SinkType
-
#sink_validate ⇒ sink_validate
Access the sink_validate.
- #status ⇒ Status
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(description: nil) ⇒ SinkInstance
Update the SinkInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ SinkInstance
Initialize the SinkInstance
573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 573 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'description' => payload['description'], 'sid' => payload['sid'], 'sink_configuration' => payload['sink_configuration'], 'sink_type' => payload['sink_type'], 'status' => payload['status'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#context ⇒ SinkContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
599 600 601 602 603 604 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 599 def context unless @instance_context @instance_context = SinkContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Sink was created, given in ISO 8601 format.
608 609 610 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 608 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Sink was updated, given in ISO 8601 format.
614 615 616 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 614 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the SinkInstance
663 664 665 666 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 663 def delete context.delete end |
#description ⇒ String
Returns A human readable description for the Sink.
620 621 622 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 620 def description @properties['description'] end |
#fetch ⇒ SinkInstance
Fetch the SinkInstance
671 672 673 674 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 671 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
712 713 714 715 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 712 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SinkInstance #{values}>" end |
#links ⇒ Hash
Returns Contains a dictionary of URL links to nested resources of this Sink.
656 657 658 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 656 def links @properties['links'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Sink.
626 627 628 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 626 def sid @properties['sid'] end |
#sink_configuration ⇒ Hash
Returns The information required for Twilio to connect to the provided Sink encoded as JSON.
632 633 634 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 632 def sink_configuration @properties['sink_configuration'] end |
#sink_test ⇒ sink_test
Access the sink_test
692 693 694 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 692 def sink_test context.sink_test end |
#sink_type ⇒ SinkType
638 639 640 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 638 def sink_type @properties['sink_type'] end |
#sink_validate ⇒ sink_validate
Access the sink_validate
699 700 701 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 699 def sink_validate context.sink_validate end |
#status ⇒ Status
644 645 646 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 644 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
705 706 707 708 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 705 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SinkInstance #{values}>" end |
#update(description: nil) ⇒ SinkInstance
Update the SinkInstance
680 681 682 683 684 685 686 687 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 680 def update( description: nil ) context.update( description: description, ) end |
#url ⇒ String
Returns The URL of this resource.
650 651 652 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 650 def url @properties['url'] end |