o
    i9                 	   @   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 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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l0m1Z1 d dl2m3Z3 d dl4m5Z5 d dl6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z= d dl>m?Z? d dl@mAZA d dlBmCZC d dlDmEZE d dlFmGZG d dlHmIZI d d lJmKZK d d!lLmMZM d d"lNmOZO d d#lPmQZQ d d$lRmSZS G d%d& d&ed& ed& e	d& ed& ed& ZTd'S )(    )CreateableAPIResource)DeletableAPIResource)ExpandableField)
ListObject)ListableAPIResource)SearchResultObject)SearchableAPIResource)StripeObject)UpdateableAPIResource)class_method_variantsanitize_id)	AsyncIteratorClassVarDictIteratorListOptionalUnioncastoverload)LiteralUnpackTYPE_CHECKING)Account)Application)BankAccount)Card)Customer)Discount)Invoice)PaymentMethod)SetupIntent)Source)SubscriptionItem)SubscriptionSchedule)TaxId)TaxRate)SubscriptionCancelParams)SubscriptionCreateParams) SubscriptionDeleteDiscountParams)SubscriptionListParams)SubscriptionMigrateParams)SubscriptionModifyParams)SubscriptionResumeParams)SubscriptionRetrieveParams)SubscriptionSearchParams)	TestClockc                   @   s  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eed  ed< 	 ee ed< 	 e	ed< eed < 	 ee
 ed!< 	 eed"< 	 ee ed#< 	 ee ed$< 	 eed%< 	 ee ed&< 	 ee ed'< 	 ed( ed)< 	 eed*< 	 eed+< 	 ed, ed-< 	 ee ed.< 	 eed/  ed0< 	 eeed1   ed2< 	 eed3  ed4< 	 ee ed5< 	 eed6  ed7< 	 ee ed8< 	 eed9< 	 eed:< ed; ed<< 	 eed=  ed>< 	 eed?< 	 eeef ed@< 	 ee edA< 	 ed edB< 	 eedC  edD< 	 ee edE< 	 ee edF< 	 ee edG< 	 eedH  edI< 	 ee edJ< 	 eedK  edL< 	 eedM< 	 edN edO< 	 eedP  edQ< 	 ee edR< 	 ee edS< 	 ee edT< 	 ee edU< 	 edVedWe dX dYd fdZd[Z!e"e#dVedWe dX dYd fd\d]Z$e"dWe dX dYd fd^d]Z$e%d_dWe dX dYd fd`d]Z$edVedWe dX dYd fdadbZ&e"e#dVedWe dX dYd fdcddZ'e"dWe dX dYd fdeddZ'e%dfdWe dX dYd fdgddZ'edWe dh dYd fdidjZ(edWe dh dYd fdkdlZ)edVedWe dm dYd6fdndoZ*e"e#dVedWe dm dYd6fdpdqZ+e"dWe dm dYd6fdrdqZ+e%dsdWe dm dYd6fdtdqZ+edVedWe dm dYd6fdudvZ,e"e#dVedWe dm dYd6fdwdxZ-e"dWe dm dYd6fdydxZ-e%dzdWe dm dYd6fd{dxZ-edWe d| dYed  fd}d~Z.edWe d| dYed  fddZ/ededWe d dYd fddZ0e"e#dedWe d dYd fddZ1e"dWe d dYd fddZ1e%ddWe d dYd fddZ1ededWe d dYd fddZ2e"e#dedWe d dYd fddZ3e"dWe d dYd fddZ3e%ddWe d dYd fddZ3ed9edWe d dYd fddZ4ed9edWe d dYd fddZ5ededWe d dYd fddZ6e"e#dedWe d dYd fddZ7e"dWe d dYd fddZ7e%ddWe d dYd fddZ7ededWe d dYd fddZ8e"e#dedWe d dYd fddZ9e"dWe d dYd fddZ9e%ddWe d dYd fddZ9ed9edWe d dYd fddZ:ed9edWe d dYd fddZ;ede d dYe<d  fddZ=ede d dYe<d  fddZ>ede d dYe?d  fddZ@ede d dYeAd  fddZBe	e
