o
    Xib                     @   sL  d dl Z d dlmZmZ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 d dlmZ G dd deZG dd deZz
eee dZW n eyo   dZY nw z
eee d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 )    N)AnyProtocolcast)FastAPIDeprecationWarning)EventSourceResponse)FileResponse)HTMLResponse)JSONResponse)PlainTextResponse)RedirectResponse)Response)StreamingResponse)
deprecatedc                   @   s(   e Zd ZdddededefddZdS )	_UjsonModule.ensure_ascii_UjsonModule__objr   returnc                C      d S N )selfr   r   r   r   </usr/local/lib/python3.10/site-packages/fastapi/responses.pydumps       z_UjsonModule.dumpsN)__name__
__module____qualname__r   boolstrr   r   r   r   r   r      s     r   c                   @   s:   e Zd ZU eed< eed< dddededefdd	Zd
S )_OrjsonModuleOPT_NON_STR_KEYSOPT_SERIALIZE_NUMPY.option_OrjsonModule__objr$   r   c                C   r   r   r   )r   r%   r$   r   r   r   r      r   z_OrjsonModule.dumpsN)r   r   r   int__annotations__r   bytesr   r   r   r   r   r       s   
  r    ujsonorjsonal  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`.
    contentr   c                 C   s$   t d usJ dt j|dddS )Nz,ujson must be installed to use UJSONResponseFr   zutf-8)r)   r   encoder   r0   r   r   r   render@   s   zUJSONResponse.renderNr   r   r   __doc__r   r(   r3   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`.
    r0   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 ORJSONResponser#   )r*   r   r!   r"   r2   r   r   r   r3   ^   s   zORJSONResponse.renderNr4   r   r   r   r   r7   E   r6   r7   )	importlibtypingr   r   r   Zfastapi.exceptionsr   Zfastapi.sser   Zstarlette.responsesr   r   r	   r
   r   r   r   Ztyping_extensionsr   r   r    import_moduler)   ModuleNotFoundErrorr*   r/   r7   r   r   r   r   <module>   sH    		