Class: Twilio::REST::Messaging::V1::ServiceContext::ChannelSenderContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Messaging::V1::ServiceContext::ChannelSenderContext
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ChannelSenderInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the ChannelSenderInstanceMetadata.
-
#fetch ⇒ ChannelSenderInstance
Fetch the ChannelSenderInstance.
-
#fetch_with_metadata ⇒ ChannelSenderInstance
Fetch the ChannelSenderInstanceMetadata.
-
#initialize(version, messaging_service_sid, sid) ⇒ ChannelSenderContext
constructor
Initialize the ChannelSenderContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, messaging_service_sid, sid) ⇒ ChannelSenderContext
Initialize the ChannelSenderContext
220 221 222 223 224 225 226 227 228 229 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 220 def initialize(version, messaging_service_sid, sid) super(version) # Path Solution @solution = { messaging_service_sid: messaging_service_sid, sid: sid, } @uri = "/Services/#{@solution[:messaging_service_sid]}/ChannelSenders/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ChannelSenderInstance
233 234 235 236 237 238 239 240 241 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 233 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 ChannelSenderInstanceMetadata
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 246 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) channelSender_instance = ChannelSenderInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ChannelSenderInstanceMetadata.new(@version, channelSender_instance, response.headers, response.status_code) end |
#fetch ⇒ ChannelSenderInstance
Fetch the ChannelSenderInstance
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 265 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ChannelSenderInstance.new( @version, payload, messaging_service_sid: @solution[:messaging_service_sid], sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ ChannelSenderInstance
Fetch the ChannelSenderInstanceMetadata
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 285 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) channel_sender_instance = ChannelSenderInstance.new( @version, response.body, messaging_service_sid: @solution[:messaging_service_sid], sid: @solution[:sid], ) ChannelSenderInstanceMetadata.new( @version, channel_sender_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
318 319 320 321 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 318 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.ChannelSenderContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
311 312 313 314 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/channel_sender.rb', line 311 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Messaging.V1.ChannelSenderContext #{context}>" end |