
    +hw              	           d dl mZmZmZ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mZmZmZ d dlmZmZmZmZ d dlmZ  G d d	ed	   ed	   ed	   ed	         Zy
)    )CreateableAPIResourceDeletableAPIResourceListableAPIResourceUpdateableAPIResource)
ListObject)RequestOptions)class_method_variant)ClassVarDictListOptionalcastoverload)LiteralNotRequiredUnpackTYPE_CHECKING)
quote_plusc                      e Zd ZU dZdZeed      ed<   er7 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e   ed<   	 ee   ed<   	 eed<   	 ee   ed<   	 ee   ed<   	 eed<   	 eed<   	 eeef   ed<   	 ed   ed<   	 ee   ed<   	 eed<   	 eed<   	 eed      ed<   	 e	 	 	 	 d2dee   dee   dee   d ee   d!ed"   d#d fd$       Zed%ed!ed&   d#d fd'       Zeed%ed!ed&   d#d fd(              Zed!ed&   d#d fd)       Z ed*      d!ed&   d#d fd+       Ze	 	 	 d3dee   dee   d ee   d!ed,   d#ed    f
d-       Zeded!ed.   d#d fd/       Zeded!ed0   d#d fd1       Z y)4WebhookEndpointa  
    You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be
    notified about events that happen in your Stripe account or connected
    accounts.

    Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.

    Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure)
    webhook_endpointOBJECT_NAMEc                       e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 eed      ed<   	 ed	   ed
