o
    iV                     @   s,  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 d dlmZmZmZmZmZmZ d d	lmZmZmZ erd 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) d dl*m+Z+ d dl,m-Z- G dd ded ed ed Z.dS )    )CreateableAPIResource)ExpandableField)
ListObject)ListableAPIResource)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)ClassVarDictListOptionalcastoverload)LiteralUnpackTYPE_CHECKING)Account)Application)LineItem)ShippingRate)TaxId)PaymentLinkCreateParams)PaymentLinkListLineItemsParams)PaymentLinkListParams)PaymentLinkModifyParams)PaymentLinkRetrieveParamsc                	   @   sP  e Zd ZU dZdZeed  ed< G dd deZ	G dd deZ
G dd	 d	eZG d
d deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG d d! d!eZG d"d# d#eZeed$< 	 e	ed%< eed&< 	 eed'  ed(< 	 ee ed)< 	 ee ed*< 	 e
ed+< ed, ed-< 	 ee ed.< 	 eed/< 	 ee ed0< 	 eed1< ed2 ed3< 	 eed4< 	 ee ed5< 	 ee ed6< 	 ee d7  ed8< 	 eed9< 	 e!eef ed:< 	 ee ed;< ed ed<< 	 eed=  ed>< 	 eee  ed?< 	 ee ed@< 	 ed2 edA< 	 eeedB   edC< 	 eedD< ee edE< 	 ee edF< 	 ee edG< 	 edH edI< 	 ee edJ< 	 eedK< ee edL< 	 eedM< 	 e"dNe#dO dPd fdQdRZ$e"dNe#dO dPd fdSdTZ%e"dNe#dU dPe d  fdVdWZ&e"dNe#dU dPe d  fdXdYZ'e"dedNe#dZ dPe d7 fd[d\Z(e)e*dedNe#dZ dPe d7 fd]d^Z+e)dNe#dZ dPe d7 fd_d^Z+e,d`dNe#dZ dPe d7 fdad^Z+e"dedNe#dZ dPe d7 fdbdcZ-e)e*dedNe#dZ dPe d7 fdddeZ.e)dNe#dZ dPe d7 fdfdeZ.e,dgdNe#dZ dPe d7 fdhdeZ.e"d4edNe#di dPd fdjdkZ/e"d4edNe#di dPd fdldmZ0e"d4edNe#dn dPd fdodpZ1e"d4edNe#dn dPd fdqdrZ2i d%e	d+e
d.ed0ed1ed6ed;ed?ed@edDedEedFedGedJedKedLeZ3dsS )tPaymentLinka#  
    A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.

    When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.

    Related guide: [Payment Links API](https://stripe.com/docs/payment-links)
    payment_linkOBJECT_NAMEc                   @   s^   e Zd ZU G dd deZG dd deZee ed< ee ed< ed ed< 	 eedZ	d	S )
zPaymentLink.AfterCompletionc                   @   s   e Zd ZU ee ed< dS )z.PaymentLink.AfterCompletion.HostedConfirmationcustom_messageN__name__
__module____qualname__r   str__annotations__ r'   r'   t/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/_payment_link.pyHostedConfirmation2      
 r)   c                   @      e Zd ZU eed< dS )z$PaymentLink.AfterCompletion.RedirecturlNr"   r#   r$   r%   r&   r'   r'   r'   r(   Redirect8      
 r.   hosted_confirmationredirect)r0   r1   typeN)
r"   r#   r$   r   r)   r.   r   r&   r   _inner_class_typesr'   r'   r'   r(   AfterCompletion1   s   
 
r4   c                   @   >   e Zd ZU G dd deZeed< 	 ee ed< 	 deiZdS )zPaymentLink.AutomaticTaxc                   @   ,   e Zd ZU eed  ed< 	 ed ed< dS )z"PaymentLink.AutomaticTax.Liabilityr   accountr7   selfr2   Nr"   r#   r$   r   r   r&   r   r'   r'   r'   r(   	LiabilityJ   
   
 r;   enabled	liabilityN)	r"   r#   r$   r   r;   boolr&   r   r3   r'   r'   r'   r(   AutomaticTaxI   s   
 
