o
    Bi                    @   sx   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 G dd	 d	eZd
S )    )
ListObject)RequestOptions)StripeService)SubscriptionSchedule)sanitize_id)DictListcast)LiteralNotRequired	TypedDictc                	   @   s  e Zd 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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/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZG d9d: d:eZ G d;d< d<eZ!G d=d> d>eZ"G d?d@ d@eZ#G dAdB dBeZ$G dCdD dDeZ%G dEdF dFeZ&G dGdH dHeZ'G dIdJ dJeZ(G dKdL dLeZ)G dMdN dNeZ*G dOdP dPeZ+G dQdR dReZ,G dSdT dTeZ-G dUdV dVeZ.G dWdX dXeZ/G dYdZ dZeZ0G d[d\ d\eZ1G d]d^ d^eZ2G d_d` d`eZ3G dadb dbeZ4G dcdd ddeZ5G dedf dfeZ6G dgdh dheZ7G didj djeZ8G dkdl dleZ9G dmdn dneZ:G dodp dpeZ;i i fdqdrdse<dte=e> fdudvZ?i i fdqdrdse<dte=e> fdwdxZ@i i fdqdydse<dte>fdzd{ZAi i fdqdydse<dte>fd|d}ZBi i fd~eCdqddse<dte>fddZDi i fd~eCdqddse<dte>fddZEi i fd~eCdqddse<dte>fddZFi i fd~eCdqddse<dte>fddZGi i fd~eCdqddse<dte>fddZHi i fd~eCdqddse<dte>fddZIi i fd~eCdqddse<dte>fddZJi i fd~eCdqddse<dte>fddZKdS )SubscriptionScheduleServicec                   @   s:   e Zd ZU eee  ed< 	 ee ed< 	 ee ed< dS )(SubscriptionScheduleService.CancelParamsexpandinvoice_nowprorateN__name__
__module____qualname__r   r   str__annotations__bool r   r   e/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_subscription_schedule_service.pyCancelParams   s   
 r   c                   @   s   e Zd ZU ee ed< 	 ed ed< 	 eed  ed< 	 eee  ed< 	 ee ed< 	 ed ed	< 	 eed
  ed< 	 ed ed< dS )(SubscriptionScheduleService.CreateParamscustomer7SubscriptionScheduleService.CreateParamsDefaultSettingsdefault_settingscancelnonereleaserenewend_behaviorr   from_subscriptionLiteral['']|Dict[str, str]metadata-SubscriptionScheduleService.CreateParamsPhasephasesint|Literal['now']
start_dateN)r   r   r   r   r   r   r
   r   r   r   r   r   CreateParams   s.   
 r-   c                   @      e Zd ZU ee ed< 	 ed ed< 	 eed  ed< 	 ed ed< 	 eed  ed	< 	 ee ed
< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed ed< dS )r   application_fee_percentCSubscriptionScheduleService.CreateParamsDefaultSettingsAutomaticTaxautomatic_tax	automaticphase_startbilling_cycle_anchorzTLiteral['']|SubscriptionScheduleService.CreateParamsDefaultSettingsBillingThresholdsbilling_thresholdscharge_automaticallysend_invoicecollection_methoddefault_payment_methodLiteral['']|strdescriptionFSubscriptionScheduleService.CreateParamsDefaultSettingsInvoiceSettingsinvoice_settingson_behalf_ofzOLiteral['']|SubscriptionScheduleService.CreateParamsDefaultSettingsTransferDatatransfer_dataNr   r   r   r   floatr   r
   r   r   r   r   r   CreateParamsDefaultSettingsC   >   
 rD   c                   @   $   e Zd ZU eed< 	 ed ed< dS )r0   enabledLSubscriptionScheduleService.CreateParamsDefaultSettingsAutomaticTaxLiability	liabilityNr   r   r   r   r   r   r   r   r   r   'CreateParamsDefaultSettingsAutomaticTaxw      
 rK   c                   @   (   e Zd ZU ee ed< 	 ed ed< dS )rH   accountrN   selftypeNr   r   r   r   r   r   r
   r   r   r   r   0CreateParamsDefaultSettingsAutomaticTaxLiability   
   
 rS   c                   @   (   e Zd ZU ee ed< 	 ee ed< dS )zHSubscriptionScheduleService.CreateParamsDefaultSettingsBillingThresholds
