
    T>qj1                     *   g d Z ddlmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZmZ ddlmZ dd	lmZmZ dd
lmZmZmZ ddlmZmZ ddlmZmZmZmZmZmZm Z m!Z! ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z) er G d de d      Z*neZ*	 	 	 d$dede+dee   dee,   dee-   de!e    defdZ.de+de!e*   defdZ/de+de!e*   defdZ0de+de!e*   defdZ1de+de!e*   defdZ2de+de!e*   defdZ3de+de!e*   defd Z4de+de!e*   defd!Z5de+de!e*   defd"Z6de+de!e*   defd#Z7y)%) SessionAsyncSessionBrowserTypeBrowserTypeLiteral
CurlWsFlagrequestheadgetpostputpatchdeleteoptionsRequestsErrorCookiesHeadersRequestResponseAsyncWebSocket	WebSocketWebSocketErrorWebSocketClosedWebSocketTimeoutWebSocketRetryStrategyWsCloseCodeExtraFingerprintsRetryStrategyCacheBackendFileCacheBackendCookieTypesHeaderTypes	ProxySpec    )OptionalTYPE_CHECKING	TypedDict   )r      )r   r   )r   r   )r   )r   r    )r   r   r   )r   r   )r   
HttpMethodr!   r   r   
ThreadTypeRequestParamsUnpack)r   r   r   r   r   r   r   c                   >    e Zd ZU ee   ed<   ee   ed<   ee   ed<   y)SessionRequestParamsthreadcurl_optionsdebugN)__name__
__module____qualname__r#   r)   __annotations__dictbool     Z/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/curl_cffi/requests/__init__.pyr-   r-   C   s!    $$tn$~r8   r-   F)totalNmethodurlr.   r/   r0   kwargsreturnc                     |dn|}t        |||      5 } |j                  d| |d|cddd       S # 1 sw Y   yxY w)a  Send an http request.

    Parameters:
        method: http method for the request: GET/POST/PUT/DELETE etc.
        url: url for the requests.
        params: query string for the requests.
        data: form values(dict/list/tuple) or binary data to use in body,
            ``Content-Type: application/x-www-form-urlencoded`` will be added if a dict
            is given.
        content: raw request body as str, bytes, a byte iterable, or a binary file.
            ``AsyncSession`` also accepts an async byte iterable.
        json: json values to use in body, `Content-Type: application/json` will be added
            automatically.
        headers: headers to send.
        cookies: cookies to use.
        files: not supported, use ``multipart`` instead.
        auth: HTTP basic auth, a tuple of (username, password), only basic auth is
            supported.
        timeout: how many seconds to wait before giving up.
        allow_redirects: whether to allow redirection.
        max_redirects: max redirect counts, default 30, use -1 for unlimited.
        proxies: dict of proxies to use, prefer to use ``proxy`` if they are the same.
            format: ``{"http": proxy_url, "https": proxy_url}``.
        proxy: proxy to use, format: "http://user@pass:proxy_url".
            Can't be used with `proxies` parameter.
        proxy_auth: HTTP basic auth for proxy, a tuple of (username, password).
        verify: whether to verify https certs.
        referer: shortcut for setting referer header.
        accept_encoding: shortcut for setting accept-encoding header.
        content_callback: a callback function to receive response body.
            ``def callback(chunk: bytes) -> None:``
        impersonate: which browser version or fingerprint to impersonate.
        ja3: ja3 string to impersonate.
        akamai: akamai string to impersonate.
        extra_fp: extra fingerprints options, in complement to ja3 and akamai strings.
        thread: thread engine to use for working with other thread implementations.
            choices: eventlet, gevent.
        default_headers: whether to set default browser headers when impersonating.
        default_encoding: encoding for decoding response content if charset is not found
            in headers. Defaults to "utf-8". Can be set to a callable for automatic
            detection.
        quote: Set characters to be quoted, i.e. percent-encoded. Default safe string
            is ``!#$%&'()*+,/:;=?@[]~``. If set to a sting, the character will be
            removed from the safe string, thus quoted. If set to False, the url will be
            kept as is, without any automatic percent-encoding, you must encode the URL
            yourself.
        curl_options: extra curl options to use.
        http_version: limiting http version, defaults to http2.
        debug: print extra curl debug info.
        interface: interface name or local IP to bind to (bare IP = source address).
        cert: a tuple of (cert, key) filenames for client cert.
        stream: streaming the response, default False.
        max_recv_speed: maximum receive speed, bytes per second.
        multipart: upload files using the multipart format, see examples for details.
        discard_cookies: discard cookies from server. Default to False.

    Returns:
        A ``Response`` object.
    NF)r.   r/   r0   r;   r<   r7   )r   r   )r;   r<   r.   r/   r0   r=   ss          r9   r   r   L   sK    F ]EE	\	G ;1qyy:C:6:; ; ;s   4=c                     t        dd| d|S )NHEADr@   r7   r   r<   r=   s     r9   r   r          4&c4V44r8   c                     t        dd| d|S )NGETr@   r7   rD   rE   s     r9   r	   r	          3%S3F33r8   c                     t        dd| d|S )NPOSTr@   r7   rD   rE   s     r9   r
   r
      rF   r8   c                     t        dd| d|S )NPUTr@   r7   rD   rE   s     r9   r   r      rI   r8   c                     t        dd| d|S )NPATCHr@   r7   rD   rE   s     r9   r   r          5's5f55r8   c                     t        dd| d|S )NDELETEr@   r7   rD   rE   s     r9   r   r      s    6(6v66r8   c                     t        dd| d|S )NOPTIONSr@   r7   rD   rE   s     r9   r   r      s    7)777r8   c                     t        dd| d|S )NTRACEr@   r7   rD   rE   s     r9   tracerW      rP   r8   c                     t        dd| d|S )NQUERYr@   r7   rD   rE   s     r9   queryrZ      rP   r8   )NNN)8__all__typingr#   r$   r%   constr   cacher   r   cookiesr   r   errorsr   headersr   r    impersonater   r   r   modelsr   r   sessionr   r(   r!   r   r   r)   r*   r+   
websocketsr   r   r   r   r   r   r   r-   strr5   r6   r   r   r	   r
   r   r   r   r   rW   rZ   r7   r8   r9   <module>rg      s  !F 6 5  1 ) ! ) K K %	 	 	   }E  % $(#' E;E;	E; Z E; 4.	E;
 D>E; ]#E; E;P5c 5V$89 5h 54S 4F#78 4X 45c 5V$89 5h 54S 4F#78 4X 46s 6f%9: 6x 67 7v&:; 7 78 8'; < 8 86s 6f%9: 6x 66s 6f%9: 6x 6r8   