Class: Twilio::REST::Messaging::V2::ChannelsSenderContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V2::ChannelsSenderContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v2/channels_sender.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ChannelsSenderInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the ChannelsSenderInstanceMetadata.
-
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance.
-
#fetch_with_metadata ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstanceMetadata.
-
#initialize(version, sid) ⇒ ChannelsSenderContext
constructor
Initialize the ChannelsSenderContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstance.
-
#update_with_metadata(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstanceMetadata.
Constructor Details
#initialize(version, sid) ⇒ ChannelsSenderContext
Initialize the ChannelsSenderContext
593 594 595 596 597 598 599 600 601 602 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 593 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Channels/Senders/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ChannelsSenderInstance
606 607 608 609 610 611 612 613 614 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 606 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the ChannelsSenderInstanceMetadata
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 619 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) channelsSender_instance = ChannelsSenderInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ChannelsSenderInstanceMetadata.new(@version, channelsSender_instance, response.headers, response.status_code) end |
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 638 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ChannelsSenderInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstanceMetadata
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 657 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) channels_sender_instance = ChannelsSenderInstance.new( @version, response.body, sid: @solution[:sid], ) ChannelsSenderInstanceMetadata.new( @version, channels_sender_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
737 738 739 740 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 737 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
730 731 732 733 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 730 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>" end |
#update(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstance
683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 683 def update(messaging_v2_channels_sender_requests_update: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('POST', @uri, headers: headers, data: messaging_v2_channels_sender_requests_update.to_json) ChannelsSenderInstance.new( @version, payload, sid: @solution[:sid], ) end |
#update_with_metadata(messaging_v2_channels_sender_requests_update: :unset) ⇒ ChannelsSenderInstance
Update the ChannelsSenderInstanceMetadata
704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 704 def (messaging_v2_channels_sender_requests_update: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('POST', @uri, headers: headers, data: messaging_v2_channels_sender_requests_update.to_json) channels_sender_instance = ChannelsSenderInstance.new( @version, response.body, sid: @solution[:sid], ) ChannelsSenderInstanceMetadata.new( @version, channels_sender_instance, response.headers, response.status_code ) end |