async def METHOD_NAME(
    self, state: Optional[Union[str, bytes, bytearray]], *, timeout: Optional[float] = None, **kwargs: Any
) -> None:
    """Set the session state.
    :param state: The state value.
    :type state: str or bytes or bytearray or None
    :keyword float or None timeout: The total operation timeout in seconds including all the retries.
     The value must be greater than 0 if specified. The default value is None, meaning no timeout.
    :return: Response of callback
    :rtype: any
    .. admonition:: Example:
        .. literalinclude:: ../samples/async_samples/sample_code_servicebus_async.py
            :start-after: [START set_session_state_async]
            :end-before: [END set_session_state_async]
            :language: python
            :dedent: 4
            :caption: Set the session state
    """
    if kwargs:
        warnings.warn(f"Unsupported keyword args: {kwargs}")
    self._receiver._check_live()  # pylint: disable=protected-access
    if timeout is not None and timeout <= 0:
        raise ValueError("The timeout must be greater than 0.")
    state = (
        state.encode(self._encoding) if isinstance(state, str) else state
    )
    return await self._receiver._mgmt_request_response_with_retry(  # pylint: disable=protected-access
        REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
        {
            MGMT_REQUEST_SESSION_ID: self._session_id,
            MGMT_REQUEST_SESSION_STATE: bytearray(state) if state is not None else None,
        },
        mgmt_handlers.default,
        timeout=timeout,
    )