piwebasync/websockets/client.py
def _verify_request(
        self,
        request: APIRequest
    ) -> None:
        """
        Validates request type and also validates client can handle request

        Raises:
            - TypeError: request is not an instance of APIRequest
            - ValueError: client does not support this request
        """
        
        if not isinstance(request, APIRequest):
            raise TypeError(f"'request' must be instance of APIRequest. Got {type(request)}")
        if request.method != "GET":
            raise ValueError(
                f"Invalid method for request. Must use 'GET' request. "
                f"Got '{request.method}'"
            )
        if request.protocol != "Websocket":
            raise ValueError(
                f"Invalid protocol for {self.__class__.__name__}. Expected 'Websocket', "
                f"got '{request.protocol}'. If this is a HTTP request, use the HTTPClient"
            )

        Validates request type and also validates client can handle request

        Raises:
            - TypeError: request is not an instance of APIRequest
            - ValueError: client does not support this request
        
Validates request type and also validates client can handle request
Validates request type and also validates client can handle request
def _verify_request(
        self,
        request: APIRequest
    ) -> None:
        if not isinstance(request, APIRequest):
            raise TypeError(f"'request' must be instance of APIRequest. Got {type(request)}")
        if request.method != "GET":
            raise ValueError(
                f"Invalid method for request. Must use 'GET' request. "
                f"Got '{request.method}'"
            )
        if request.protocol != "Websocket":
            raise ValueError(
                f"Invalid protocol for {self.__class__.__name__}. Expected 'Websocket', "
                f"got '{request.protocol}'. If this is a HTTP request, use the HTTPClient"
            )
def _verify_request ( self , request : APIRequest ) -> None : if not isinstance ( request , APIRequest ) : raise TypeError ( f"'request' must be instance of APIRequest. Got {type(request)}" ) if request . method != "GET" : raise ValueError ( f"Invalid method for request. Must use 'GET' request. " f"Got '{request.method}'" ) if request . protocol != "Websocket" : raise ValueError ( f"Invalid protocol for {self.__class__.__name__}. Expected 'Websocket', " f"got '{request.protocol}'. If this is a HTTP request, use the HTTPClient" )
Validates request type and also validates client can handle request
Validates request type and also validates client can handle request
"""
        Validates request type and also validates client can handle request

        Raises:
            - TypeError: request is not an instance of APIRequest
            - ValueError: client does not support this request
        """
request is not an instance of APIRequest
request is not an instance of APIRequest
- TypeError
client does not support this request
client does not support this request
- ValueError
self
request
APIRequest