class Twilio::REST::FlexApi::V1::WebChannelContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the WebChannelContext @param [Version] version Version that contains the resource @param [String] sid The SID of the WebChannel resource to fetch. @return [WebChannelContext] WebChannelContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
172 def initialize(version, sid)
173   super(version)
174 
175   # Path Solution
176   @solution = {sid: sid, }
177   @uri = "/WebChannels/#{@solution[:sid]}"
178 end

Public Instance Methods

delete() click to toggle source

Delete the WebChannelInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
209 def delete
210    @version.delete('DELETE', @uri)
211 end
fetch() click to toggle source

Fetch the WebChannelInstance @return [WebChannelInstance] Fetched WebChannelInstance

    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
183 def fetch
184   payload = @version.fetch('GET', @uri)
185 
186   WebChannelInstance.new(@version, payload, sid: @solution[:sid], )
187 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
222 def inspect
223   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
224   "#<Twilio.FlexApi.V1.WebChannelContext #{context}>"
225 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
215 def to_s
216   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
217   "#<Twilio.FlexApi.V1.WebChannelContext #{context}>"
218 end
update(chat_status: :unset, post_engagement_data: :unset) click to toggle source

Update the WebChannelInstance @param [web_channel.ChatStatus] chat_status The chat status. Can only be

`inactive`.

@param [String] post_engagement_data The post-engagement data. @return [WebChannelInstance] Updated WebChannelInstance

    # File lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
195 def update(chat_status: :unset, post_engagement_data: :unset)
196   data = Twilio::Values.of({
197       'ChatStatus' => chat_status,
198       'PostEngagementData' => post_engagement_data,
199   })
200 
201   payload = @version.update('POST', @uri, data: data)
202 
203   WebChannelInstance.new(@version, payload, sid: @solution[:sid], )
204 end