Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::WorkerChannelInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkerContext::WorkerChannelInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique ID of the Account that owns this WorkerChannel.
-
#assigned_tasks ⇒ String
The total number of tasks assigned to Worker for this TaskChannel type.
-
#available ⇒ Boolean
Boolean value indicating whether the worker should receive Tasks of this TaskChannel type.
-
#available_capacity_percentage ⇒ String
The current available capacity between 0 to 100 for this TaskChannel.
-
#configured_capacity ⇒ String
The current configured capacity for the WorkerChannel.
-
#context ⇒ WorkerChannelContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Activity was created.
-
#date_updated ⇒ Time
The date this Activity was updated.
-
#fetch ⇒ WorkerChannelInstance
Fetch a WorkerChannelInstance.
-
#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ WorkerChannelInstance
constructor
Initialize the WorkerChannelInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique ID for this WorkerChannel.
-
#task_channel_sid ⇒ String
The unique ID of the TaskChannel.
-
#task_channel_unique_name ⇒ String
The unique name of TaskChannel, such as ‘voice’, ‘sms’, etc.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(capacity: :unset, available: :unset) ⇒ WorkerChannelInstance
Update the WorkerChannelInstance.
-
#url ⇒ String
The url.
-
#worker_sid ⇒ String
The unique ID of the Worker that this WorkerChannel belongs to.
-
#workspace_sid ⇒ String
The unique ID of the Workspace that this WorkerChannel belongs to.
Constructor Details
#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ WorkerChannelInstance
Initialize the WorkerChannelInstance
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 239 def initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assigned_tasks' => payload['assigned_tasks'].to_i, 'available' => payload['available'], 'available_capacity_percentage' => payload['available_capacity_percentage'].to_i, 'configured_capacity' => payload['configured_capacity'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'sid' => payload['sid'], 'task_channel_sid' => payload['task_channel_sid'], 'task_channel_unique_name' => payload['task_channel_unique_name'], 'worker_sid' => payload['worker_sid'], 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid, 'worker_sid' => worker_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique ID of the Account that owns this WorkerChannel.
286 287 288 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 286 def account_sid @properties['account_sid'] end |
#assigned_tasks ⇒ String
Returns The total number of tasks assigned to Worker for this TaskChannel type.
292 293 294 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 292 def assigned_tasks @properties['assigned_tasks'] end |
#available ⇒ Boolean
Returns Boolean value indicating whether the worker should receive Tasks of this TaskChannel type.
298 299 300 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 298 def available @properties['available'] end |
#available_capacity_percentage ⇒ String
Returns The current available capacity between 0 to 100 for this TaskChannel.
304 305 306 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 304 def available_capacity_percentage @properties['available_capacity_percentage'] end |
#configured_capacity ⇒ String
Returns The current configured capacity for the WorkerChannel.
310 311 312 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 310 def configured_capacity @properties['configured_capacity'] end |
#context ⇒ WorkerChannelContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 272 def context unless @instance_context @instance_context = WorkerChannelContext.new( @version, @params['workspace_sid'], @params['worker_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Activity was created.
316 317 318 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 316 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Activity was updated.
322 323 324 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 322 def date_updated @properties['date_updated'] end |
#fetch ⇒ WorkerChannelInstance
Fetch a WorkerChannelInstance
365 366 367 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 365 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
392 393 394 395 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 392 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkerChannelInstance #{values}>" end |
#sid ⇒ String
Returns The unique ID for this WorkerChannel.
328 329 330 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 328 def sid @properties['sid'] end |
#task_channel_sid ⇒ String
Returns The unique ID of the TaskChannel.
334 335 336 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 334 def task_channel_sid @properties['task_channel_sid'] end |
#task_channel_unique_name ⇒ String
Returns The unique name of TaskChannel, such as ‘voice’, ‘sms’, etc.
340 341 342 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 340 def task_channel_unique_name @properties['task_channel_unique_name'] end |
#to_s ⇒ Object
Provide a user friendly representation
385 386 387 388 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 385 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkerChannelInstance #{values}>" end |
#update(capacity: :unset, available: :unset) ⇒ WorkerChannelInstance
Update the WorkerChannelInstance
379 380 381 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 379 def update(capacity: :unset, available: :unset) context.update(capacity: capacity, available: available, ) end |
#url ⇒ String
Returns The url.
358 359 360 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 358 def url @properties['url'] end |
#worker_sid ⇒ String
Returns The unique ID of the Worker that this WorkerChannel belongs to.
346 347 348 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 346 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The unique ID of the Workspace that this WorkerChannel belongs to.
352 353 354 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 352 def workspace_sid @properties['workspace_sid'] end |