class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskChannelInstance
Public Class Methods
Initialize the TaskChannelInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] workspace_sid
The SID of the Workspace that contains the Task
Channel.
@param [String] sid The SID of the Task Channel resource to fetch. @return [TaskChannelInstance] TaskChannelInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 252 def initialize(version, payload, workspace_sid: nil, sid: nil) 253 super(version) 254 255 # Marshaled Properties 256 @properties = { 257 'account_sid' => payload['account_sid'], 258 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 259 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 260 'friendly_name' => payload['friendly_name'], 261 'sid' => payload['sid'], 262 'unique_name' => payload['unique_name'], 263 'workspace_sid' => payload['workspace_sid'], 264 'channel_optimized_routing' => payload['channel_optimized_routing'], 265 'url' => payload['url'], 266 'links' => payload['links'], 267 } 268 269 # Context 270 @instance_context = nil 271 @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], } 272 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 287 def account_sid 288 @properties['account_sid'] 289 end
@return [Boolean] Whether the Task Channel will prioritize Workers that have been idle
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 329 def channel_optimized_routing 330 @properties['channel_optimized_routing'] 331 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [TaskChannelContext] TaskChannelContext
for this TaskChannelInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 278 def context 279 unless @instance_context 280 @instance_context = TaskChannelContext.new(@version, @params['workspace_sid'], @params['sid'], ) 281 end 282 @instance_context 283 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 293 def date_created 294 @properties['date_created'] 295 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 299 def date_updated 300 @properties['date_updated'] 301 end
Delete the TaskChannelInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 367 def delete 368 context.delete 369 end
Fetch the TaskChannelInstance
@return [TaskChannelInstance] Fetched TaskChannelInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 348 def fetch 349 context.fetch 350 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 305 def friendly_name 306 @properties['friendly_name'] 307 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 380 def inspect 381 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 382 "<Twilio.Taskrouter.V1.TaskChannelInstance #{values}>" 383 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 341 def links 342 @properties['links'] 343 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 311 def sid 312 @properties['sid'] 313 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 373 def to_s 374 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 375 "<Twilio.Taskrouter.V1.TaskChannelInstance #{values}>" 376 end
@return [String] An application-defined string that uniquely identifies the Task Channel
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 317 def unique_name 318 @properties['unique_name'] 319 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 360 def update(friendly_name: :unset, channel_optimized_routing: :unset) 361 context.update(friendly_name: friendly_name, channel_optimized_routing: channel_optimized_routing, ) 362 end
@return [String] The absolute URL of the Task Channel resource
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 335 def url 336 @properties['url'] 337 end
@return [String] The SID of the Workspace that contains the Task Channel
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb 323 def workspace_sid 324 @properties['workspace_sid'] 325 end