amount_gtereset_billing_cycle_anchorNr   r   r   r   intr   r   r   r   r   r   ,CreateParamsDefaultSettingsBillingThresholds   rT   rZ   c                   @   6   e Zd ZU ed ed< 	 ee ed< 	 ed ed< dS )r>   Literal['']|List[str]account_tax_idsdays_until_dueLSubscriptionScheduleService.CreateParamsDefaultSettingsInvoiceSettingsIssuerissuerNr   r   r   r   r   rY   r   r   r   r   *CreateParamsDefaultSettingsInvoiceSettings      
 rb   c                   @   rM   )r_   rN   rO   rQ   NrR   r   r   r   r   0CreateParamsDefaultSettingsInvoiceSettingsIssuer   rT   rd   c                   @   $   e Zd ZU ee ed< 	 eed< dS )zCSubscriptionScheduleService.CreateParamsDefaultSettingsTransferDataamount_percentdestinationNr   r   r   r   rC   r   r   r   r   r   r   'CreateParamsDefaultSettingsTransferData   
   
 ri   c                   @   sX  e Zd ZU eed  ed< 	 ee ed< 	 ed ed< 	 eed  ed< 	 ed ed	< 	 eed
  ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ee	 ed< 	 ed ed< 	 ed ed< 	 ee	 ed< 	 ee
eef  ed< 	 ee ed< 	 eed  ed< 	 ed ed < 	 ee ed!< 	 ee	 ed"< d#S )$r)   ;SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemadd_invoice_itemsr/   9SubscriptionScheduleService.CreateParamsPhaseAutomaticTaxr1   r2   r5   zJLiteral['']|SubscriptionScheduleService.CreateParamsPhaseBillingThresholdsr6   r7   r:   couponcurrencyr;   r\   default_tax_ratesr<   r=   zGLiteral['']|List[SubscriptionScheduleService.CreateParamsPhaseDiscount]	discountsend_date<SubscriptionScheduleService.CreateParamsPhaseInvoiceSettingsr?   1SubscriptionScheduleService.CreateParamsPhaseItemitems
iterationsr(   r@   always_invoicecreate_prorationsr"   proration_behavior9SubscriptionScheduleService.CreateParamsPhaseTransferDatarA   trial	trial_endNr   r   r   r   r   r   rC   r
   r   rY   r   r   r   r   r   r   CreateParamsPhase   sz   
 r   c                   @   V   e Zd ZU eed  ed< 	 ee ed< 	 ed ed< 	 ee ed< 	 ed ed< d	S )
rk   CSubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemDiscountrq   priceDSubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemPriceData
price_dataquantityr\   	tax_ratesNr   r   r   r   r   r   r   rY   r   r   r   r   CreateParamsPhaseAddInvoiceItem%  "   
 r   c                   @   6   e Zd ZU ee ed< 	 ee ed< 	 ee ed< dS )r   rn   discountpromotion_codeNr   r   r   r   r   r   r   r   r   r   'CreateParamsPhaseAddInvoiceItemDiscountA     
 r   c                   @   N   e Zd ZU eed< 	 eed< 	 eed  ed< 	 ee ed< 	 ee ed< dS )r   ro   product	exclusive	inclusiveunspecifiedtax_behaviorunit_amountunit_amount_decimalNr   r   r   r   r   r   r
   rY   r   r   r   r   (CreateParamsPhaseAddInvoiceItemPriceDataO     
 r   c                   @   rF   )rm   rG   BSubscriptionScheduleService.CreateParamsPhaseAutomaticTaxLiabilityrI   NrJ   r   r   r   r   CreateParamsPhaseAutomaticTaxg  rL   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   &CreateParamsPhaseAutomaticTaxLiabilitys  rT   r   c                   @   rU   )z>SubscriptionScheduleService.CreateParamsPhaseBillingThresholdsrV   rW   NrX   r   r   r   r   "CreateParamsPhaseBillingThresholds}  rT   r   c                   @   r   )z5SubscriptionScheduleService.CreateParamsPhaseDiscountrn   r   r   Nr   r   r   r   r   CreateParamsPhaseDiscount  r   r   c                   @   r[   )rs   r\   r]   r^   BSubscriptionScheduleService.CreateParamsPhaseInvoiceSettingsIssuerr`   Nra   r   r   r   r    CreateParamsPhaseInvoiceSettings  rc   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   &CreateParamsPhaseInvoiceSettingsIssuer  rT   r   c                   @      e Zd ZU ed ed< 	 ed ed< 	 eeeef  ed< 	 ee ed< 	 ee ed< 	 ed ed	< 	 ee ed