eeeeeeeeeedZCdS )Subscriptionz
    Subscriptions allow you to charge a customer on a recurring basis.

    Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating)
    subscriptionOBJECT_NAMEc                   @   sP   e Zd ZU G dd deZeed  ed< 	 eed< 	 ee ed< 	 deiZ	dS )zSubscription.AutomaticTaxc                   @   ,   e Zd ZU eed  ed< 	 ed ed< dS )z#Subscription.AutomaticTax.Liabilityr   accountr5   selftypeN__name__
__module____qualname__r   r   __annotations__r    r>   r>   t/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/_subscription.py	LiabilityU   
   
 r@   requires_location_inputsdisabled_reasonenabled	liabilityN)
r:   r;   r<   r	   r@   r   r   r=   bool_inner_class_typesr>   r>   r>   r?   AutomaticTaxT   s   
 
rH   c                   @   sN   e Zd ZU eed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )z%Subscription.BillingCycleAnchorConfigday_of_monthhourminutemonthsecondN)r:   r;   r<   intr=   r   r>   r>   r>   r?   BillingCycleAnchorConfigm   s   
 rO   c                   @   sP   e Zd ZU G dd deZee ed< 	 ed ed< 	 ee ed< 	 deiZ	dS )zSubscription.BillingModec                   @      e Zd ZU eed  ed< dS )z!Subscription.BillingMode.Flexible)includeditemizedproration_discountsNr:   r;   r<   r   r   r=   r>   r>   r>   r?   Flexible      
 rU   flexible)classicrW   r8   
updated_atN)
r:   r;   r<   r	   rU   r   r=   r   rN   rG   r>   r>   r>   r?   BillingMode   s   
 rZ   c                   @   s(   e Zd ZU ee ed< 	 ee ed< dS )zSubscription.BillingThresholds
amount_gtereset_billing_cycle_anchorN)r:   r;   r<   r   rN   r=   rF   r>   r>   r>   r?   BillingThresholds   
   
 r]   c                   @   s>   e Zd ZU ee ed< 	 eed  ed< 	 eed  ed< dS )z Subscription.CancellationDetailscomment)customer_servicelow_qualitymissing_featuresotherswitched_servicetoo_complextoo_expensiveunusedfeedback)cancellation_requestedpayment_disputedpayment_failedreasonN)r:   r;   r<   r   strr=   r   r>   r>   r>   r?   CancellationDetails   s   
 rn   c                   @   sD   e Zd ZU G dd deZeeed   ed< 	 eed< deiZ	dS )zSubscription.InvoiceSettingsc                   @   r4   )z#Subscription.InvoiceSettings.Issuerr   r5   r6   r8   Nr9   r>   r>   r>   r?   Issuer   rA   ro   r%   account_tax_idsissuerN)
r:   r;   r<   r	   ro   r   r   r   r=   rG   r>   r>   r>   r?   InvoiceSettings   s   
 
rr   c                   @   s(   e Zd ZU ed ed< 	 ee ed< dS )zSubscription.PauseCollection)keep_as_draftmark_uncollectiblevoidbehavior
resumes_atN)r:   r;   r<   r   r=   r   rN   r>   r>   r>   r?   PauseCollection   r^   rx   c                   @   s\   e Zd ZU G dd deZee ed< 	 eeed   ed< 	 eed  ed< 	 deiZ	dS )	zSubscription.PaymentSettingsc                   @   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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d< 	 ee	 ed< 	 ee
 ed< 	 eeeeee	e
dZdS )z1Subscription.PaymentSettings.PaymentMethodOptionsc                   @   D   e Zd ZU G dd deZee ed< eed  ed< 	 deiZdS )z;Subscription.PaymentSettings.PaymentMethodOptions.AcssDebitc                   @   rP   )zJSubscription.PaymentSettings.PaymentMethodOptions.AcssDebit.MandateOptions)businesspersonaltransaction_typeNrT   r>   r>   r>   r?   MandateOptions   rV   r}   mandate_options	automaticinstantmicrodepositsverification_methodN	r:   r;   r<   r	   r}   r   r=   r   rG   r>   r>   r>   r?   	AcssDebit   s   
 r   c                   @      e Zd ZU ed ed< dS )z<Subscription.PaymentSettings.PaymentMethodOptions.Bancontact)deenfrnlpreferred_languageNr:   r;   r<   r   r=   r>   r>   r>   r?   
