a
    &ñ»jo3  ã                   @  s.  d dl mZ d dlmZmZ ddlmZ ddlmZ ddl	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mZmZmZmZmZmZ dZd	d	d	d	d	d	d	d	eeed
eeee
d	dœdddddddddddddddddddddœdd„Z d	d	d	d	d	eeed
eeee
d	dœddddddddddd dddddd!œd"d#„Z!d	d	d	d	d	eeed
eeee
d	dœddddddddddd dddddd!œd$d%„Z"d	d	d	d	d	eeed
eeee
d	dœddddddddddd dddddd!œd&d'„Z#d	d	d	d	d	d	d	d	eeed
eeee
d	d(œdddd)dddddddddd dddddd*œd+d,„Z$d	d	d	d	d	d	d	d	eeed
eeee
d	d(œdddd)dddddddddd dddddd*œd-d.„Z%d	d	d	d	d	d	d	d	eeed
eeee
d	d(œdddd)dddddddddd dddddd*œd/d0„Z&d	d	d	d	d	eeed
eeee
d	dœddddddddddd dddddd!œd1d2„Z'd	S )3é    )Úannotations)ÚAnyÚOptionalé   )ÚClient)ÚResponse)ÚDEFAULT_ALLOW_HTTPÚDEFAULT_CLIENT_IDENTIFIERÚDEFAULT_DEBUGÚDEFAULT_FOLLOW_REDIRECTSÚDEFAULT_HTTP2ÚDEFAULT_PROTOCOL_RACINGÚDEFAULT_TIMEOUT)Ú	AuthTypesÚCookieTypesÚHeaderTypesÚIdentifierArgTypesÚIdentifierTypesÚMethodTypesÚProtocolTypesÚ
ProxyTypesÚRequestDataÚRequestFilesÚTimeoutTypesÚURLParamTypesÚURLTypes)ÚdeleteÚgetÚheadÚoptionsÚpatchÚpostÚputÚrequestNT)ÚparamsÚdataÚfilesÚjsonÚheadersÚcookiesÚauthÚproxyÚhttp2ÚtimeoutÚfollow_redirectsÚverifyÚclient_identifierÚdebugÚprotocol_racingÚ
allow_httpÚ	stream_idr   r   r   zOptional[RequestData]zOptional[RequestFiles]r   r   r   r   r   r   r   Úboolr   zOptional[int]r   )ÚmethodÚurlr$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   Úreturnc                K  sl   t f ||	|
|||||||dœ
|¤Ž�4}|j| ||||||||||||d�W  d  ƒ S 1 s^0    Y  dS )a¶  
        Constructs and sends an HTTP request.

        This method builds a `Request` object based on the given parameters, sends
        it using the configured client, and returns the server's response.

        Parameters:
            - **method** (str): HTTP method to use (e.g., `"GET"`, `"POST"`).
            - **url** (URLTypes): The URL to send the request to.
            - **params** (optional): Query parameters to include in the request URL.
            - **data** (optional): Form data to include in the request body.
            - **json** (optional): A JSON serializable object to include in the request body.
            - **headers** (optional): Custom headers to include in the request.
            - **cookies** (optional): Cookies to include with the request.
            - **files** (optional): Files to upload in a multipart request.
            - **auth** (optional): Authentication credentials or handler.
            - **timeout** (optional): Timeout configuration for the request.
            - **follow_redirects** (optional): Whether to follow HTTP redirects.

        Returns:
            - **Response**: The client's response to the HTTP request.

        Usage:
            ```python

    import tls_requests
                >>> with tls_requests.Client() as sync_client:
                        r = sync_client.request('GET', 'https://httpbin.org/get')
                >>> r
                <Response [200]>
            ```
    )
r)   r+   r,   r-   r/   r0   r1   r2   r3   r4   )r6   r7   r%   r&   r'   r$   r(   r*   r.   r-   r2   r3   r4   N)r   r#   )r6   r7   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   ÚconfigÚclient© r;   ú6E:\soccer\ml_env\Lib\site-packages\tls_requests/api.pyr#   ,   s<    8öõór#   ©r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r   )r7   r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r8   c                K  s0   t d| f|||||||||	|
||||dœ|¤ŽS )zò
    Sends a `GET` request.

    **Parameters**: See `tls_requests.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `GET` requests should not include a request body.
    ÚGET©r$   r(   r)   r*   r+   r,   r.   r-   r/   r0   r1   r2   r3   r4   ©r#   ©r7   r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r9   r;   r;   r<   r   ‚   s*    þðïr   c                K  s0   t d| f|||||||||	|
||||dœ|¤ŽS )zû
    Sends an `OPTIONS` request.

    **Parameters**: See `tls_requests.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `OPTIONS` requests should not include a request body.
    ÚOPTIONSr?   r@   rA   r;   r;   r<   r   ²   s*    þðïr   c                K  s0   t d| f|||||||||	|
||||dœ|¤ŽS )zô
    Sends a `HEAD` request.

    **Parameters**: See `tls_requests.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `HEAD` requests should not include a request body.
    ÚHEADr=   r@   rA   r;   r;   r<   r   â   s*    þðïr   ©r%   r&   r'   r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   zOptional[Any])r7   r%   r&   r'   r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r8   c                K  s6   t d| f|||||||||	|
|||||||dœ|¤ŽS )zR
    Sends a `POST` request.

    **Parameters**: See `tls_requests.request`.
    ÚPOSTrD   r@   ©r7   r%   r&   r'   r$   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r9   r;   r;   r<   r!     s0    þíìr!   c                K  s6   t d| f|||||||||	|
|||||||dœ|¤ŽS )zQ
    Sends a `PUT` request.

    **Parameters**: See `tls_requests.request`.
    ÚPUTrD   r@   rF   r;   r;   r<   r"   E  s0    þíìr"   c                K  s6   t d| f|||||||||	|
|||||||dœ|¤ŽS )zS
    Sends a `PATCH` request.

    **Parameters**: See `tls_requests.request`.
    ÚPATCHrD   r@   rF   r;   r;   r<   r    x  s0    þíìr    c                K  s0   t d| f|||||||||	|
||||dœ|¤ŽS )zø
    Sends a `DELETE` request.

    **Parameters**: See `tls_requests.request`.

    Note that the `data`, `files`, `json` and `content` parameters are not available
    on this function, as `DELETE` requests should not include a request body.
    ÚDELETEr=   r@   rA   r;   r;   r<   r   «  s*    þðïr   )(Ú
__future__r   Útypingr   r   r:   r   Úmodelsr   Úsettingsr   r	   r
   r   r   r   r   Útypesr   r   r   r   r   r   r   r   r   r   r   r   r   Ú__all__r#   r   r   r   r!   r"   r    r   r;   r;   r;   r<   Ú<module>   s  $	<ì8Yð03ð03ð03í66í66í66ð