r@   c                   @   sX   e Zd ZU G dd deZee ed< 	 eed  ed< 	 eed  ed< 	 deiZdS )	zPaymentLink.ConsentCollectionc                   @      e Zd ZU ed ed< dS )z9PaymentLink.ConsentCollection.PaymentMethodReuseAgreement)autohiddenpositionNr"   r#   r$   r   r&   r'   r'   r'   r(   PaymentMethodReuseAgreement_   r*   rF   payment_method_reuse_agreement)rB   none
promotions)rH   requiredterms_of_serviceN)	r"   r#   r$   r   rF   r   r&   r   r3   r'   r'   r'   r(   ConsentCollection^   s   
 rL   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZG dd deZee e	d	< e
e	d
< 	 ee	d< ee e	d< ee	d< 	 ee e	d< ed e	d< 	 eeeedZdS )zPaymentLink.CustomFieldc                   @   sB   e Zd ZU G dd deZee ed< 	 ee ed< 	 deiZ	dS )z PaymentLink.CustomField.Dropdownc                   @       e Zd ZU eed< 	 eed< dS )z'PaymentLink.CustomField.Dropdown.OptionlabelvalueNr-   r'   r'   r'   r(   Optiony   
   
 rP   default_valueoptionsN)
r"   r#   r$   r   rP   r   r%   r&   r   r3   r'   r'   r'   r(   Dropdownx   s   
 
rT   c                   @   s(   e Zd ZU ee ed< 	 ed ed< dS )zPaymentLink.CustomField.Labelcustomr2   N)r"   r#   r$   r   r%   r&   r   r'   r'   r'   r(   Label   
   
 rV   c                   @   6   e Zd ZU ee ed< 	 ee ed< 	 ee ed< dS )zPaymentLink.CustomField.NumericrR   maximum_lengthminimum_lengthNr"   r#   r$   r   r%   r&   intr'   r'   r'   r(   Numeric      
 r]   c                   @   rX   )zPaymentLink.CustomField.TextrR   rY   rZ   Nr[   r'   r'   r'   r(   Text   r^   r_   dropdownkeyrN   numericoptionaltext)r`   rb   rd   r2   )r`   rN   rb   rd   N)r"   r#   r$   r   rT   rV   r]   r_   r   r&   r%   r?   r   r3   r'   r'   r'   r(   CustomFieldw   s(   
 

re   c                   @   s   e Zd ZU G dd deZG dd deZG dd deZG dd deZee e	d	< 	 ee e	d
< 	 ee e	d< 	 ee e	d< 	 eeeedZ
dS )zPaymentLink.CustomTextc                   @   r+   )z"PaymentLink.CustomText.AfterSubmitmessageNr-   r'   r'   r'   r(   AfterSubmit   r/   rg   c                   @   r+   )z&PaymentLink.CustomText.ShippingAddressrf   Nr-   r'   r'   r'   r(   ShippingAddress   r/   rh   c                   @   r+   )zPaymentLink.CustomText.Submitrf   Nr-   r'   r'   r'   r(   Submit   r/   ri   c                   @   r+   )z/PaymentLink.CustomText.TermsOfServiceAcceptancerf   Nr-   r'   r'   r'   r(   TermsOfServiceAcceptance   r/   rj   after_submitshipping_addresssubmitterms_of_service_acceptance)rk   rl   rm   rn   N)r"   r#   r$   r   rg   rh   ri   rj   r   r&   r3   r'   r'   r'   r(   
CustomText   s$   
 
ro   c                   @   r5   )zPaymentLink.InvoiceCreationc                   @   s   e Zd ZU G dd deZG dd deZG dd deZeee	d   e
d< 	 eee  e
d	< 	 ee e
d
< 	 ee e
d< 	 ee e
d< 	 eeeef  e
d< 	 ee e
d< 	 eeedZdS )z'PaymentLink.InvoiceCreation.InvoiceDatac                   @   rM   )z3PaymentLink.InvoiceCreation.InvoiceData.CustomFieldnamerO   Nr-   r'   r'   r'   r(   re      rQ   re   c                   @   r6   )z.PaymentLink.InvoiceCreation.InvoiceData.Issuerr   r7   r8   r2   Nr:   r'   r'   r'   r(   Issuer  r<   rq   c                   @   s(   e Zd ZU ee ed< 	 ee ed< dS )z8PaymentLink.InvoiceCreation.InvoiceData.RenderingOptionsamount_tax_displaytemplateNr!   r'   r'   r'   r(   RenderingOptions  rW   rt   r   account_tax_idscustom_fieldsdescriptionfooterissuermetadatarendering_options)rv   ry   r{   N)r"   r#   r$   r   re   rq   rt   r   r   r   r&   r%   r   r3   r'   r'   r'   r(   InvoiceData   s,   
 