Bancontact      
 r   c                   @   sV   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 )	z6Subscription.PaymentSettings.PaymentMethodOptions.Cardc                   @   s:   e Zd ZU ee ed< 	 eed  ed< 	 ee ed< dS )zESubscription.PaymentSettings.PaymentMethodOptions.Card.MandateOptionsamount)fixedmaximumamount_typedescriptionN)r:   r;   r<   r   rN   r=   r   rm   r>   r>   r>   r?   r}      s   
 r}   r~   )amexcartes_bancairesdinersdiscover	eftpos_augirocardinteracjcblink
mastercardunionpayunknownvisanetwork)anyr   	challengerequest_three_d_secureNr   r>   r>   r>   r?   r      s   
 r   c                   @   sD   e Zd ZU G dd deZee ed< eed  ed< 	 deiZdS )zASubscription.PaymentSettings.PaymentMethodOptions.CustomerBalancec                   @   s@   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 )zNSubscription.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransferc                   @   r   )z]Subscription.PaymentSettings.PaymentMethodOptions.CustomerBalance.BankTransfer.EuBankTransfer)BEDEESFRIENLcountryNr   r>   r>   r>   r?   EuBankTransfer!  r   r   eu_bank_transferr8   N)	r:   r;   r<   r	   r   r   r=   rm   rG   r>   r>   r>   r?   BankTransfer   s   
 r   bank_transferfunding_typeN)	r:   r;   r<   r	   r   r   r=   r   rG   r>   r>   r>   r?   CustomerBalance  s   
 r   c                   @      e Zd ZdS )z9Subscription.PaymentSettings.PaymentMethodOptions.KonbiniNr:   r;   r<   r>   r>   r>   r?   Konbini5      r   c                   @   r   )z;Subscription.PaymentSettings.PaymentMethodOptions.SepaDebitNr   r>   r>   r>   r?   	SepaDebit8  r   r   c                   @   ry   )z?Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccountc                   @   s^   e Zd ZU G dd deZee ed< eeed   ed< 	 eeed   ed< 	 deiZ	dS )	zTSubscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnectionsc                   @   s"   e Zd ZU eeed   ed< dS )z\Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.Filters)checkingsavingsaccount_subcategoriesN)r:   r;   r<   r   r   r   r=   r>   r>   r>   r?   Filters=  s
   
 
r   filters)balances	ownershippayment_methodtransactionspermissions)r   r   r   prefetchN)
r:   r;   r<   r	   r   r   r=   r   r   rG   r>   r>   r>   r?   FinancialConnections<  s    
 

r   financial_connectionsr   r   N)	r:   r;   r<   r	   r   r   r=   r   rG   r>   r>   r>   r?   UsBankAccount;  s   
 r   
acss_debit
bancontactcardcustomer_balancekonbini
sepa_debitus_bank_account)r   r   r   r   r   r   r   N)r:   r;   r<   r	   r   r   r   r   r   r   r   r   r=   rG   r>   r>   r>   r?   PaymentMethodOptions   s<   
 ,+
r   payment_method_options)(ach_credit_transfer	ach_debitr   affirm
amazon_payau_becs_debit
bacs_debitr   boletor   cashappcryptocustomr   epsfpxgiropaygrabpayidealjp_credit_transfer	kakao_payklarnar   kr_cardr   
multibanco	naver_paynz_bank_accountp24paycopaynowpaypal	promptpayrevolut_paysepa_credit_transferr   sofortswishr   
wechat_paypayment_method_types)offon_subscriptionsave_default_payment_methodN)
r:   r;   r<   r	   r   r   r=   r   r   rG   r>   r>   r>   r?   PaymentSettings   s$   
  1.r   c                   @   s$   e Zd ZU ed ed< 	 eed< dS )z'Subscription.PendingInvoiceItemInterval)dayrL   weekyearintervalinterval_countN)r:   r;   r<   r   r=   rN   r>   r>   r>   r?   PendingInvoiceItemInterval  s
   
 r   c                   @   sR   e Zd ZU ee ed< 	 eed< 	 eed  ed< 	 ee ed< 	 ee ed< dS )zSubscription.PendingUpdatebilling_cycle_anchor