< 	 ed ed< dS )rt   zNLiteral['']|SubscriptionScheduleService.CreateParamsPhaseItemBillingThresholdsr6   zKLiteral['']|List[SubscriptionScheduleService.CreateParamsPhaseItemDiscount]rq   r(   planr   :SubscriptionScheduleService.CreateParamsPhaseItemPriceDatar   r   r\   r   Nr   r   r   r   r   r   r   rY   r   r   r   r   CreateParamsPhaseItem  .   
 r   c                   @      e Zd ZU eed< dS )zBSubscriptionScheduleService.CreateParamsPhaseItemBillingThresholds	usage_gteNr   r   r   rY   r   r   r   r   r   &CreateParamsPhaseItemBillingThresholds     
 r   c                   @   r   )z9SubscriptionScheduleService.CreateParamsPhaseItemDiscountrn   r   r   Nr   r   r   r   r   CreateParamsPhaseItemDiscount  r   r   c                   @   X   e Zd ZU eed< 	 eed< 	 ded< 	 eed  ed< 	 ee ed< 	 ee ed< d	S )
r   ro   r   CSubscriptionScheduleService.CreateParamsPhaseItemPriceDataRecurring	recurringr   r   r   r   Nr   r   r   r   r   CreateParamsPhaseItemPriceData     
 r   c                   @   (   e Zd ZU ed ed< 	 ee ed< dS )r   daymonthweekyearintervalinterval_countNr   r   r   r
   r   r   rY   r   r   r   r   'CreateParamsPhaseItemPriceDataRecurring  rT   r   c                   @   re   )r{   rf   rg   Nrh   r   r   r   r   CreateParamsPhaseTransferData  rj   r   c                   @   s   e Zd ZU ed ed< 	 ed ed< 	 ed ed< 	 ee ed< 	 ee ed< 	 eee  ed	< 	 ee ed
< 	 ed ed< 	 ee ed< 	 ee ed< dS )&SubscriptionScheduleService.ListParamsz4SubscriptionScheduleService.ListParamsCanceledAt|intcanceled_atz5SubscriptionScheduleService.ListParamsCompletedAt|intcompleted_atz1SubscriptionScheduleService.ListParamsCreated|intcreatedr   ending_beforer   limitz4SubscriptionScheduleService.ListParamsReleasedAt|intreleased_at	scheduledstarting_afterN)	r   r   r   r   r   r   r   rY   r   r   r   r   r   
ListParams  s:   
 r   c                   @   D   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )z0SubscriptionScheduleService.ListParamsCanceledAtgtgteltlteNr   r   r   r   rY   r   r   r   r   r   ListParamsCanceledAtM     
 r   c                   @   r   )z1SubscriptionScheduleService.ListParamsCompletedAtr   r   r   r   Nr   r   r   r   r   ListParamsCompletedAt_  r   r   c                   @   r   )z-SubscriptionScheduleService.ListParamsCreatedr   r   r   r   Nr   r   r   r   r   ListParamsCreatedq  r   r   c                   @   r   )z0SubscriptionScheduleService.ListParamsReleasedAtr   r   r   r   Nr   r   r   r   r   ListParamsReleasedAt  r   r   c                   @   s,   e Zd ZU eee  ed< 	 ee ed< dS ))SubscriptionScheduleService.ReleaseParamsr   preserve_cancel_dateNr   r   r   r   r   ReleaseParams  s
   
 r   c                   @   s   e Zd ZU eee  ed< dS )*SubscriptionScheduleService.RetrieveParamsr   N)r   r   r   r   r   r   r   r   r   r   r   RetrieveParams  s   
 r   c                   @   sp   e Zd ZU ed ed< 	 eed  ed< 	 eee  ed< 	 ed ed< 	 eed  ed	< 	 eed
  ed< dS )(SubscriptionScheduleService.UpdateParams7SubscriptionScheduleService.UpdateParamsDefaultSettingsr   r    r%   r   r'   r(   -SubscriptionScheduleService.UpdateParamsPhaser*   rw   rz   N)r   r   r   r   r   r
   r   r   r   r   r   r   UpdateParams  s*   
 r   c                   @   r.   )r   r/   CSubscriptionScheduleService.UpdateParamsDefaultSettingsAutomaticTaxr1   r2   r5   zTLiteral['']|SubscriptionScheduleService.UpdateParamsDefaultSettingsBillingThresholdsr6   r7   r:   r;   r<   r=   FSubscriptionScheduleService.UpdateParamsDefaultSettingsInvoiceSettingsr?   r@   zOLiteral['']|SubscriptionScheduleService.UpdateParamsDefaultSettingsTransferDatarA   NrB   r   r   r   r   UpdateParamsDefaultSettings  rE   r   c                   @   rF   )r   rG   LSubscriptionScheduleService.UpdateParamsDefaultSettingsAutomaticTaxLiabilityrI   NrJ   r   r   r   r   'UpdateParamsDefaultSettingsAutomaticTax  rL   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   0UpdateParamsDefaultSettingsAutomaticTaxLiability  rT   r   c                   @   rU   )zHSubscriptionScheduleService.UpdateParamsDefaultSettingsBillingThresholdsrV   rW   NrX   r   r   r   r   ,UpdateParamsDefaultSettingsBillingThresholds  rT   r   c                   @   r[   )r   r\   r]   r^   LSubscriptionScheduleService.UpdateParamsDefaultSettingsInvoiceSettingsIssuerr`   Nra   r   r   r   r   *UpdateParamsDefaultSettingsInvoiceSettings  rc   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   0UpdateParamsDefaultSettingsInvoiceSettingsIssuer+  rT   r   c                   @   re   )zCSubscriptionScheduleService.UpdateParamsDefaultSettingsTransferDatarf   rg   Nrh   r   r   r   r   'UpdateParamsDefaultSettingsTransferData5  rj   r   c                   @   sf  e Zd ZU eed  ed< 	 ee ed< 	 ed ed< 	 eed  ed< 	 ed ed	< 	 eed
  ed< 	 ee ed< 	 ee ed< 	 ee ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ed ed< 	 ee	 ed< 	 ee