<   	 ed   ed<   	 eed<   y)WebhookEndpoint.CreateParamsa  Literal['2011-01-01', '2011-06-21', '2011-06-28', '2011-08-01', '2011-09-15', '2011-11-17', '2012-02-23', '2012-03-25', '2012-06-18', '2012-06-28', '2012-07-09', '2012-09-24', '2012-10-26', '2012-11-07', '2013-02-11', '2013-02-13', '2013-07-05', '2013-08-12', '2013-08-13', '2013-10-29', '2013-12-03', '2014-01-31', '2014-03-13', '2014-03-28', '2014-05-19', '2014-06-13', '2014-06-17', '2014-07-22', '2014-07-26', '2014-08-04', '2014-08-20', '2014-09-08', '2014-10-07', '2014-11-05', '2014-11-20', '2014-12-08', '2014-12-17', '2014-12-22', '2015-01-11', '2015-01-26', '2015-02-10', '2015-02-16', '2015-02-18', '2015-03-24', '2015-04-07', '2015-06-15', '2015-07-07', '2015-07-13', '2015-07-28', '2015-08-07', '2015-08-19', '2015-09-03', '2015-09-08', '2015-09-23', '2015-10-01', '2015-10-12', '2015-10-16', '2016-02-03', '2016-02-19', '2016-02-22', '2016-02-23', '2016-02-29', '2016-03-07', '2016-06-15', '2016-07-06', '2016-10-19', '2017-01-27', '2017-02-14', '2017-04-06', '2017-05-25', '2017-06-05', '2017-08-15', '2017-12-14', '2018-01-23', '2018-02-05', '2018-02-06', '2018-02-28', '2018-05-21', '2018-07-27', '2018-08-23', '2018-09-06', '2018-09-24', '2018-10-31', '2018-11-08', '2019-02-11', '2019-02-19', '2019-03-14', '2019-05-16', '2019-08-14', '2019-09-09', '2019-10-08', '2019-10-17', '2019-11-05', '2019-12-03', '2020-03-02', '2020-08-27', '2022-08-01', '2022-11-15', '2023-08-16', '2023-10-16']api_versionboolconnectLiteral['']|strdescription)*zaccount.application.authorizedz account.application.deauthorizedz account.external_account.createdz account.external_account.deletedz account.external_account.updatedzaccount.updatedzapplication_fee.createdzapplication_fee.refund.updatedzapplication_fee.refundedzbalance.availablez$billing_portal.configuration.createdz$billing_portal.configuration.updatedzbilling_portal.session.createdzcapability.updatedzcash_balance.funds_availablezcharge.capturedzcharge.dispute.closedzcharge.dispute.createdzcharge.dispute.funds_reinstatedzcharge.dispute.funds_withdrawnzcharge.dispute.updatedzcharge.expiredzcharge.failedzcharge.pendingzcharge.refund.updatedzcharge.refundedzcharge.succeededzcharge.updatedz%checkout.session.async_payment_failedz(checkout.session.async_payment_succeededzcheckout.session.completedzcheckout.session.expiredzcoupon.createdzcoupon.deletedzcoupon.updatedzcredit_note.createdzcredit_note.updatedzcredit_note.voidedzcustomer.createdzcustomer.deletedzcustomer.discount.createdzcustomer.discount.deletedzcustomer.discount.updatedzcustomer.source.createdzcustomer.source.deletedzcustomer.source.expiringzcustomer.source.updatedzcustomer.subscription.createdzcustomer.subscription.deletedzcustomer.subscription.pausedz,customer.subscription.pending_update_appliedz,customer.subscription.pending_update_expiredzcustomer.subscription.resumedz$customer.subscription.trial_will_endzcustomer.subscription.updatedzcustomer.tax_id.createdzcustomer.tax_id.deletedzcustomer.tax_id.updatedzcustomer.updatedz)customer_cash_balance_transaction.createdzfile.createdz%financial_connections.account.createdz)financial_connections.account.deactivatedz*financial_connections.account.disconnectedz)financial_connections.account.reactivatedz/financial_connections.account.refreshed_balancez&identity.verification_session.canceledz%identity.verification_session.createdz(identity.verification_session.processingz&identity.verification_session.redactedz,identity.verification_session.requires_inputz&identity.verification_session.verifiedzinvoice.createdzinvoice.deletedzinvoice.finalization_failedzinvoice.finalizedzinvoice.marked_uncollectiblezinvoice.paidzinvoice.payment_action_requiredzinvoice.payment_failedzinvoice.payment_succeededzinvoice.sentzinvoice.upcomingzinvoice.updatedzinvoice.voidedzinvoiceitem.createdzinvoiceitem.deletedzissuing_authorization.createdzissuing_authorization.requestzissuing_authorization.updatedzissuing_card.createdzissuing_card.updatedzissuing_cardholder.createdzissuing_cardholder.updatedzissuing_dispute.closedzissuing_dispute.createdz issuing_dispute.funds_reinstatedzissuing_dispute.submittedzissuing_dispute.updatedzissuing_token.createdzissuing_token.updatedzissuing_transaction.createdzissuing_transaction.updatedzmandate.updatedz(payment_intent.amount_capturable_updatedzpayment_intent.canceledzpayment_intent.createdzpayment_intent.partially_fundedzpayment_intent.payment_failedzpayment_intent.processingzpayment_intent.requires_actionzpayment_intent.succeededzpayment_link.createdzpayment_link.updatedzpayment_method.attachedz$payment_method.automatically_updatedzpayment_method.detachedzpayment_method.updatedzpayout.canceledzpayout.createdzpayout.failedzpayout.paidzpayout.reconciliation_completedzpayout.updatedzperson.createdzperson.deletedzperson.updatedzplan.createdzplan.deletedzplan.updatedzprice.createdzprice.deletedzprice.updatedzproduct.createdzproduct.deletedzproduct.updatedzpromotion_code.createdzpromotion_code.updatedzquote.acceptedzquote.canceledzquote.createdzquote.finalizedz!radar.early_fraud_warning.createdz!radar.early_fraud_warning.updatedzrefund.createdzrefund.updatedzreporting.report_run.failedzreporting.report_run.succeededzreporting.report_type.updatedzreview.closedzreview.openedzsetup_intent.canceledzsetup_intent.createdzsetup_intent.requires_actionzsetup_intent.setup_failedzsetup_intent.succeededz!sigma.scheduled_query_run.createdzsource.canceledzsource.chargeablezsource.failedzsource.mandate_notificationz!source.refund_attributes_requiredzsource.transaction.createdzsource.transaction.updatedzsubscription_schedule.abortedzsubscription_schedule.canceledzsubscription_schedule.completedzsubscription_schedule.createdzsubscription_schedule.expiringzsubscription_schedule.releasedzsubscription_schedule.updatedztax.settings.updatedztax_rate.createdztax_rate.updatedzterminal.reader.action_failedz terminal.reader.action_succeededz!test_helpers.test_clock.advancingztest_helpers.test_clock.createdztest_helpers.test_clock.deletedz(test_helpers.test_clock.internal_failureztest_helpers.test_clock.readyztopup.canceledztopup.createdztopup.failedztopup.reversedztopup.succeededztransfer.createdztransfer.reversedztransfer.updatedz treasury.credit_reversal.createdztreasury.credit_reversal.postedz!treasury.debit_reversal.completedztreasury.debit_reversal.createdz.treasury.debit_reversal.initial_credit_grantedz!treasury.financial_account.closedz"treasury.financial_account.createdz2treasury.financial_account.features_status_updatedz"treasury.inbound_transfer.canceledz!treasury.inbound_transfer.createdz treasury.inbound_transfer.failedz#treasury.inbound_transfer.succeededz"treasury.outbound_payment.canceledz!treasury.outbound_payment.createdz7treasury.outbound_payment.expected_arrival_date_updatedz treasury.outbound_payment.failedz treasury.outbound_payment.postedz"treasury.outbound_payment.returnedz#treasury.outbound_transfer.canceledz"treasury.outbound_transfer.createdz8treasury.outbound_transfer.expected_arrival_date_updatedz!treasury.outbound_transfer.failedz!treasury.outbound_transfer.postedz#treasury.outbound_transfer.returnedz treasury.received_credit.createdztreasury.received_credit.failedz"treasury.received_credit.succeededztreasury.received_debit.createdzinvoiceitem.updatedzorder.createdzrecipient.createdzrecipient.deletedzrecipient.updatedzsku.createdzsku.deletedzsku.updatedenabled_events	List[str]expandLiteral['']|Dict[str, str]metadataurlN)__name__
__module____qualname__r   __annotations__r   r   str     X/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/webhook_endpoint.pyCreateParamsr   $   s    $ R  !(( %%677 !a#ce eL  ,, "">?? Hr-   r/   c                       e Zd Zy)WebhookEndpoint.DeleteParamsN)r'   r(   r)   r,   r-   r.   DeleteParamsr1   )  s    r-   r2   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)	WebhookEndpoint.ListParamsr+   ending_beforer"   r#   intlimitstarting_afterNr'   r(   r)   r   r*   r,   r-   r.   
ListParamsr4   ,  sH    &u--  ,, u%% (..r-   r:   c                   x    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   	 ed   ed<   y)WebhookEndpoint.ModifyParamsr   r   r   disabledaq  List[Literal['*', 'account.application.authorized', 'account.application.deauthorized', 'account.external_account.created', 'account.external_account.deleted', 'account.external_account.updated', 'account.updated', 'application_fee.created', 'application_fee.refund.updated', 'application_fee.refunded', 'balance.available', 'billing_portal.configuration.created', 'billing_portal.configuration.updated', 'billing_portal.session.created', 'capability.updated', 'cash_balance.funds_available', 'charge.captured', 'charge.dispute.closed', 'charge.dispute.created', 'charge.dispute.funds_reinstated', 'charge.dispute.funds_withdrawn', 'charge.dispute.updated', 'charge.expired', 'charge.failed', 'charge.pending', 'charge.refund.updated', 'charge.refunded', 'charge.succeeded', 'charge.updated', 'checkout.session.async_payment_failed', 'checkout.session.async_payment_succeeded', 'checkout.session.completed', 'checkout.session.expired', 'coupon.created', 'coupon.deleted', 'coupon.updated', 'credit_note.created', 'credit_note.updated', 'credit_note.voided', 'customer.created', 'customer.deleted', 'customer.discount.created', 'customer.discount.deleted', 'customer.discount.updated', 'customer.source.created', 'customer.source.deleted', 'customer.source.expiring', 'customer.source.updated', 'customer.subscription.created', 'customer.subscription.deleted', 'customer.subscription.paused', 'customer.subscription.pending_update_applied', 'customer.subscription.pending_update_expired', 'customer.subscription.resumed', 'customer.subscription.trial_will_end', 'customer.subscription.updated', 'customer.tax_id.created', 'customer.tax_id.deleted', 'customer.tax_id.updated', 'customer.updated', 'customer_cash_balance_transaction.created', 'file.created', 'financial_connections.account.created', 'financial_connections.account.deactivated', 'financial_connections.account.disconnected', 'financial_connections.account.reactivated', 'financial_connections.account.refreshed_balance', 'identity.verification_session.canceled', 'identity.verification_session.created', 'identity.verification_session.processing', 'identity.verification_session.redacted', 'identity.verification_session.requires_input', 'identity.verification_session.verified', 'invoice.created', 'invoice.deleted', 'invoice.finalization_failed', 'invoice.finalized', 'invoice.marked_uncollectible', 'invoice.paid', 'invoice.payment_action_required', 'invoice.payment_failed', 'invoice.payment_succeeded', 'invoice.sent', 'invoice.upcoming', 'invoice.updated', 'invoice.voided', 'invoiceitem.created', 'invoiceitem.deleted', 'issuing_authorization.created', 'issuing_authorization.request', 'issuing_authorization.updated', 'issuing_card.created', 'issuing_card.updated', 'issuing_cardholder.created', 'issuing_cardholder.updated', 'issuing_dispute.closed', 'issuing_dispute.created', 'issuing_dispute.funds_reinstated', 'issuing_dispute.submitted', 'issuing_dispute.updated', 'issuing_token.created', 'issuing_token.updated', 'issuing_transaction.created', 'issuing_transaction.updated', 'mandate.updated', 'payment_intent.amount_capturable_updated', 'payment_intent.canceled', 'payment_intent.created', 'payment_intent.partially_funded', 'payment_intent.payment_failed', 'payment_intent.processing', 'payment_intent.requires_action', 'payment_intent.succeeded', 'payment_link.created', 'payment_link.updated', 'payment_method.attached', 'payment_method.automatically_updated', 'payment_method.detached', 'payment_method.updated', 'payout.canceled', 'payout.created', 'payout.failed', 'payout.paid', 'payout.reconciliation_completed', 'payout.updated', 'person.created', 'person.deleted', 'person.updated', 'plan.created', 'plan.deleted', 'plan.updated', 'price.created', 'price.deleted', 'price.updated', 'product.created', 'product.deleted', 'product.updated', 'promotion_code.created', 'promotion_code.updated', 'quote.accepted', 'quote.canceled', 'quote.created', 'quote.finalized', 'radar.early_fraud_warning.created', 'radar.early_fraud_warning.updated', 'refund.created', 'refund.updated', 'reporting.report_run.failed', 'reporting.report_run.succeeded', 'reporting.report_type.updated', 'review.closed', 'review.opened', 'setup_intent.canceled', 'setup_intent.created', 'setup_intent.requires_action', 'setup_intent.setup_failed', 'setup_intent.succeeded', 'sigma.scheduled_query_run.created', 'source.canceled', 'source.chargeable', 'source.failed', 'source.mandate_notification', 'source.refund_attributes_required', 'source.transaction.created', 'source.transaction.updated', 'subscription_schedule.aborted', 'subscription_schedule.canceled', 'subscription_schedule.completed', 'subscription_schedule.created', 'subscription_schedule.expiring', 'subscription_schedule.released', 'subscription_schedule.updated', 'tax.settings.updated', 'tax_rate.created', 'tax_rate.updated', 'terminal.reader.action_failed', 'terminal.reader.action_succeeded', 'test_helpers.test_clock.advancing', 'test_helpers.test_clock.created', 'test_helpers.test_clock.deleted', 'test_helpers.test_clock.internal_failure', 'test_helpers.test_clock.ready', 'topup.canceled', 'topup.created', 'topup.failed', 'topup.reversed', 'topup.succeeded', 'transfer.created', 'transfer.reversed', 'transfer.updated', 'treasury.credit_reversal.created', 'treasury.credit_reversal.posted', 'treasury.debit_reversal.completed', 'treasury.debit_reversal.created', 'treasury.debit_reversal.initial_credit_granted', 'treasury.financial_account.closed', 'treasury.financial_account.created', 'treasury.financial_account.features_status_updated', 'treasury.inbound_transfer.canceled', 'treasury.inbound_transfer.created', 'treasury.inbound_transfer.failed', 'treasury.inbound_transfer.succeeded', 'treasury.outbound_payment.canceled', 'treasury.outbound_payment.created', 'treasury.outbound_payment.expected_arrival_date_updated', 'treasury.outbound_payment.failed', 'treasury.outbound_payment.posted', 'treasury.outbound_payment.returned', 'treasury.outbound_transfer.canceled', 'treasury.outbound_transfer.created', 'treasury.outbound_transfer.expected_arrival_date_updated', 'treasury.outbound_transfer.failed', 'treasury.outbound_transfer.posted', 'treasury.outbound_transfer.returned', 'treasury.received_credit.created', 'treasury.received_credit.failed', 'treasury.received_credit.succeeded', 'treasury.received_debit.created', 'invoiceitem.updated', 'order.created', 'recipient.created', 'recipient.deleted', 'recipient.updated', 'sku.created', 'sku.deleted', 'sku.updated']]r!   r"   r#   r$   r%   r+   r&   Nr9   r,   r-   r.   ModifyParamsr<   >  sw    $%677 "&)) ( Df   ,, "">?? U##r-   r>   c                       e Zd ZU ed   ed<   y)WebhookEndpoint.RetrieveParamsr"   r#   Nr9   r,   r-   r.   RetrieveParamsr@   Z  s    ,,r-   rA   r   applicationcreatedr   r!   idlivemoder%   objectsecretstatusr&   TdeletedNapi_keyidempotency_keystripe_versionstripe_accountparamsr   returnc                 `    t        d| j                  d| j                         |||||            S )a  
        A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard.
        r   post)r   _static_request	class_url)clsrJ   rK   rL   rM   rN   s         r.   createzWebhookEndpoint.create  s=     
 	
r-   sidr1   c                 z    | j                         dt        |      }t        d| j                  d||            S )
        You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard.
        /r   deleterN   rS   r   r   rR   )rT   rV   rN   r&   s       r.   _cls_deletezWebhookEndpoint._cls_delete  s=     *S/:#f=
 	
