##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Taskrouter
#    This is the public Twilio REST API.
#
#    NOTE: This class is auto generated by OpenAPI Generator.
#    https://openapi-generator.tech
#    Do not edit the class manually.
#


module Twilio
    module REST
        class Taskrouter < TaskrouterBase
            class V1 < Version
                class WorkspaceContext < InstanceContext
                class TaskQueueList < ListResource

                     class TaskQueueBulkRealTimeStatisticsList < ListResource
                
                    ##
                    # Initialize the TaskQueueBulkRealTimeStatisticsList
                    # @param [Version] version Version that contains the resource
                    # @return [TaskQueueBulkRealTimeStatisticsList] TaskQueueBulkRealTimeStatisticsList
                    def initialize(version, workspace_sid: nil)
                        super(version)
                        # Path Solution
                        @solution = { workspace_sid: workspace_sid }
                        @uri = "/Workspaces/#{@solution[:workspace_sid]}/TaskQueues/RealTimeStatistics"
                        
                    end
                    ##
                    # Create the TaskQueueBulkRealTimeStatisticsInstance
                    # @param [Object] body 
                    # @return [TaskQueueBulkRealTimeStatisticsInstance] Created TaskQueueBulkRealTimeStatisticsInstance
                    def create(body: :unset
                    )

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        headers['Content-Type'] = 'application/json'
                        
                        
                        
                        
                        payload = @version.create('POST', @uri, headers: headers, data: body.to_json)
                        TaskQueueBulkRealTimeStatisticsInstance.new(
                            @version,
                            payload,
                            workspace_sid: @solution[:workspace_sid],
                        )
                    end

                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsList>'
                    end
                end

                class TaskQueueBulkRealTimeStatisticsPage < Page
                    ##
                    # Initialize the TaskQueueBulkRealTimeStatisticsPage
                    # @param [Version] version Version that contains the resource
                    # @param [Response] response Response from the API
                    # @param [Hash] solution Path solution for the resource
                    # @return [TaskQueueBulkRealTimeStatisticsPage] TaskQueueBulkRealTimeStatisticsPage
                    def initialize(version, response, solution)
                        super(version, response)

                        # Path Solution
                        @solution = solution
                    end

                    ##
                    # Build an instance of TaskQueueBulkRealTimeStatisticsInstance
                    # @param [Hash] payload Payload response from the API
                    # @return [TaskQueueBulkRealTimeStatisticsInstance] TaskQueueBulkRealTimeStatisticsInstance
                    def get_instance(payload)
                        TaskQueueBulkRealTimeStatisticsInstance.new(@version, payload, workspace_sid: @solution[:workspace_sid])
                    end

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsPage>'
                    end
                end
                class TaskQueueBulkRealTimeStatisticsInstance < InstanceResource
                    ##
                    # Initialize the TaskQueueBulkRealTimeStatisticsInstance
                    # @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 TaskQueueBulkRealTimeStatistics
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [TaskQueueBulkRealTimeStatisticsInstance] TaskQueueBulkRealTimeStatisticsInstance
                    def initialize(version, payload , workspace_sid: nil)
                        super(version)
                        
                        # Marshaled Properties
                        @properties = { 
                            'account_sid' => payload['account_sid'],
                            'workspace_sid' => payload['workspace_sid'],
                            'task_queue_data' => payload['task_queue_data'],
                            'task_queue_response_count' => payload['task_queue_response_count'] == nil ? payload['task_queue_response_count'] : payload['task_queue_response_count'].to_i,
                            'url' => payload['url'],
                        }
                    end

                    
                    ##
                    # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource.
                    def account_sid
                        @properties['account_sid']
                    end
                    
                    ##
                    # @return [String] The SID of the Workspace that contains the TaskQueue.
                    def workspace_sid
                        @properties['workspace_sid']
                    end
                    
                    ##
                    # @return [Array<Hash>] The real-time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes:  `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated.  `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue.  `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state.  `total_tasks`: The total number of Tasks.  `longest_task_waiting_age`: The age of the longest waiting Task.  `longest_task_waiting_sid`: The SID of the longest waiting Task.  `tasks_by_status`: The number of Tasks grouped by their current status.  `tasks_by_priority`: The number of Tasks grouped by priority.  `activity_statistics`: The number of current Workers grouped by Activity. 
                    def task_queue_data
                        @properties['task_queue_data']
                    end
                    
                    ##
                    # @return [String] The number of TaskQueue statistics received in task_queue_data.
                    def task_queue_response_count
                        @properties['task_queue_response_count']
                    end
                    
                    ##
                    # @return [String] The absolute URL of the TaskQueue statistics resource.
                    def url
                        @properties['url']
                    end
                    
                    ##
                    # Provide a user friendly representation
                    def to_s
                        "<Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsInstance>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        "<Twilio.Taskrouter.V1.TaskQueueBulkRealTimeStatisticsInstance>"
                    end
                end

             end
             end
            end
        end
    end
end