eef  ed< 	 ee ed< 	 eed  ed< 	 ed ed < 	 ed! ed"< 	 ee ed#< 	 ed ed$< d%S )&r   ;SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemrl   r/   9SubscriptionScheduleService.UpdateParamsPhaseAutomaticTaxr1   r2   r5   zJLiteral['']|SubscriptionScheduleService.UpdateParamsPhaseBillingThresholdsr6   r7   r:   rn   ro   r;   r\   rp   r<   r=   zGLiteral['']|List[SubscriptionScheduleService.UpdateParamsPhaseDiscount]rq   r+   rr   <SubscriptionScheduleService.UpdateParamsPhaseInvoiceSettingsr?   1SubscriptionScheduleService.UpdateParamsPhaseItemru   rv   r(   r@   rw   rz   r,   9SubscriptionScheduleService.UpdateParamsPhaseTransferDatarA   r|   r}   Nr~   r   r   r   r   UpdateParamsPhase?  s~   
 r   c                   @   r   )
r   CSubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemDiscountrq   r   DSubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemPriceDatar   r   r\   r   Nr   r   r   r   r   UpdateParamsPhaseAddInvoiceItem  r   r   c                   @   r   )r   rn   r   r   Nr   r   r   r   r   'UpdateParamsPhaseAddInvoiceItemDiscount  r   r   c                   @   r   )r   ro   r   r   r   r   r   Nr   r   r   r   r   (UpdateParamsPhaseAddInvoiceItemPriceData  r   r   c                   @   rF   )r   rG   BSubscriptionScheduleService.UpdateParamsPhaseAutomaticTaxLiabilityrI   NrJ   r   r   r   r   UpdateParamsPhaseAutomaticTax  rL   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   &UpdateParamsPhaseAutomaticTaxLiability  rT   r   c                   @   rU   )z>SubscriptionScheduleService.UpdateParamsPhaseBillingThresholdsrV   rW   NrX   r   r   r   r   "UpdateParamsPhaseBillingThresholds  rT   r   c                   @   r   )z5SubscriptionScheduleService.UpdateParamsPhaseDiscountrn   r   r   Nr   r   r   r   r   UpdateParamsPhaseDiscount  r   r   c                   @   r[   )r   r\   r]   r^   BSubscriptionScheduleService.UpdateParamsPhaseInvoiceSettingsIssuerr`   Nra   r   r   r   r    UpdateParamsPhaseInvoiceSettings  rc   r   c                   @   rM   )r   rN   rO   rQ   NrR   r   r   r   r   &UpdateParamsPhaseInvoiceSettingsIssuer-  rT   r   c                   @   r   )r   zNLiteral['']|SubscriptionScheduleService.UpdateParamsPhaseItemBillingThresholdsr6   zKLiteral['']|List[SubscriptionScheduleService.UpdateParamsPhaseItemDiscount]rq   r(   r   r   :SubscriptionScheduleService.UpdateParamsPhaseItemPriceDatar   r   r\   r   Nr   r   r   r   r   UpdateParamsPhaseItem7  r   r   c                   @   r   )zBSubscriptionScheduleService.UpdateParamsPhaseItemBillingThresholdsr   Nr   r   r   r   r   &UpdateParamsPhaseItemBillingThresholds_  r   r   c                   @   r   )z9SubscriptionScheduleService.UpdateParamsPhaseItemDiscountrn   r   r   Nr   r   r   r   r   UpdateParamsPhaseItemDiscounte  r   r   c                   @   r   )
r   ro   r   CSubscriptionScheduleService.UpdateParamsPhaseItemPriceDataRecurringr   r   r   r   r   Nr   r   r   r   r   UpdateParamsPhaseItemPriceDatas  r   r  c                   @   r   )r   r   r   r   Nr   r   r   r   r   'UpdateParamsPhaseItemPriceDataRecurring  rT   r  c                   @   re   )r   rf   rg   Nrh   r   r   r   r   UpdateParamsPhaseTransferData  rj   r  paramsr   optionsreturnc              	   C   s   t tt | jddd||dS )D
        Retrieves the list of your subscription schedules.
        get/v1/subscription_schedulesapibase_addressr  r  )r	   r   r   _requestrP   r  r  r   r   r   list  s   z SubscriptionScheduleService.listc              	      s&   t tt | jddd||dI dH S )r  r  r	  r
  r  N)r	   r   r   _request_asyncr  r   r   r   
