o
    ÚtBh¯  ã                   @   s8   d dl mZ d dlmZ d dlmZ G dd„ deƒZdS )é    )Údeepcopy)Ú	APIHelper)ÚRequestsClientc                   @   s  e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZddddd g d!¢d"d#gd$d%d&d'i fd(d)„Z						d4d*d+„Zd,d-„ Zd.d%id.d/id.d0id1œZd5d2d3„ZdS )6ÚConfigurationz4A class used for configuring the SDK by a user.
    c                 C   ó   | j S ©N)Ú_http_client©Úself© r   úk/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/square/configuration.pyÚhttp_client   ó   zConfiguration.http_clientc                 C   r   r   )Ú_http_client_instancer	   r   r   r   Úhttp_client_instance   r   z"Configuration.http_client_instancec                 C   r   r   )Ú#_override_http_client_configurationr	   r   r   r   Ú"override_http_client_configuration   r   z0Configuration.override_http_client_configurationc                 C   r   r   )Ú_timeoutr	   r   r   r   Útimeout   r   zConfiguration.timeoutc                 C   r   r   )Ú_max_retriesr	   r   r   r   Úmax_retries   r   zConfiguration.max_retriesc                 C   r   r   )Ú_backoff_factorr	   r   r   r   Úbackoff_factor    r   zConfiguration.backoff_factorc                 C   r   r   )Ú_retry_statusesr	   r   r   r   Úretry_statuses$   r   zConfiguration.retry_statusesc                 C   r   r   )Ú_retry_methodsr	   r   r   r   Úretry_methods(   r   zConfiguration.retry_methodsc                 C   r   r   )Ú_environmentr	   r   r   r   Úenvironment,   r   zConfiguration.environmentc                 C   r   r   )Ú_custom_urlr	   r   r   r   Ú
custom_url0   r   zConfiguration.custom_urlc                 C   r   r   )Ú_square_versionr	   r   r   r   Úsquare_version4   r   zConfiguration.square_versionc                 C   r   r   )Ú_access_tokenr	   r   r   r   Úaccess_token8   r   zConfiguration.access_tokenc                 C   s
   t | jƒS r   )r   Ú_additional_headersr	   r   r   r   Úadditional_headers<   s   
z Configuration.additional_headersNFé<   r   é   )
i˜  i  i­  iô  iö  i÷  iø  i	  i
  i  ÚGETÚPUTÚ
productionzhttps://connect.squareup.comz
2021-11-17Ú c                 C   sZ   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
t|ƒ| _|  ¡ | _d S r   )r   r   r   r   r   r   r   r   r   r!   r#   r   r%   Úcreate_http_clientr   ©r
   r   r   r   r   r   r   r   r   r    r"   r$   r&   r   r   r   Ú__init__@   s   

zConfiguration.__init__c                 C   s˜   |p| j }|p	| j}|p| j}|p| j}|p| j}|p| j}|p"| j}|p'| j}|	p,| j}	|
p1| j	}
|p6| j
}|p;| j}t|||||||||	|
||dS )N)r   r   r   r   r   r   r   r   r    r"   r$   r&   )r   r   r   r   r   r   r   r   r    r"   r$   r&   r   r.   r   r   r   Ú
clone_withr   s*   











ùzConfiguration.clone_withc              	   C   s$   t | j| j| j| j| j| j| jdS )N)r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r	   r   r   r   r-      s   ûz Configuration.create_http_clientÚdefaultz#https://connect.squareupsandbox.comz{custom_url})r+   ÚsandboxÚcustomc                 C   s(   d| j ddœi}t | j| j | |¡S )a  Generates the appropriate base URI for the environment and the
        server.

        Args:
            server (Configuration.Server): The server enum for which the base
            URI is required.

        Returns:
            String: The base URI.

        r    F)ÚvalueÚencode)r    r   Ú#append_url_with_template_parametersÚenvironmentsr   )r
   ÚserverÚ
parametersr   r   r   Úget_base_uri¥   s
   ÿÿzConfiguration.get_base_uri)NNNNNNNNNNNN)r1   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   r   r   r   r   r   r   r   r    r"   r$   r&   r/   r0   r-   r7   r:   r   r   r   r   r      sh    













ù2
ûÿÿÿùr   N)Úcopyr   Úsquare.api_helperr   Úsquare.http.requests_clientr   Úobjectr   r   r   r   r   Ú<module>   s   