class Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueList::TaskQueuesStatisticsList
Public Class Methods
Initialize the TaskQueuesStatisticsList
@param [Version] version Version
that contains the resource @param [String] workspace_sid The SID of the Workspace that contains the
TaskQueue.
@return [TaskQueuesStatisticsList] TaskQueuesStatisticsList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 22 def initialize(version, workspace_sid: nil) 23 super(version) 24 25 # Path Solution 26 @solution = {workspace_sid: workspace_sid} 27 @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskQueues/Statistics" 28 end
Public Instance Methods
When passed a block, yields TaskQueuesStatisticsInstance
records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 117 def each 118 limits = @version.read_limits 119 120 page = self.page(page_size: limits[:page_size], ) 121 122 @version.stream(page, 123 limit: limits[:limit], 124 page_limit: limits[:page_limit]).each {|x| yield x} 125 end
Retrieve a single page of TaskQueuesStatisticsInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of TaskQueuesStatisticsInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 173 def get_page(target_url) 174 response = @version.domain.request( 175 'GET', 176 target_url 177 ) 178 TaskQueuesStatisticsPage.new(@version, response, @solution) 179 end
Lists TaskQueuesStatisticsInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Time] end_date Only calculate statistics from this date and time and
earlier, specified in GMT as an {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time.
@param [String] friendly_name The `friendly_name` of the TaskQueue statistics to
read.
@param [String] minutes Only calculate statistics since this many minutes in the
past. The default is 15 minutes.
@param [Time] start_date Only calculate statistics from this date and time and
later, specified in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
@param [String] task_channel Only calculate statistics on this TaskChannel. Can
be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.
@param [String] split_by_wait_time A comma separated list of values that
describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed.
@param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Array] Array of up to limit results
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 57 def list(end_date: :unset, friendly_name: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset, limit: nil, page_size: nil) 58 self.stream( 59 end_date: end_date, 60 friendly_name: friendly_name, 61 minutes: minutes, 62 start_date: start_date, 63 task_channel: task_channel, 64 split_by_wait_time: split_by_wait_time, 65 limit: limit, 66 page_size: page_size 67 ).entries 68 end
Retrieve a single page of TaskQueuesStatisticsInstance
records from the API. Request
is executed immediately. @param [Time] end_date Only calculate statistics from this date and time and
earlier, specified in GMT as an {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time.
@param [String] friendly_name The `friendly_name` of the TaskQueue statistics to
read.
@param [String] minutes Only calculate statistics since this many minutes in the
past. The default is 15 minutes.
@param [Time] start_date Only calculate statistics from this date and time and
later, specified in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
@param [String] task_channel Only calculate statistics on this TaskChannel. Can
be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.
@param [String] split_by_wait_time A comma separated list of values that
describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed.
@param [String] page_token PageToken provided by the API @param [Integer] page_number Page
Number, this value is simply for client state @param [Integer] page_size Number of records to return, defaults to 50 @return [Page] Page
of TaskQueuesStatisticsInstance
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 150 def page(end_date: :unset, friendly_name: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 151 params = Twilio::Values.of({ 152 'EndDate' => Twilio.serialize_iso8601_datetime(end_date), 153 'FriendlyName' => friendly_name, 154 'Minutes' => minutes, 155 'StartDate' => Twilio.serialize_iso8601_datetime(start_date), 156 'TaskChannel' => task_channel, 157 'SplitByWaitTime' => split_by_wait_time, 158 'PageToken' => page_token, 159 'Page' => page_number, 160 'PageSize' => page_size, 161 }) 162 163 response = @version.page('GET', @uri, params: params) 164 165 TaskQueuesStatisticsPage.new(@version, response, @solution) 166 end
Streams TaskQueuesStatisticsInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Time] end_date Only calculate statistics from this date and time and
earlier, specified in GMT as an {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] date-time.
@param [String] friendly_name The `friendly_name` of the TaskQueue statistics to
read.
@param [String] minutes Only calculate statistics since this many minutes in the
past. The default is 15 minutes.
@param [Time] start_date Only calculate statistics from this date and time and
later, specified in {ISO 8601}[https://en.wikipedia.org/wiki/ISO_8601] format.
@param [String] task_channel Only calculate statistics on this TaskChannel. Can
be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.
@param [String] split_by_wait_time A comma separated list of values that
describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed.
@param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit.
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Enumerable] Enumerable that will yield up to limit results
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 97 def stream(end_date: :unset, friendly_name: :unset, minutes: :unset, start_date: :unset, task_channel: :unset, split_by_wait_time: :unset, limit: nil, page_size: nil) 98 limits = @version.read_limits(limit, page_size) 99 100 page = self.page( 101 end_date: end_date, 102 friendly_name: friendly_name, 103 minutes: minutes, 104 start_date: start_date, 105 task_channel: task_channel, 106 split_by_wait_time: split_by_wait_time, 107 page_size: limits[:page_size], 108 ) 109 110 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 111 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb 183 def to_s 184 '#<Twilio.Taskrouter.V1.TaskQueuesStatisticsList>' 185 end