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
269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 269 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Channels/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ChannelInstance
282 283 284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 282 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
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 295 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
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 314 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
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 333 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
365 366 367 368 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 365 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ChannelContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
358 359 360 361 |
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 358 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.ChannelContext #{context}>" end |