class Twilio::REST::Api::V2010::AccountContext::QueueContext

Public Class Methods

new(version, account_sid, sid) click to toggle source

Initialize the QueueContext @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

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

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

Queue resource to fetch

@return [QueueContext] QueueContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
171 def initialize(version, account_sid, sid)
172   super(version)
173 
174   # Path Solution
175   @solution = {account_sid: account_sid, sid: sid, }
176   @uri = "/Accounts/#{@solution[:account_sid]}/Queues/#{@solution[:sid]}.json"
177 
178   # Dependents
179   @members = nil
180 end

Public Instance Methods

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
209 def delete
210    @version.delete('DELETE', @uri)
211 end
fetch() click to toggle source

Fetch the QueueInstance @return [QueueInstance] Fetched QueueInstance

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
185 def fetch
186   payload = @version.fetch('GET', @uri)
187 
188   QueueInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
189 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
244 def inspect
245   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
246   "#<Twilio.Api.V2010.QueueContext #{context}>"
247 end
members(call_sid=:unset) click to toggle source

Access the members @return [MemberList] @return [MemberContext] if call_sid was passed.

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
217 def members(call_sid=:unset)
218   raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil?
219 
220   if call_sid != :unset
221     return MemberContext.new(@version, @solution[:account_sid], @solution[:sid], call_sid, )
222   end
223 
224   unless @members
225     @members = MemberList.new(
226         @version,
227         account_sid: @solution[:account_sid],
228         queue_sid: @solution[:sid],
229     )
230   end
231 
232   @members
233 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/queue.rb
237 def to_s
238   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
239   "#<Twilio.Api.V2010.QueueContext #{context}>"
240 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
198 def update(friendly_name: :unset, max_size: :unset)
199   data = Twilio::Values.of({'FriendlyName' => friendly_name, 'MaxSize' => max_size, })
200 
201   payload = @version.update('POST', @uri, data: data)
202 
203   QueueInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
204 end