o
    ÚtBhL
  ã                   @   s    d dl mZ G dd„ deƒZdS )é    )Ú	APIHelperc                   @   s:   e Zd ZdZ				ddd„Zdd„ Zdd„ Zd	d
„ ZdS )ÚHttpRequestaB  Information about an HTTP Request including its method, headers,
        parameters, URL, and Basic Auth details

    Attributes:
        http_method (HttpMethodEnum): The HTTP Method that this request should
            perform when called.
        headers (dict): A dictionary of headers (key : value) that should be
            sent along with the request.
        query_url (string): The URL that the request should be sent to.
        parameters (dict): A dictionary of parameters that are to be sent along
            with the request in the form body of the request

    Nc                 C   s(   || _ || _|| _|| _|| _|| _dS )a  Constructor for the HttpRequest class

        Args:
            http_method (HttpMethodEnum): The HTTP Method.
            query_url (string): The URL to send the request to.
            headers (dict, optional): The headers for the HTTP Request.
            query_parameters (dict, optional): Query parameters to add in the
                URL.
            parameters (dict, optional): Form or body parameters to be included
                in the body.
            files (dict, optional): Files to be sent with the request.

        N)Úhttp_methodÚ	query_urlÚheadersÚquery_parametersÚ
parametersÚfiles)Úselfr   r   r   r   r   r	   © r   úo/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/square/http/http_request.pyÚ__init__   s   
zHttpRequest.__init__c                 C   ó   || j |< dS )z¢ Add a header to the HttpRequest.

        Args:
            name (string): The name of the header.
            value (string): The value of the header.

        N)r   ©r
   ÚnameÚvaluer   r   r   Ú
add_header1   ó   zHttpRequest.add_headerc                 C   r   )z« Add a parameter to the HttpRequest.

        Args:
            name (string): The name of the parameter.
            value (string): The value of the parameter.

        N)r   r   r   r   r   Úadd_parameter;   r   zHttpRequest.add_parameterc                 C   s&   t  | j||i¡| _t  | j¡| _dS )z½ Add a query parameter to the HttpRequest.

        Args:
            name (string): The name of the query parameter.
            value (string): The value of the query parameter.

        N)r   Ú append_url_with_query_parametersr   Ú	clean_urlr   r   r   r   Úadd_query_parameterE   s
   þzHttpRequest.add_query_parameter)NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s    
ú

r   N)Úsquare.api_helperr   Úobjectr   r   r   r   r   Ú<module>   s   