o
    ci3                     @   s   d dl mZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dlm
Z
 d d	lmZ d d
lmZ zd dlZW n eyM   dZY nw zd dlZW n ey_   dZY nw ededdG dd deZededdG dd deZdS )    )Any)FastAPIDeprecationWarning)FileResponse)HTMLResponse)JSONResponse)PlainTextResponse)RedirectResponse)Response)StreamingResponse)
deprecatedNal  UJSONResponse is deprecated, FastAPI now serializes data directly to JSON bytes via Pydantic when a return type or response model is set, which is faster and doesn't need a custom response class. Read more in the FastAPI docs: https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model and https://fastapi.tiangolo.com/tutorial/response-model/   )category
stacklevelc                   @   "   e Zd ZdZdedefddZdS )UJSONResponsea  JSON response using the ujson library to serialize data to JSON.

    **Deprecated**: `UJSONResponse` is deprecated. FastAPI now serializes data
    directly to JSON bytes via Pydantic when a return type or response model is
    set, which is faster and doesn't need a custom response class.

    Read more in the
    [FastAPI docs for Custom Response](https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model)
    and the
    [FastAPI docs for Response Model](https://fastapi.tiangolo.com/tutorial/response-model/).

    **Note**: `ujson` is not included with FastAPI and must be installed
    separately, e.g. `pip install ujson`.
    contentreturnc                 C   s$   t d usJ dt j|dddS )Nz,ujson must be installed to use UJSONResponseF)ensure_asciizutf-8)ujsondumpsencodeselfr    r   S/sda-disk/www/egybert/egybert_env/lib/python3.10/site-packages/fastapi/responses.pyrender2   s   zUJSONResponse.renderN__name__
__module____qualname____doc__r   bytesr   r   r   r   r   r          
r   am  ORJSONResponse is deprecated, FastAPI now serializes data directly to JSON bytes via Pydantic when a return type or response model is set, which is faster and doesn't need a custom response class. Read more in the FastAPI docs: https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model and https://fastapi.tiangolo.com/tutorial/response-model/c                   @   r   )ORJSONResponsea  JSON response using the orjson library to serialize data to JSON.

    **Deprecated**: `ORJSONResponse` is deprecated. FastAPI now serializes data
    directly to JSON bytes via Pydantic when a return type or response model is
    set, which is faster and doesn't need a custom response class.

    Read more in the
    [FastAPI docs for Custom Response](https://fastapi.tiangolo.com/advanced/custom-response/#orjson-or-response-model)
    and the
    [FastAPI docs for Response Model](https://fastapi.tiangolo.com/tutorial/response-model/).

    **Note**: `orjson` is not included with FastAPI and must be installed
    separately, e.g. `pip install orjson`.
    r   r   c                 C   s&   t d usJ dt j|t jt jB dS )Nz.orjson must be installed to use ORJSONResponse)option)orjsonr   OPT_NON_STR_KEYSOPT_SERIALIZE_NUMPYr   r   r   r   r   P   s   zORJSONResponse.renderNr   r   r   r   r   r#   7   r"   r#   )typingr   fastapi.exceptionsr   starlette.responsesr   r   r   r   r   r	   r
   typing_extensionsr   r   ImportErrorr%   r   r#   r   r   r   r   <module>   s@    		