(self, data)
Deserialize a credential object from bytes.

        Args:
            data (bytes): serialized credential object.

        Raises:
            TypeError: if the data is not in bytes.
Deserialize a credential object from bytes.
Deserialize a credential object from bytes .
def from_bytes(self, data):
        """Deserialize a credential object from bytes.

        Args:
            data (bytes): serialized credential object.

        Raises:
            TypeError: if the data is not in bytes.
        """
        if not isinstance(data, bytes):
            raise TypeError('Data needs to be bytes.')

        try:
            token_dict = json.loads(data.decode('utf-8'))
        except ValueError as exc:
            raise TypeError('Unable to parse the byte string.') from exc

        self._credential = credentials.Credentials(
            token=token_dict.get('token'),
            refresh_token=token_dict.get('_refresh_token'),
            id_token=token_dict.get('_id_token'),
            token_uri=token_dict.get('_token_uri'),
            client_id=token_dict.get('_client_id'),
            client_secret=token_dict.get('_client_secret')
        )
def from_bytes ( self , data ) : if not isinstance ( data , bytes ) : raise TypeError ( 'Data needs to be bytes.' ) try : token_dict = json . loads ( data . decode ( 'utf-8' ) ) except ValueError as exc : raise TypeError ( 'Unable to parse the byte string.' ) from exc self . _credential = credentials . Credentials ( token = token_dict . get ( 'token' ) , refresh_token = token_dict . get ( '_refresh_token' ) , id_token = token_dict . get ( '_id_token' ) , token_uri = token_dict . get ( '_token_uri' ) , client_id = token_dict . get ( '_client_id' ) , client_secret = token_dict . get ( '_client_secret' ) )