r|   r=   invoice_dataN)	r"   r#   r$   r   r|   r?   r&   r   r3   r'   r'   r'   r(   InvoiceCreation   s   
 Ar~   c                   @   sP   e Zd ZU G dd deZG dd deZee ed< ee ed< eedZdS )	zPaymentLink.NameCollectionc                   @   rM   )z#PaymentLink.NameCollection.Businessr=   rc   Nr"   r#   r$   r?   r&   r'   r'   r'   r(   BusinessG  rQ   r   c                   @   rM   )z%PaymentLink.NameCollection.Individualr=   rc   Nr   r'   r'   r'   r(   
IndividualQ  rQ   r   business
individual)r   r   N)	r"   r#   r$   r   r   r   r   r&   r3   r'   r'   r'   r(   NameCollectionF  s   
 

r   c                   @   sB   e Zd ZU G dd deZee ed< eed< eed< deiZ	dS )zPaymentLink.OptionalItemc                   @   s2   e Zd ZU eed< 	 ee ed< 	 ee ed< dS )z+PaymentLink.OptionalItem.AdjustableQuantityr=   maximumminimumN)r"   r#   r$   r?   r&   r   r\   r'   r'   r'   r(   AdjustableQuantity`  s   
 r   adjustable_quantitypricequantityN)
r"   r#   r$   r   r   r   r&   r%   r\   r3   r'   r'   r'   r(   OptionalItem_  s   
 r   c                   @   sz   e Zd ZU eed  ed< 	 ee ed< 	 eeef ed< 	 eed  ed< 	 ee ed< 	 ee ed< 	 ee ed	< d
S )zPaymentLink.PaymentIntentData)	automaticautomatic_asyncmanualcapture_methodrw   rz   )off_session
on_sessionsetup_future_usagestatement_descriptorstatement_descriptor_suffixtransfer_groupN)r"   r#   r$   r   r   r&   r%   r   r'   r'   r'   r(   PaymentIntentDatas  s"   
 r   c                   @   r+   )z!PaymentLink.PhoneNumberCollectionr=   Nr   r'   r'   r'   r(   PhoneNumberCollection  r/   r   c                   @   .   e Zd ZU G dd deZeed< deiZdS )zPaymentLink.Restrictionsc                   @   rM   )z*PaymentLink.Restrictions.CompletedSessionscountlimitN)r"   r#   r$   r\   r&   r'   r'   r'   r(   CompletedSessions  rQ   r   completed_sessionsN)r"   r#   r$   r   r   r&   r3   r'   r'   r'   r(   Restrictions     
 
