
    hw;                         d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZmZmZ d d	lmZmZmZmZ  G d
 de      Zy)    )connect_api_base)AuthenticationError)_APIRequestor)_api_encode)	urlencode)RequestOptions)StripeObject)ListcastOptional)LiteralNotRequired	TypedDictUnpackc                   $   e Zd Z G d de      Z G d de      Z G d de      Z G d de      Z G d	 d
e      Z	 G d de      Z
ed        Ze	 ddedee   defd       Ze	 ddee   dee	   defd       Ze	 ddee   dee
   defd       Zy)OAuthc                       e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 eed      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y	)
OAuth.OAuthTokenaccess_tokenscopelivemodebearer
token_typerefresh_tokenstripe_user_idstripe_publishable_keyN)__name__
__module____qualname__r   str__annotations__boolr        M/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/stripe/_oauth.py
OAuthTokenr      s}    sm#	 }	 4. 	 WX.//	  }$	 !%	 !)-	r$   r&   c                       e Zd ZU eed<   y)OAuth.OAuthDeauthorizationr   N)r   r   r   r    r!   r#   r$   r%   OAuthDeauthorizationr(   /   s    	r$   r)   c                       e Zd ZU ee   ed<   	 eed      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 eee      ed	<   	 ed
   ed<   y)OAuth.OAuthAuthorizeUrlParams	client_idcoderesponse_typeredirect_urir   statestripe_landingalways_promptsuggested_capabilities'OAuth.OAuthAuthorizeUrlParamsStripeUserstripe_userN)	r   r   r   r   r    r!   r   r"   r
   r#   r$   r%   OAuthAuthorizeUrlParamsr+   7   s    s##	 #76?33	 "#&&	
 3	 3	 $C((	 #4((	 !,DI 66	 !!JKK	r$   r6   c                      e Zd ZU dZee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed	<   	 ee   ed
<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)r4   z
        A more detailed explanation of what it means for a field to be
        required or optional can be found in our API documentation.
        See `Account Creation (Overview)` and `Account Update`
        emailurlcountryphone_numberbusiness_namebusiness_type
first_name	last_namedob_day	dob_monthdob_yearstreet_addresscityr0   zipphysical_productproduct_descriptioncurrencyfirst_name_kanafirst_name_kanjilast_name_kanalast_name_kanjigender
block_kanablock_kanjibuilding_kanabuilding_kanjiN)r   r   r   __doc__r   r    r!   r#   r$   r%   !OAuthAuthorizeUrlParamsStripeUserz'OAuth.OAuthAuthorizeUrlParamsStripeUsere   s   	 3	 	 S!!	 "#&&	 #3''	 #3''	  $$	 s##	 S!!	 s##	 c""	 $C((	 #	 3	
 	
 &c**	 )--	 c""	 %S))	 &c**	 $C((	 %S))	 C  	  $$	
 !%%	
 #3''	
 $C((	r$   rS   c                   l    e Zd ZU ed   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 eee      ed<   y)OAuth.OAuthTokenParams)authorization_coder   
grant_typer-   r   r   assert_capabilitiesN)r   r   r   r   r!   r   r    r
   r#   r$   r%   OAuthTokenParamsrU      s_    ABB	 #	 #3''	 3	 )c33	r$   rY   c                   *    e Zd ZU ee   ed<   	 eed<   y)OAuth.OAuthDeauthorizeParamsr,   r   N)r   r   r   r   r    r!   r#   r$   r%   OAuthDeauthorizeParamsr[     s    s##	 	r$   r\   c                 >    d| v ry ddl m} |r|| d<   y t        d      )Nr,   r   )r,   ax  No client_id provided. (HINT: set your client_id using "stripe.client_id = <CLIENT-ID>"). You can find your client_ids in your Stripe dashboard at https://dashboard.stripe.com/account/applications/settings, after registering your account as a platform. See https://stripe.com/docs/connect/standalone-accounts for details, or email support@stripe.com if you have any questions.)striper,   r   )paramsr,   s     r%   _set_client_idzOAuth._set_client_id  s3    & $"+F;!E
 	
r$   expressr_   returnc                     | du rd}nd}t         j                  |       d|vrd|d<   t        t        t	        |d                  }t
        |z   dz   |z   }|S )NFz/oauth/authorizez/express/oauth/authorizer.   r-   V1?)r   r`   r   listr   r   )ra   r_   pathqueryr9   s        r%   authorize_urlzOAuth.authorize_url2  se     e%D-DV$&(&,F?#${6489:%+e3
r$   Napi_keyc           
      r    d| i}t        j                         }t        d|j                  dd||d            S )Nrj   r   postz/oauth/tokenconnectr_   optionsbase_address)r   _global_instancer   requestrj   r_   ro   	requestors       r%   tokenzOAuth.tokenB  sN     $-g"6!224	&  	
 		
r$   c           
          d| i}t        j                         }t        j                  |       t	        d|j                  dd||d            S )Nrj   r(   rl   z/oauth/deauthorizerm   rn   )r   rq   r   r`   r   rr   rs   s       r%   deauthorizezOAuth.deauthorizeS  s\     $-g"6!224	V$($&  	
 		
r$   )F)N)r   r   r   r	   r&   r)   r   r6   rS   rY   r\   staticmethodr`   r"   r   r    ri   r   ru   rw   r#   r$   r%   r   r      s
   \ @| ,) ,\SI Sj9 0	 	 
 
( )/0G)H	  !%
#
178H1I
	
 
  !%
#
178N1O
	
 
r$   r   N)r^   r   stripe._errorr   stripe._api_requestorr   stripe._encoder   urllib.parser   stripe._request_optionsr   stripe._stripe_objectr	   typingr
   r   r   typing_extensionsr   r   r   r   objectr   r#   r$   r%   <module>r      s4    # - / & " 2 . ' ' E EU
F U
r$   