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 account_sid.
-
#assigned_tasks ⇒ String
The assigned_tasks.
-
#available ⇒ Boolean
The available.
-
#available_capacity_percentage ⇒ String
The available_capacity_percentage.
-
#configured_capacity ⇒ String
The configured_capacity.
-
#context ⇒ WorkerChannelContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_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.
-
#links ⇒ String
The links.
-
#sid ⇒ String
The sid.
-
#task_channel_sid ⇒ String
The task_channel_sid.
-
#task_channel_unique_name ⇒ String
The task_channel_unique_name.
-
#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 worker_sid.
-
#workspace_sid ⇒ String
The workspace_sid.
Constructor Details
#initialize(version, payload, workspace_sid: nil, worker_sid: nil, sid: nil) ⇒ WorkerChannelInstance
Initialize the WorkerChannelInstance
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 228 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'], 'links' => payload['links'], '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 account_sid.
276 277 278 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 276 def account_sid @properties['account_sid'] end |
#assigned_tasks ⇒ String
Returns The assigned_tasks.
282 283 284 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 282 def assigned_tasks @properties['assigned_tasks'] end |
#available ⇒ Boolean
Returns The available.
288 289 290 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 288 def available @properties['available'] end |
#available_capacity_percentage ⇒ String
Returns The available_capacity_percentage.
294 295 296 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 294 def available_capacity_percentage @properties['available_capacity_percentage'] end |
#configured_capacity ⇒ String
Returns The configured_capacity.
300 301 302 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 300 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
262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 262 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_created.
306 307 308 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 306 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
312 313 314 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 312 def date_updated @properties['date_updated'] end |
#fetch ⇒ WorkerChannelInstance
Fetch a WorkerChannelInstance
361 362 363 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 361 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
383 384 385 386 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 383 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkerChannelInstance #{values}>" end |
#links ⇒ String
Returns The links.
348 349 350 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 348 def links @properties['links'] end |
#sid ⇒ String
Returns The sid.
318 319 320 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 318 def sid @properties['sid'] end |
#task_channel_sid ⇒ String
Returns The task_channel_sid.
324 325 326 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 324 def task_channel_sid @properties['task_channel_sid'] end |
#task_channel_unique_name ⇒ String
Returns The task_channel_unique_name.
330 331 332 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 330 def task_channel_unique_name @properties['task_channel_unique_name'] end |
#to_s ⇒ Object
Provide a user friendly representation
376 377 378 379 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 376 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
370 371 372 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 370 def update(capacity: :unset, available: :unset) context.update(capacity: capacity, available: available) end |
#url ⇒ String
Returns The url.
354 355 356 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 354 def url @properties['url'] end |
#worker_sid ⇒ String
Returns The worker_sid.
336 337 338 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 336 def worker_sid @properties['worker_sid'] end |
#workspace_sid ⇒ String
Returns The workspace_sid.
342 343 344 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb', line 342 def workspace_sid @properties['workspace_sid'] end |