class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskChannelContext
Public Class Methods
Initialize the TaskChannelContext
@param [Version] version Version
that contains the resource @param [String] workspace_sid The SID of the Workspace with the Task Channel to
fetch.
@param [String] sid The SID of the Task Channel resource to fetch. @return [TaskChannelContext] TaskChannelContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 175 def initialize(version, workspace_sid, sid) 176 super(version) 177 178 # Path Solution 179 @solution = {workspace_sid: workspace_sid, sid: sid, } 180 @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskChannels/#{@solution[:sid]}" 181 end
Public Instance Methods
Delete the TaskChannelInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 224 def delete 225 @version.delete('DELETE', @uri) 226 end
Fetch the TaskChannelInstance
@return [TaskChannelInstance] Fetched TaskChannelInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 186 def fetch 187 payload = @version.fetch('GET', @uri) 188 189 TaskChannelInstance.new( 190 @version, 191 payload, 192 workspace_sid: @solution[:workspace_sid], 193 sid: @solution[:sid], 194 ) 195 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 237 def inspect 238 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 239 "#<Twilio.Taskrouter.V1.TaskChannelContext #{context}>" 240 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 230 def to_s 231 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 232 "#<Twilio.Taskrouter.V1.TaskChannelContext #{context}>" 233 end
Update the TaskChannelInstance
@param [String] friendly_name A descriptive string that you create to describe
the Task Channel. It can be up to 64 characters long.
@param [Boolean] channel_optimized_routing Whether the TaskChannel should
prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized.
@return [TaskChannelInstance] Updated TaskChannelInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 205 def update(friendly_name: :unset, channel_optimized_routing: :unset) 206 data = Twilio::Values.of({ 207 'FriendlyName' => friendly_name, 208 'ChannelOptimizedRouting' => channel_optimized_routing, 209 }) 210 211 payload = @version.update('POST', @uri, data: data) 212 213 TaskChannelInstance.new( 214 @version, 215 payload, 216 workspace_sid: @solution[:workspace_sid], 217 sid: @solution[:sid], 218 ) 219 end