list_async  s   
z&SubscriptionScheduleService.list_asyncr   c              	   C   s   t t| jddd||dS )
        Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
        postr	  r
  r  )r	   r   r  r  r   r   r   create  s   z"SubscriptionScheduleService.createc              	      s"   t t| jddd||dI dH S )r  r  r	  r
  r  N)r	   r   r  r  r   r   r   create_async  s   
z(SubscriptionScheduleService.create_asyncscheduler   c              	   C   &   t t| jddjt|dd||dS )
        Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.
        r  %/v1/subscription_schedules/{schedule}r  r
  r  r	   r   r  formatr   rP   r  r  r  r   r   r   retrieve     	z$SubscriptionScheduleService.retrievec              	      .   t t| jddjt|dd||dI dH S )r  r  r  r  r
  r  Nr	   r   r  r  r   r  r   r   r   retrieve_async     	
z*SubscriptionScheduleService.retrieve_asyncr   c              	   C   r  )<
        Updates an existing subscription schedule.
        r  r  r  r
  r  r  r  r   r   r   update  r  z"SubscriptionScheduleService.updatec              	      r   )r$  r  r  r  r
  r  Nr!  r  r   r   r   update_async1  r#  z(SubscriptionScheduleService.update_asyncr   c              	   C   r  )
        Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
        r  ,/v1/subscription_schedules/{schedule}/cancelr  r
  r  r  r  r   r   r   r!   G  r  z"SubscriptionScheduleService.cancelc              	      r   )r'  r  r(  r  r
  r  Nr!  r  r   r   r   cancel_async]  r#  z(SubscriptionScheduleService.cancel_asyncr   c              	   C   r  )  
        Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
        r  -/v1/subscription_schedules/{schedule}/releaser  r
  r  r  r  r   r   r   r#   s  r  z#SubscriptionScheduleService.releasec              	      r   )r*  r  r+  r  r
  r  Nr!  r  r   r   r   release_async  r#  z)SubscriptionScheduleService.release_asyncN)Lr   r   r   r   r   r-   rD   rK   rS   rZ   rb   rd   ri   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   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%  r&  r!   r)  r#   r,  r   r   r   r   r      sj   (4



j


(

2
"4



n


(











r   N)stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._subscription_scheduler   stripe._utilr   typingr   r   r	   typing_extensionsr
   r   r   r   r   r   r   r   <module>   s   