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
567 568 569 570 571 572 573 574 575 576 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 567 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
580 581 582 583 584 585 586 587 588 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 580 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
593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 593 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
612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 612 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
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 631 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
711 712 713 714 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 711 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
704 705 706 707 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 704 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
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 657 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
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 678 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 |