U
    #FZh	  ã                   @   sL   d Z ddlZddlmZ ddlmZ eedœdd„Zejeddœd	d
„ZdS )z-Helper functions for commonly used utilities.é    N)ÚAny)Ú_helpers)ÚresponseÚreturnc                 Ã   s0   z|   ¡ I dH }|W S  tk
r*   Y dS X dS )aà  
    Parses an async response, attempting to decode JSON.

    Args:
        response: The response object to parse. This can be any type, but
            it is expected to have a `json()` method if it contains JSON.

    Returns:
        The parsed response. If the response contains valid JSON, the
        decoded JSON object (e.g., a dictionary) is returned.
        If the response does not have a `json()` method or if the JSON
        decoding fails, None is returned.
    N)ÚjsonÚ	Exception)r   Újson_response© r	   ú_/home/aprabhat/apps/x.techxrdev.in/venv/lib/python3.8/site-packages/google/auth/aio/_helpers.pyÚ_parse_response_async   s
    r   )Úloggerr   r   c                 Ã   s   t  | ¡rd}t  | |¡ dS )zÁ
    Logs an Async HTTP response at the DEBUG level if logging is enabled.

    Args:
        logger: The logging.Logger instance to use.
        response: The HTTP response object to log.
    N)r   Zis_logging_enabledZ_response_log_base)r   r   r   r	   r	   r
   Úresponse_log_async/   s    
r   )	Ú__doc__ÚloggingÚtypingr   Zgoogle.authr   r   ÚLoggerr   r	   r	   r	   r
   Ú<module>   s
   