r   c                   @   s   e Zd ZU eed  ed< dS )z%PaymentLink.ShippingAddressCollection)ACADAEAFAGAIALAMAOAQARATAUAWAXAZBABBBDBEBFBGBHBIBJBLBMBNBOBQBRBSBTBVBWBYBZCACDCFCGCHCICKCLCMCNCOCRCVCWCYCZDEDJDKDMDODZECEEEGEHERESETFIFJFKFOFRGAGBGDGEGFGGGHGIGLGMGNGPGQGRGSGTGUGWGYHKHNHRHTHUIDIEILIMINIOIQISITJEJMJOJPKEKGKHKIKMKNKRKWKYKZLALBLCLILKLRLSLTLULVLYMAMCMDMEMFMGMKMLMMMNMOMQMRMSMTMUMVMWMXMYMZNANCNENGNINLNONPNRNUNZOMPAPEPFPGPHPKPLPMPNPRPSPTPYQARERORSRURWSASBSCSDSESGSHSISJSKSLSMSNSOSRSSSTSVSXSZTATCTDTFTGTHTJTKTLTMTNTOTRTTTVTWTZUAUGUSUYUZVAVCVEVGVNVUWFWSXKYEYTZAZMZWZZallowed_countriesN)r"   r#   r$   r   r   r&   r'   r'   r'   r(   ShippingAddressCollection  s   
  sr  c                   @   $   e Zd ZU eed< 	 ed ed< dS )zPaymentLink.ShippingOptionshipping_amountr   shipping_rateN)r"   r#   r$   r\   r&   r   r'   r'   r'   r(   ShippingOption  s
   
 r  c                   @   s|   e Zd ZU G dd deZG dd deZee ed< 	 eed< e	eef ed< 	 ee
 ed< 	 ee ed	< 	 eed
ZdS )zPaymentLink.SubscriptionDatac                   @   r   )z,PaymentLink.SubscriptionData.InvoiceSettingsc                   @   r6   )z3PaymentLink.SubscriptionData.InvoiceSettings.Issuerr   r7   r8   r2   Nr:   r'   r'   r'   r(   rq     r<   rq   ry   N)r"   r#   r$   r   rq   r&   r3   r'   r'   r'   r(   InvoiceSettings  r   r  c                   @   s0   e Zd ZU G dd deZeed< 	 deiZdS )z*PaymentLink.SubscriptionData.TrialSettingsc                   @   rA   )z6PaymentLink.SubscriptionData.TrialSettings.EndBehavior)cancelcreate_invoicepausemissing_payment_methodNrE   r'   r'   r'   r(   EndBehavior  s
   
 r  end_behaviorN)r"   r#   r$   r   r  r&   r3   r'   r'   r'   r(   TrialSettings  s
   
 r  rw   invoice_settingsrz   trial_period_daystrial_settings)r  r  N)r"   r#   r$   r   r  r  r   r%   r&   r   r\   r3   r'   r'   r'   r(   SubscriptionData  s   
 
r  c                   @   r  )zPaymentLink.TaxIdCollectionr=   )if_supportedneverrJ   N)r"   r#   r$   r?   r&   r   r'   r'   r'   r(   TaxIdCollection  s   
 r  c                   @   s(   e Zd ZU ee ed< 	 ed ed< dS )zPaymentLink.TransferDataamountr   destinationN)r"   r#   r$   r   r\   r&   r   r'   r'   r'   r(   TransferData  rW   r  activeafter_completionallow_promotion_codesr   applicationapplication_fee_amountapplication_fee_percentautomatic_tax)rB   rJ   billing_address_collectionconsent_collectioncurrencyrv   custom_text)alwaysif_requiredcustomer_creationidinactive_messageinvoice_creationr   
line_itemslivemoderz   name_collectionobjectr   on_behalf_ofoptional_itemspayment_intent_datapayment_method_collection)&affirmafterpay_clearpayalipayalmaau_becs_debit
bacs_debit
bancontactbillieblikboletocardcashappepsfpxgiropaygrabpayidealklarnakonbinilinkmb_way	mobilepay
multibancooxxop24pay_by_bankpaynowpaypalpix	promptpaysatispay
sepa_debitsofortswishtwintus_bank_account
wechat_payzippayment_method_typesphone_number_collectionrestrictionsshipping_address_collectionshipping_options)rB   bookdonatepay	subscribesubmit_typesubscription_datatax_id_collectiontransfer_datar,   paramsr   returnc                 K   s   t d| jd|  |dS ))
        Creates a payment link.
        r   postr  )r   _static_request	class_urlclsr  r'   r'   r(   create  s   zPaymentLink.createc                    s"   t d| jd|  |dI dH S )r  r   r  r  N)r   _static_request_asyncr  r  r'   r'   r(   create_async  s   
zPaymentLink.create_asyncr   c                 K   s4   | j d|  |d}t|tstdt|j |S )7
        Returns a list of your payment links.
        getr  %Expected list object from API, got %s)r  r  