expires_atr#   subscription_items	trial_endtrial_from_planN)r:   r;   r<   r   rN   r=   r   rF   r>   r>   r>   r?   PendingUpdate  s   
 r   c                   @   s(   e Zd ZU ee ed< 	 ed ed< dS )zSubscription.TransferDataamount_percentr   destinationN)r:   r;   r<   r   floatr=   r   r>   r>   r>   r?   TransferData  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Subscription.TrialSettingsc                   @   r   )z&Subscription.TrialSettings.EndBehavior)cancelcreate_invoicepausemissing_payment_methodNr   r>   r>   r>   r?   EndBehavior  s
   
 r  end_behaviorN)r:   r;   r<   r	   r  r=   rG   r>   r>   r>   r?   TrialSettings  s
   
 r	  r   applicationapplication_fee_percentautomatic_taxr   billing_cycle_anchor_configbilling_modebilling_thresholds	cancel_atcancel_at_period_endcanceled_atcancellation_details)charge_automaticallysend_invoicecollection_methodcreatedcurrencyr   customerdays_until_duer    default_payment_method)r   r   CardResourcer"   default_sourcer&   default_tax_ratesr   r   	discountsended_atidinvoice_settingsr#   itemsr   latest_invoicelivemodemetadata!next_pending_invoice_item_invoiceobjectr   on_behalf_ofpause_collectionpayment_settingspending_invoice_item_intervalr!   pending_setup_intentpending_updater$   schedule
start_date)activecanceled
incompleteincomplete_expiredpast_duepausedtrialingunpaidstatusr0   
test_clocktransfer_datar   trial_settingstrial_startsubscription_exposed_idparamsr'   returnc                 K   "   t d| jddjt|d|dS )  
        Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata).

        Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true.

        By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
        r1   delete+/v1/subscriptions/{subscription_exposed_id}r>  r?  r   _static_requestformatr   clsr>  r?  r>   r>   r?   _cls_cancel  s   zSubscription._cls_cancelc                 K      dS rB  Nr>   r>  r?  r>   r>   r?   r    s   zSubscription.cancelc                 K   rM  rN  r>   r7   r?  r>   r>   r?   r    s   rL  c              	   K   (   t d| jddjt| dd|dS )rB  r1   rC  rD  r!  rE  rF  r   _requestrI  r   getrP  r>   r>   r?   r    s   c                    *   t d| jddjt|d|dI dH S )rB  r1   rC  rD  rE  rF  Nr   _static_request_asyncrI  r   rJ  r>   r>   r?   _cls_cancel_async  s   
zSubscription._cls_cancel_asyncc                       dS rN  r>   rO  r>   r>   r?   cancel_async*  s   zSubscription.cancel_asyncc                    rY  rN  r>   rP  r>   r>   r?   rZ  9  s   rX  c              	      0   t d| jddjt| dd|dI dH S )rB  r1   rC  rD  r!  rE  rF  Nr   _request_asyncrI  r   rT  rP  r>   r>   r?   rZ  F  s   
r(   c                 K   s   t d| jd|  |dS )  
        Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.

        When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.
        The payment_behavior parameter determines the exact behavior of the initial payment.

        To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://docs.stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead.
        Schedules provide the flexibility to model more complex billing configurations that change over time.
        r1   postrF  )r   rH  	class_urlrK  r?  r>   r>   r?   create\  s   zSubscription.createc                    s"   t d| jd|  |dI dH S )r^  r1   r_  rF  N)r   rW  r`  ra  r>   r>   r?   create_asyncr  s   
