Class: Twilio::REST::Api::V2010::AccountContext::QueueInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::QueueInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/queue.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Queue resource.
-
#average_wait_time ⇒ String
The average wait time in seconds of the members in this queue.
-
#context ⇒ QueueContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#current_size ⇒ String
The number of calls currently in the queue.
-
#date_created ⇒ Time
The date and time in GMT that this resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the QueueInstance.
-
#fetch ⇒ QueueInstance
Fetch the QueueInstance.
-
#friendly_name ⇒ String
A string that you assigned to describe this resource.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ QueueInstance
constructor
Initialize the QueueInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#max_size ⇒ String
The maximum number of calls that can be in the queue.
-
#members ⇒ members
Access the members.
-
#sid ⇒ String
The unique string that that we created to identify this Queue resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, max_size: :unset) ⇒ QueueInstance
Update the QueueInstance.
-
#uri ⇒ String
The URI of this resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ QueueInstance
Initialize the QueueInstance
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 287 def initialize(version, payload , account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'current_size' => payload['current_size'] == nil ? payload['current_size'] : payload['current_size'].to_i, 'friendly_name' => payload['friendly_name'], 'uri' => payload['uri'], 'account_sid' => payload['account_sid'], 'average_wait_time' => payload['average_wait_time'] == nil ? payload['average_wait_time'] : payload['average_wait_time'].to_i, 'sid' => payload['sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'max_size' => payload['max_size'] == nil ? payload['max_size'] : payload['max_size'].to_i, } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created this Queue resource.
345 346 347 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 345 def account_sid @properties['account_sid'] end |
#average_wait_time ⇒ String
Returns The average wait time in seconds of the members in this queue. This is calculated at the time of the request.
351 352 353 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 351 def average_wait_time @properties['average_wait_time'] end |
#context ⇒ QueueContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
312 313 314 315 316 317 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 312 def context unless @instance_context @instance_context = QueueContext.new(@version , @params['account_sid'], @params['sid']) end @instance_context end |
#current_size ⇒ String
Returns The number of calls currently in the queue.
327 328 329 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 327 def current_size @properties['current_size'] end |
#date_created ⇒ Time
Returns The date and time in GMT that this resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
363 364 365 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 363 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that this resource was last updated, specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
321 322 323 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 321 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the QueueInstance
376 377 378 379 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 376 def delete context.delete end |
#fetch ⇒ QueueInstance
Fetch the QueueInstance
384 385 386 387 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 384 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A string that you assigned to describe this resource.
333 334 335 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 333 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
421 422 423 424 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 421 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.QueueInstance #{values}>" end |
#max_size ⇒ String
Returns The maximum number of calls that can be in the queue. The default is 1000 and the maximum is 5000.
369 370 371 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 369 def max_size @properties['max_size'] end |
#members ⇒ members
Access the members
408 409 410 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 408 def members context.members end |
#sid ⇒ String
Returns The unique string that that we created to identify this Queue resource.
357 358 359 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 357 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
414 415 416 417 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 414 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.QueueInstance #{values}>" end |
#update(friendly_name: :unset, max_size: :unset) ⇒ QueueInstance
Update the QueueInstance
394 395 396 397 398 399 400 401 402 403 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 394 def update( friendly_name: :unset, max_size: :unset ) context.update( friendly_name: friendly_name, max_size: max_size, ) end |
#uri ⇒ String
Returns The URI of this resource, relative to ‘api.twilio.com`.
339 340 341 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue.rb', line 339 def uri @properties['uri'] end |