r-   c                      yrX   Nr,   )rV   rN   s     r.   rZ   zWebhookEndpoint.delete  s     	r-   c                      yr_   r,   selfrN   s     r.   rZ   zWebhookEndpoint.delete  s     	r-   r]   c                 F    | j                  d| j                         |      S )rX   rZ   r[   )_request_and_refreshinstance_urlra   s     r.   rZ   zWebhookEndpoint.delete  s.     (( ) 
 	
r-   r4   c                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z;
        Returns a list of your webhook endpoints.
        get)rJ   rL   rM   rN   z%Expected list object from API, got %s)rR   rS   
isinstancer   	TypeErrortyper'   )rT   rJ   rL   rM   rN   results         r.   listzWebhookEndpoint.list  sf     $$MMO)) % 
 &*-7<((* 
 r-   r<   c                 z    | j                         dt        |      }t        d| j                  d||            S )z
        Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint.
        rY   r   rQ   r[   r\   )rT   rD   rN   r&   s       r.   modifyzWebhookEndpoint.modify  s=     *R.9F;
 	
r-   r@   c                 8     | |fi |}|j                          |S )zC
        Retrieves the webhook endpoint with the given ID.
        )refresh)rT   rD   rN   instances       r.   retrievezWebhookEndpoint.retrieve  s$     r$V$r-   )NNNN)NNN)!r'   r(   r)   __doc__r   r
   r   r*   r   r   r/   r2   r:   r>   rA   r   r+   r6   r   r   r   classmethodr   rU   r]   r   staticmethodrZ   r	   r   rl   rn   rr   r,   r-   r.   r   r      s2    :LK'"456KC	> C	J	> 		 	$	> 	8	^ 	 # # L # I 	G N 38n &'' SM K 
H gdm$$  "&)-(,(,
#
 "#
 !	

 !
 78
 

 
0 



!'(F!G

	

 

 "#AB	   =>	  -(

=>

	

 )

  "&(,(,	# ! !	
 56 
%	& 6 



 &'E F

	

 

  &'G H	 r-   r   N)stripe.api_resources.abstractr   r   r   r    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.utilr	   typingr
   r   r   r   r   r   typing_extensionsr   r   r   r   urllib.parser   r   r,   r-   r.   <module>r}      sY     8 1 , A A I I #|+,*+)*+,	|r-   