zSubscription.create_asyncr)   c                 K   rA  )K
        Removes the currently applied discount on a subscription.
        r   rC  4/v1/subscriptions/{subscription_exposed_id}/discountrE  rF  rG  rJ  r>   r>   r?   _cls_delete_discount  s   	z!Subscription._cls_delete_discountc                 K   rM  rd  Nr>   rO  r>   r>   r?   delete_discount  s   	zSubscription.delete_discountc                 K   rM  rg  r>   rP  r>   r>   r?   rh       rf  c              	   K   rQ  )rd  r   rC  re  r!  rE  rF  rR  rP  r>   r>   r?   rh       c                    rU  )rd  r   rC  re  rE  rF  NrV  rJ  r>   r>   r?   _cls_delete_discount_async  s   	
z'Subscription._cls_delete_discount_asyncc                    rY  rg  r>   rO  r>   r>   r?   delete_discount_async  s   	z"Subscription.delete_discount_asyncc                    rY  rg  r>   rP  r>   r>   r?   rl       rk  c              	      r[  )rd  r   rC  re  r!  rE  rF  Nr\  rP  r>   r>   r?   rl       
r*   c                 K   s4   | j d|  |d}t|tstdt|j |S )
        By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled.
        rT  rF  %Expected list object from API, got %s)rH  r`  
isinstancer   	TypeErrorr8   r:   rK  r?  resultr>   r>   r?   list   s   
zSubscription.listc                    s<   | j d|  |dI dH }t|tstdt|j |S )ro  rT  rF  Nrp  )rW  r`  rq  r   rr  r8   r:   rs  r>   r>   r?   
list_async  s   
zSubscription.list_asyncr+   c                 K   rA  )G
        Upgrade the billing_mode of an existing subscription.
        r1   r_  (/v1/subscriptions/{subscription}/migrater2   rF  rG  rK  r2   r?  r>   r>   r?   _cls_migrate(     zSubscription._cls_migratec                 K   rM  rw  Nr>   r2   r?  r>   r>   r?   migrate:     zSubscription.migratec                 K   rM  r}  r>   rP  r>   r>   r?   r  D  ri  r{  c              	   K   rQ  )rw  r1   r_  rx  r!  ry  rF  rR  rP  r>   r>   r?   r  M  rj  c                    rU  )rw  r1   r_  rx  ry  rF  NrV  rz  r>   r>   r?   _cls_migrate_async_     
zSubscription._cls_migrate_asyncc                    rY  r}  r>   r~  r>   r>   r?   migrate_asyncq     zSubscription.migrate_asyncc                    rY  r}  r>   rP  r>   r>   r?   r  {  rm  r  c              	      r[  )rw  r1   r_  rx  r!  ry  rF  Nr\  rP  r>   r>   r?   r    rn  r,   c                 K   s*   d|   t|f }td| jd||dS )
  
        Updates an existing subscription to match the specified parameters.
        When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
        To preview how the proration is calculated, use the [create preview](https://docs.stripe.com/docs/api/invoices/create_preview) endpoint.

        By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.

        Switching prices does not normally change the billing date or generate an immediate charge unless:


        The billing interval is changed (for example, from monthly to yearly).
        The subscription moves from free to paid.
        A trial starts or ends.


        In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://docs.stripe.com/docs/billing/subscriptions/upgrade-downgrade#immediate-payment).

        If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://docs.stripe.com/docs/api/invoices/create).

        If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription.

        Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating <a href="/docs/billing/subscriptions/usage-based">usage-based billing](https://docs.stripe.com/docs/rate-limits) instead.
        %s/%sr1   r_  rF  )r`  r   r   rH  rK  r!  r?  urlr>   r>   r?   modify  s   zSubscription.modifyc                    s2   d|   t|f }td| jd||dI dH S )r  r  r1   r_  rF  N)r`  r   r   rW  r  r>   r>   r?   modify_async  s   
