o
    U!h                     @   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	 zd d	l
Z
W n eyA   d	Z
Y nw zd d	lZW n eyS   d	ZY nw G d
d deZG dd deZd	S )    )Any)FileResponse)HTMLResponse)JSONResponse)PlainTextResponse)RedirectResponse)Response)StreamingResponseNc                   @   "   e Zd ZdZdedefddZdS )UJSONResponsez
    JSON response using the high-performance ujson library to serialize data to JSON.

    Read more about it in the
    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    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   /var/www/html/contec/backend/tec.wsc/Coding/backend/Contec_Project_backend/env/lib/python3.10/site-packages/fastapi/responses.pyrender   s   zUJSONResponse.renderN__name__
__module____qualname____doc__r   bytesr   r   r   r   r   r          r   c                   @   r
   )ORJSONResponsez
    JSON response using the high-performance orjson library to serialize data to JSON.

    Read more about it in the
    [FastAPI docs for Custom Response - HTML, Stream, File, others](https://fastapi.tiangolo.com/advanced/custom-response/).
    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   ,   s   zORJSONResponse.renderNr   r   r   r   r   r   $   r   r   )typingr   starlette.responsesr   r   r   r   r   r   r	   r   ImportErrorr    r   r   r   r   r   r   <module>   s(    