class Twilio::REST::Api::V2010::AccountContext::QueueInstance

Public Class Methods

new(version, payload, account_sid: nil, sid: nil) click to toggle source

Initialize the QueueInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created this Queue
resource.

@param [String] sid The Twilio-provided string that uniquely identifies the

Queue resource to fetch

@return [QueueInstance] QueueInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
261 def initialize(version, payload, account_sid: nil, sid: nil)
262   super(version)
263 
264   # Marshaled Properties
265   @properties = {
266       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
267       'current_size' => payload['current_size'].to_i,
268       'friendly_name' => payload['friendly_name'],
269       'uri' => payload['uri'],
270       'account_sid' => payload['account_sid'],
271       'average_wait_time' => payload['average_wait_time'].to_i,
272       'sid' => payload['sid'],
273       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
274       'max_size' => payload['max_size'].to_i,
275   }
276 
277   # Context
278   @instance_context = nil
279   @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], }
280 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created this resource

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
319 def account_sid
320   @properties['account_sid']
321 end
average_wait_time() click to toggle source

@return [String] Average wait time of members in the queue

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
325 def average_wait_time
326   @properties['average_wait_time']
327 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [QueueContext] QueueContext for this QueueInstance

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
286 def context
287   unless @instance_context
288     @instance_context = QueueContext.new(@version, @params['account_sid'], @params['sid'], )
289   end
290   @instance_context
291 end
current_size() click to toggle source

@return [String] The number of calls currently in the queue.

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
301 def current_size
302   @properties['current_size']
303 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that this resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
337 def date_created
338   @properties['date_created']
339 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that this resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
295 def date_updated
296   @properties['date_updated']
297 end
delete() click to toggle source

Delete the QueueInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
368 def delete
369   context.delete
370 end
fetch() click to toggle source

Fetch the QueueInstance @return [QueueInstance] Fetched QueueInstance

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
350 def fetch
351   context.fetch
352 end
friendly_name() click to toggle source

@return [String] A string that you assigned to describe this resource

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
307 def friendly_name
308   @properties['friendly_name']
309 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
388 def inspect
389   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
390   "<Twilio.Api.V2010.QueueInstance #{values}>"
391 end
max_size() click to toggle source

@return [String] The max number of calls allowed in the queue

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
343 def max_size
344   @properties['max_size']
345 end
members() click to toggle source

Access the members @return [members] members

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
375 def members
376   context.members
377 end
sid() click to toggle source

@return [String] The unique string that identifies this resource

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
331 def sid
332   @properties['sid']
333 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
381 def to_s
382   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
383   "<Twilio.Api.V2010.QueueInstance #{values}>"
384 end
update(friendly_name: :unset, max_size: :unset) click to toggle source

Update the QueueInstance @param [String] friendly_name A descriptive string that you created to describe

this resource. It can be up to 64 characters long.

@param [String] max_size The maximum number of calls allowed to be in the queue.

The default is 100. The maximum is 5000

@return [QueueInstance] Updated QueueInstance

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
361 def update(friendly_name: :unset, max_size: :unset)
362   context.update(friendly_name: friendly_name, max_size: max_size, )
363 end
uri() click to toggle source

@return [String] The URI of this resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
313 def uri
314   @properties['uri']
315 end