zSubscription.modify_asyncr-   c                 K   rA  )  
        Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
        r1   r_  '/v1/subscriptions/{subscription}/resumery  rF  rG  rz  r>   r>   r?   _cls_resume  r|  zSubscription._cls_resumec                 K   rM  r  Nr>   r~  r>   r>   r?   resume  r  zSubscription.resumec                 K   rM  r  r>   rP  r>   r>   r?   r    ri  r  c              	   K   rQ  )r  r1   r_  r  r!  ry  rF  rR  rP  r>   r>   r?   r    rj  c                    rU  )r  r1   r_  r  ry  rF  NrV  rz  r>   r>   r?   _cls_resume_async  r  zSubscription._cls_resume_asyncc                    rY  r  r>   r~  r>   r>   r?   resume_async)  r  zSubscription.resume_asyncc                    rY  r  r>   rP  r>   r>   r?   r  3  rm  r  c              	      r[  )r  r1   r_  r  r!  ry  rF  Nr\  rP  r>   r>   r?   r  <  rn  r.   c                 K   s   | |fi |}|   |S )?
        Retrieves the subscription with the given ID.
        )refreshrK  r!  r?  instancer>   r>   r?   retrieveN  s   zSubscription.retrievec                    s$   | |fi |}|  I dH  |S )r  N)refresh_asyncr  r>   r>   r?   retrieve_asyncY  s   zSubscription.retrieve_asynckwargsr/   c                 O   s   | j |ddi|S )  
        Search for subscriptions you've previously created using Stripe's [Search Query Language](https://docs.stripe.com/docs/search#search-query-language).
        Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
        conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
        to an hour behind during outages. Search functionality is not available to merchants in India.
        
search_url/v1/subscriptions/search)_searchrK  argsr  r>   r>   r?   searchd  s   
zSubscription.searchc                    s   | j |ddi|I dH S )r  r  r  N)_search_asyncr  r>   r>   r?   search_asyncr  s   
zSubscription.search_asyncc                 O   s   | j |i | S N)r  auto_paging_iterr  r>   r>   r?   search_auto_paging_iter  s   z$Subscription.search_auto_paging_iterc                    s   | j |i |I d H  S r  )r  r  r  r>   r>   r?   search_auto_paging_iter_async  s   z*Subscription.search_auto_paging_iter_async)r  r  r  r  r  r"  r*  r+  r,  r.  r;  r<  N)Dr:   r;   r<   __doc__r3   r   r   r=   r	   rH   rO   rZ   r]   rn   rr   rx   r   r   r   r  r	  r   r   r  rN   rF   rm   r   r   r   r   classmethodr   rL  r   staticmethodr  r   rX  rZ  rb  rc  rf  rh  rk  rl  ru  rv  r{  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r   r  r   r  rG   r>   r>   r>   r?   r1   E   sb  
 

 o


		$$


r1   N)Ustripe._createable_api_resourcer   stripe._deletable_api_resourcer   stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._search_result_objectr   stripe._searchable_api_resourcer   stripe._stripe_objectr	   stripe._updateable_api_resourcer
   stripe._utilr   r   typingr   r   r   r   r   r   r   r   r   typing_extensionsr   r   r   stripe._accountr   stripe._applicationr   stripe._bank_accountr   stripe._cardr   r  stripe._customerr   stripe._discountr   stripe._invoicer   stripe._payment_methodr    stripe._setup_intentr!   stripe._sourcer"   stripe._subscription_itemr#   stripe._subscription_scheduler$   stripe._tax_idr%   stripe._tax_rater&   )stripe.params._subscription_cancel_paramsr'   )stripe.params._subscription_create_paramsr(   2stripe.params._subscription_delete_discount_paramsr)   'stripe.params._subscription_list_paramsr*   *stripe.params._subscription_migrate_paramsr+   )stripe.params._subscription_modify_paramsr,   )stripe.params._subscription_resume_paramsr-   +stripe.params._subscription_retrieve_paramsr.   )stripe.params._subscription_search_paramsr/   stripe.test_helpers._test_clockr0   r1   r>   r>   r>   r?   <module>   sX   ,
