Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskChannelContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskChannelContext
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the TaskChannelInstance.
-
#fetch ⇒ TaskChannelInstance
Fetch the TaskChannelInstance.
-
#initialize(version, workspace_sid, sid) ⇒ TaskChannelContext
constructor
Initialize the TaskChannelContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, channel_optimized_routing: :unset) ⇒ TaskChannelInstance
Update the TaskChannelInstance.
Constructor Details
#initialize(version, workspace_sid, sid) ⇒ TaskChannelContext
Initialize the TaskChannelContext
171 172 173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 171 def initialize(version, workspace_sid, sid) super(version) # Path Solution @solution = { workspace_sid: workspace_sid, sid: sid, } @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskChannels/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the TaskChannelInstance
183 184 185 186 187 188 189 190 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 183 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ TaskChannelInstance
Fetch the TaskChannelInstance
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 195 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) TaskChannelInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 252 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.TaskChannelContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 245 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Taskrouter.V1.TaskChannelContext #{context}>" end |
#update(friendly_name: :unset, channel_optimized_routing: :unset) ⇒ TaskChannelInstance
Update the TaskChannelInstance
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb', line 217 def update( friendly_name: :unset, channel_optimized_routing: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'ChannelOptimizedRouting' => channel_optimized_routing, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) TaskChannelInstance.new( @version, payload, workspace_sid: @solution[:workspace_sid], sid: @solution[:sid], ) end |