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.
-
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance.
-
#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.
Constructor Details
#initialize(version, sid) ⇒ ChannelsSenderContext
Initialize the ChannelsSenderContext
516 517 518 519 520 521 522 523 524 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 516 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
528 529 530 531 532 533 534 535 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 528 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ChannelsSenderInstance
Fetch the ChannelsSenderInstance
540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 540 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 |
#inspect ⇒ Object
Provide a detailed, user friendly representation
587 588 589 590 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 587 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
580 581 582 583 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 580 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
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 560 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 |