lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb in twilio-ruby-5.73.0 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb in twilio-ruby-5.73.1

- old
+ new

@@ -46,26 +46,28 @@ # match a potential queue. # @param [String] task_queue_name The `friendly_name` of the TaskQueue that the # Workers to read are eligible for. # @param [String] task_queue_sid The SID of the TaskQueue that the Workers to read # are eligible for. + # @param [String] ordering Sorting parameter for Workers # @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 - def list(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, limit: nil, page_size: nil) + def list(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, ordering: :unset, limit: nil, page_size: nil) self.stream( activity_name: activity_name, activity_sid: activity_sid, available: available, friendly_name: friendly_name, target_workers_expression: target_workers_expression, task_queue_name: task_queue_name, task_queue_sid: task_queue_sid, + ordering: ordering, limit: limit, page_size: page_size ).entries end @@ -87,28 +89,30 @@ # match a potential queue. # @param [String] task_queue_name The `friendly_name` of the TaskQueue that the # Workers to read are eligible for. # @param [String] task_queue_sid The SID of the TaskQueue that the Workers to read # are eligible for. + # @param [String] ordering Sorting parameter for Workers # @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 - def stream(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, limit: nil, page_size: nil) + def stream(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, ordering: :unset, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( activity_name: activity_name, activity_sid: activity_sid, available: available, friendly_name: friendly_name, target_workers_expression: target_workers_expression, task_queue_name: task_queue_name, task_queue_sid: task_queue_sid, + ordering: ordering, page_size: limits[:page_size], ) @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) end @@ -144,22 +148,24 @@ # match a potential queue. # @param [String] task_queue_name The `friendly_name` of the TaskQueue that the # Workers to read are eligible for. # @param [String] task_queue_sid The SID of the TaskQueue that the Workers to read # are eligible for. + # @param [String] ordering Sorting parameter for Workers # @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 WorkerInstance - def page(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset) + def page(activity_name: :unset, activity_sid: :unset, available: :unset, friendly_name: :unset, target_workers_expression: :unset, task_queue_name: :unset, task_queue_sid: :unset, ordering: :unset, page_token: :unset, page_number: :unset, page_size: :unset) params = Twilio::Values.of({ 'ActivityName' => activity_name, 'ActivitySid' => activity_sid, 'Available' => available, 'FriendlyName' => friendly_name, 'TargetWorkersExpression' => target_workers_expression, 'TaskQueueName' => task_queue_name, 'TaskQueueSid' => task_queue_sid, + 'Ordering' => ordering, 'PageToken' => page_token, 'Page' => page_number, 'PageSize' => page_size, }) \ No newline at end of file