
    *i                     J    d Z ddlZddlmZmZ ddlmZ e G d d             Zy)z
GHL OAuth Configuration

Stores Client ID, Client Secret, and OAuth endpoints.
Client ID and Secret come from the GHL Marketplace App registration.
    N)	dataclassfield)Listc                      e Zd ZU dZej
                  j                  dd      Zee	d<   ej
                  j                  dd      Z
ee	d<   dZee	d<   d	Zee	d
<   dZee	d<   ej
                  j                  dd      Zee	d<   dZee	d<   dZee	d<   dZee	d<   ej
                  j                  dd      Zee	d<   dZee	d<   dZee	d<    ed       Zee   e	d<   ed efd!       Zed efd"       Zd#ed efd$Zy%)&GHLOAuthConfigz(GHL OAuth Marketplace App configuration.GHL_OAUTH_CLIENT_ID 	client_idGHL_OAUTH_CLIENT_SECRETclient_secretz8https://marketplace.gohighlevel.com/oauth/chooselocationauth_urlz0https://services.leadconnectorhq.com/oauth/token	token_urlz8https://services.leadconnectorhq.com/oauth/locationTokenlocation_token_urlGHL_OAUTH_REDIRECT_URIz#https://www.api.sunaivadigital.com/redirect_uriiQ access_token_ttl_secondsim  refresh_token_ttl_daysi,  refresh_buffer_secondsGHL_COMPANY_IDFNZ2Np4IXV65UZfYGO3A
company_idz
2021-07-28api_versionz$https://services.leadconnectorhq.comapi_base_urlc                  
    g dS )N)zcontacts.readonlyzcontacts.writezconversations.readonlyzconversations.writezconversations/message.readonlyzconversations/message.writezcalendars.readonlyzcalendars.writezcalendars/events.readonlyzcalendars/events.writezopportunities.readonlyzopportunities.writezlocations.readonlyzlocations.writezlocations/customFields.readonlyzlocations/customFields.writezlocations/customValues.readonlyzlocations/customValues.writezlocations/tags.readonlyzlocations/tags.writezworkflows.readonlyzfunnels/redirect.readonlyzfunnels/redirect.writezoauth.readonlyzoauth.write r       )/mnt/e/genesis-system/GHL/oauth/config.py<lambda>zGHLOAuthConfig.<lambda>-   s	     7 r   )default_factoryscopesreturnc                 8    dj                  | j                        S )N )joinr    selfs    r   scope_stringzGHLOAuthConfig.scope_stringI   s    xx$$r   c                 H    t        | j                  xr | j                        S )N)boolr
   r   r%   s    r   is_configuredzGHLOAuthConfig.is_configuredM   s    DNN9t'9'9::r   statec                     ddl m} d| j                  | j                  | j                  |d}| j
                   d ||       S )z4Build the full authorization URL for the OAuth flow.r   )	urlencodecode)response_typer   r
   scoper+   ?)urllib.parser-   r   r
   r'   r   )r&   r+   r-   paramss       r   get_auth_urlzGHLOAuthConfig.get_auth_urlQ   sH    *# --&&
 --)F"3!455r   N)__name__
__module____qualname____doc__osenvirongetr
   str__annotations__r   r   r   r   r   r   intr   r   r   r   r   r   r    r   propertyr'   r)   r*   r4   r   r   r   r   r      s9   2 ZZ^^$92>Is>(A2FM3F OHcNGIsGXX 

 -L#  %*c)"%C%"%C% jjnn%57MNJN $K#>L#>  / FDI 8 %c % % ;t ; ;
6# 
6# 
6r   r   )r8   r9   dataclassesr   r   typingr   r   r   r   r   <module>rB      s1    
 (  M6 M6 M6r   