Class: Twilio::REST::FlexApi::V1::WebChannelContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::FlexApi::V1::WebChannelContext
- Defined in:
- lib/twilio-ruby/rest/flex_api/v1/web_channel.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the WebChannelInstance.
-
#fetch ⇒ WebChannelInstance
Fetch the WebChannelInstance.
-
#initialize(version, sid) ⇒ WebChannelContext
constructor
Initialize the WebChannelContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(chat_status: :unset, post_engagement_data: :unset) ⇒ WebChannelInstance
Update the WebChannelInstance.
Constructor Details
#initialize(version, sid) ⇒ WebChannelContext
Initialize the WebChannelContext
176 177 178 179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 176 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/WebChannels/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the WebChannelInstance
188 189 190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 188 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ WebChannelInstance
Fetch the WebChannelInstance
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 200 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) WebChannelInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
255 256 257 258 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 255 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.WebChannelContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
248 249 250 251 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 248 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V1.WebChannelContext #{context}>" end |
#update(chat_status: :unset, post_engagement_data: :unset) ⇒ WebChannelInstance
Update the WebChannelInstance
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 221 def update( chat_status: :unset, post_engagement_data: :unset ) data = Twilio::Values.of({ 'ChatStatus' => chat_status, 'PostEngagementData' => post_engagement_data, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) WebChannelInstance.new( @version, payload, sid: @solution[:sid], ) end |