Class: Twilio::REST::FlexApi::V1::ChannelContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::FlexApi::V1::ChannelContext
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/channel.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ChannelInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the ChannelInstanceMetadata.
-
#fetch ⇒ ChannelInstance
Fetch the ChannelInstance.
-
#fetch_with_metadata ⇒ ChannelInstance
Fetch the ChannelInstanceMetadata.
-
#initialize(version, sid) ⇒ ChannelContext
constructor
Initialize the ChannelContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ ChannelContext
Initialize the ChannelContext
277 278 279 280 281 282 283 284 285 286 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 277 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Channels/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ChannelInstance
290 291 292 293 294 295 296 297 298 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 290 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 ChannelInstanceMetadata
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 303 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) channel_instance = ChannelInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) ChannelInstanceMetadata.new(@version, channel_instance, response.headers, response.status_code) end |
#fetch ⇒ ChannelInstance
Fetch the ChannelInstance
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 322 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ChannelInstance.new( @version, payload, sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ ChannelInstance
Fetch the ChannelInstanceMetadata
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 341 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) channel_instance = ChannelInstance.new( @version, response.body, sid: @solution[:sid], ) ChannelInstanceMetadata.new( @version, channel_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
373 374 375 376 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 373 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ChannelContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
366 367 368 369 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 366 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ChannelContext #{context}>" end |