azure-servicebus/azure/servicebus/receive_handler.py
def list_sessions(self, updated_since=None, max_results=100, skip=0):
        """List session IDs.

        List the Session IDs with pending messages in the queue where the state of the session
        has been updated since the timestamp provided. If no timestamp is provided, all will be returned.
        If the state of a Session has never been set, it will not be returned regardless of whether
        there are messages pending.

        :param updated_since: The UTC datetime from which to return updated pending Session IDs.
        :type updated_since: datetime.datetime
        :param max_results: The maximum number of Session IDs to return. Default value is 100.
        :type max_results: int
        :param skip: The page value to jump to. Default value is 0.
        :type skip: int
        :rtype: list[str]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START list_sessions]
                :end-before: [END list_sessions]
                :language: python
                :dedent: 4
                :caption: List the ids of sessions with pending messages

        """
        if int(max_results) < 1:
            raise ValueError("max_results must be 1 or greater.")

        self._can_run()
        message = {
            'last-updated-time': updated_since or datetime.datetime.utcfromtimestamp(0),
            'skip': skip,
            'top': max_results,
        }
        return self._mgmt_request_response(
            REQUEST_RESPONSE_GET_MESSAGE_SESSIONS_OPERATION,
            message,
            mgmt_handlers.list_sessions_op)
def list_sessions(self, updated_since=None, max_results=100, skip=0):
        """List session IDs.

        List the Session IDs with pending messages in the queue where the state of the session
        has been updated since the timestamp provided. If no timestamp is provided, all will be returned.
        If the state of a Session has never been set, it will not be returned regardless of whether
        there are messages pending.

        :param updated_since: The UTC datetime from which to return updated pending Session IDs.
        :type updated_since: datetime.datetime
        :param max_results: The maximum number of Session IDs to return. Default value is 100.
        :type max_results: int
        :param skip: The page value to jump to. Default value is 0.
        :type skip: int
        :rtype: list[str]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START list_sessions]
                :end-before: [END list_sessions]
                :language: python
                :dedent: 4
                :caption: List the ids of sessions with pending messages

        """
        if int(max_results) < 1:
            raise ValueError("max_results must be 1 or greater.")

        self._can_run()
        message = {
            'last-updated-time': updated_since or datetime.datetime.utcfromtimestamp(0),
            'skip': skip,
            'top': max_results,
        }
        return self._mgmt_request_response(
            REQUEST_RESPONSE_GET_MESSAGE_SESSIONS_OPERATION,
            message,
            mgmt_handlers.list_sessions_op)
List session IDs.

        List the Session IDs with pending messages in the queue where the state of the session
        has been updated since the timestamp provided. If no timestamp is provided, all will be returned.
        If the state of a Session has never been set, it will not be returned regardless of whether
        there are messages pending.

        :param updated_since: The UTC datetime from which to return updated pending Session IDs.
        :type updated_since: datetime.datetime
        :param max_results: The maximum number of Session IDs to return. Default value is 100.
        :type max_results: int
        :param skip: The page value to jump to. Default value is 0.
        :type skip: int
        :rtype: list[str]

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START list_sessions]
                :end-before: [END list_sessions]
                :language: python
                :dedent: 4
                :caption: List the ids of sessions with pending messages