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
246 247 248 249 250 251 252 253 254 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 246 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
258 259 260 261 262 263 264 265 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 258 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
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 270 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
317 318 319 320 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 317 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V2.ChannelsSenderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
310 311 312 313 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 310 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
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/twilio-ruby/rest/messaging/v2/channels_sender.rb', line 290 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 |