lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb in twilio-ruby-5.0.0.rc9 vs lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb in twilio-ruby-5.0.0.rc10

- old
+ new

@@ -12,11 +12,10 @@ class TaskQueueList < ListResource ## # Initialize the TaskQueueList # @param [Version] version Version that contains the resource # @param [String] workspace_sid The workspace_sid - # @return [TaskQueueList] TaskQueueList def initialize(version, workspace_sid: nil) super(version) # Path Solution @@ -39,11 +38,10 @@ # 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(friendly_name: nil, evaluate_worker_attributes: nil, limit: nil, page_size: nil) self.stream( friendly_name: friendly_name, evaluate_worker_attributes: evaluate_worker_attributes, @@ -62,11 +60,10 @@ # 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(friendly_name: nil, evaluate_worker_attributes: nil, limit: nil, page_size: nil) limits = @version.read_limits(limit, page_size) page = self.page( @@ -108,11 +105,10 @@ # @param [String] friendly_name The friendly_name # @param [String] evaluate_worker_attributes The evaluate_worker_attributes # @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 TaskQueueInstance def page(friendly_name: nil, evaluate_worker_attributes: nil, page_token: nil, page_number: nil, page_size: nil) params = { 'FriendlyName' => friendly_name, 'EvaluateWorkerAttributes' => evaluate_worker_attributes, @@ -134,11 +130,10 @@ # @param [String] friendly_name The friendly_name # @param [String] reservation_activity_sid The reservation_activity_sid # @param [String] assignment_activity_sid The assignment_activity_sid # @param [String] target_workers The target_workers # @param [String] max_reserved_workers The max_reserved_workers - # @return [TaskQueueInstance] Newly created TaskQueueInstance def create(friendly_name: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, target_workers: nil, max_reserved_workers: nil) data = { 'FriendlyName' => friendly_name, 'ReservationActivitySid' => reservation_activity_sid, @@ -154,11 +149,11 @@ ) return TaskQueueInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], + workspace_sid: @solution[:workspace_sid], ) end ## # Access the statistics @@ -182,11 +177,10 @@ # Initialize the TaskQueuePage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @param [String] workspace_sid The workspace_sid - # @return [TaskQueuePage] TaskQueuePage def initialize(version, response, solution) super(version, response) # Path Solution @@ -194,17 +188,16 @@ end ## # Build an instance of TaskQueueInstance # @param [Hash] payload Payload response from the API - # @return [TaskQueueInstance] TaskQueueInstance def get_instance(payload) return TaskQueueInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], + workspace_sid: @solution[:workspace_sid], ) end ## # Provide a user friendly representation @@ -217,11 +210,10 @@ ## # Initialize the TaskQueueContext # @param [Version] version Version that contains the resource # @param [String] workspace_sid The workspace_sid # @param [String] sid The sid - # @return [TaskQueueContext] TaskQueueContext def initialize(version, workspace_sid, sid) super(version) # Path Solution @@ -248,23 +240,22 @@ ) return TaskQueueInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], - sid: @solution['sid'], + workspace_sid: @solution[:workspace_sid], + sid: @solution[:sid], ) end ## # Update the TaskQueueInstance # @param [String] friendly_name The friendly_name # @param [String] target_workers The target_workers # @param [String] reservation_activity_sid The reservation_activity_sid # @param [String] assignment_activity_sid The assignment_activity_sid # @param [String] max_reserved_workers The max_reserved_workers - # @return [TaskQueueInstance] Updated TaskQueueInstance def update(friendly_name: nil, target_workers: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, max_reserved_workers: nil) data = { 'FriendlyName' => friendly_name, 'TargetWorkers' => target_workers, @@ -280,12 +271,12 @@ ) return TaskQueueInstance.new( @version, payload, - workspace_sid: @solution['workspace_sid'], - sid: @solution['sid'], + workspace_sid: @solution[:workspace_sid], + sid: @solution[:sid], ) end ## # Deletes the TaskQueueInstance @@ -318,11 +309,10 @@ # Initialize the TaskQueueInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] workspace_sid The workspace_sid # @param [String] sid The sid - # @return [TaskQueueInstance] TaskQueueInstance def initialize(version, payload, workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @@ -352,11 +342,10 @@ ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @param [Version] version Version that contains the resource - # @return [TaskQueueContext] TaskQueueContext for this TaskQueueInstance def context unless @instance_context @instance_context = TaskQueueContext.new( @version, @@ -421,24 +410,24 @@ ## # Fetch a TaskQueueInstance # @return [TaskQueueInstance] Fetched TaskQueueInstance def fetch - @context.fetch() + context.fetch end ## # Update the TaskQueueInstance # @param [String] friendly_name The friendly_name # @param [String] target_workers The target_workers # @param [String] reservation_activity_sid The reservation_activity_sid # @param [String] assignment_activity_sid The assignment_activity_sid # @param [String] max_reserved_workers The max_reserved_workers - # @return [TaskQueueInstance] Updated TaskQueueInstance def update(friendly_name: nil, target_workers: nil, reservation_activity_sid: nil, assignment_activity_sid: nil, max_reserved_workers: nil) - @context.update( + context.update( + friendly_name: friendly_name, target_workers: target_workers, reservation_activity_sid: reservation_activity_sid, assignment_activity_sid: assignment_activity_sid, max_reserved_workers: max_reserved_workers, ) @@ -446,24 +435,24 @@ ## # Deletes the TaskQueueInstance # @return [Boolean] true if delete succeeds, true otherwise def delete - @context.delete() + context.delete end ## # Access the statistics # @return [statistics] statistics def statistics - @context.statistics + context.statistics end ## # Provide a user friendly representation def to_s - context = @params.map{|k, v| "#{k}: #{v}"}.join(" ") - "<Twilio.Taskrouter.V1.TaskQueueInstance #{context}>" + values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") + "<Twilio.Taskrouter.V1.TaskQueueInstance #{values}>" end end end end end \ No newline at end of file