isinstancer   	TypeErrorr2   r"   r  r  resultr'   r'   r(   list  s   
zPaymentLink.listc                    s<   | j d|  |dI dH }t|tstdt|j |S )r  r  r  Nr  )r  r  r   r   r  r2   r"   r  r'   r'   r(   
list_async  s   
zPaymentLink.list_asyncr   c                 K   s&   t td | jddjt|d|dS )
        When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
        r   r  +/v1/payment_links/{payment_link}/line_itemsr   r  )r   r   r  formatr	   r  r   r  r'   r'   r(   _cls_list_line_items  s   	z PaymentLink._cls_list_line_itemsc                 K      dS r  Nr'   r   r  r'   r'   r(   list_line_items  s   zPaymentLink.list_line_itemsc                 K   r  r  r'   r9   r  r'   r'   r(   r    s   r  c              	   K   s,   t td | jddjt| dd|dS )r  r   r  r  r  r  r  )r   r   _requestr	  r	   r  r  r'   r'   r(   r    s   c                    s.   t td | jddjt|d|dI dH S )r  r   r  r  r  r  N)r   r   r  r	  r	   r
  r'   r'   r(   _cls_list_line_items_async  s   	
z&PaymentLink._cls_list_line_items_asyncc                       dS r  r'   r  r'   r'   r(   list_line_items_async(  s   z!PaymentLink.list_line_items_asyncc                    r  r  r'   r  r'   r'   r(   r  2  s   r  c              	      s4   t td | jddjt| dd|dI dH S )r  r   r  r  r  r  r  N)r   r   _request_asyncr	  r	   r  r  r'   r'   r(   r  ;  s   
r   c                 K   s*   d|   t|f }td| jd||dS ))
        Updates a payment link.
        %s/%sr   r  r  )r  r	   r   r  r  r  r  r,   r'   r'   r(   modifyM  s   zPaymentLink.modifyc                    s2   d|   t|f }td| jd||dI dH S )r  r  r   r  r  N)r  r	   r   r  r  r'   r'   r(   modify_async^  s   
zPaymentLink.modify_asyncr   c                 K   s   | |fi |}|   |S )*
        Retrieve a payment link.
        )refreshr  r  r  instancer'   r'   r(   retrieveo  s   zPaymentLink.retrievec                    s$   | |fi |}|  I dH  |S )r  N)refresh_asyncr  r'   r'   r(   retrieve_asyncz  s   zPaymentLink.retrieve_asyncN)4r"   r#   r$   __doc__r   r
   r   r&   r   r4   r@   rL   re   ro   r~   r   r   r   r   r   r  r  r  r  r  r?   r   r   r\   floatr%   r   r   r   classmethodr   r  r  r  r  r  r   staticmethodr  r   r  r  r  r  r  r!  r3   r'   r'   r'   r(   r   "   s  
 S0L  x
4
,

	
r   N)/stripe._createable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._stripe_objectr   stripe._updateable_api_resourcer   stripe._utilr   r	   typingr
   r   r   r   r   r   typing_extensionsr   r   r   stripe._accountr   stripe._applicationr   stripe._line_itemr   stripe._shipping_rater   stripe._tax_idr   )stripe.params._payment_link_create_paramsr   2stripe.params._payment_link_list_line_items_paramsr   'stripe.params._payment_link_list_paramsr   )stripe.params._payment_link_modify_paramsr   +stripe.params._payment_link_retrieve_paramsr   r   r'   r'   r'   r(   <module>   s2    
