
    +hC                         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mZmZ d dlmZmZmZmZmZ  G d ded         Zy	)
    )ListableAPIResource)
ListObject)RequestOptions)StripeObject)AnyClassVarDictListOptional)LiteralNotRequired	TypedDictUnpackTYPE_CHECKINGc                      e Zd ZU dZdZeed      ed<    G d de      Z	 G d de      Z
er! 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d<   eed<   	 eed<   	 ed   ed<   	 eed<   	 ee
   ed<   	 ed   ed<   	 e	 	 	 d$d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	e
d#Zy)%Eventa  
    Events are our way of letting you know when something interesting happens in
    your account. When an interesting event occurs, we create a new `Event`
    object. For example, when a charge succeeds, we create a `charge.succeeded`
    event, and when an invoice payment attempt fails, we create an
    `invoice.payment_failed` event. Certain API requests might create multiple
    events. For example, if you create a new subscription for a
    customer, you receive both a `customer.subscription.created` event and a
    `charge.succeeded` event.

    Events occur when the state of another API resource changes. The event's data
    field embeds the resource's state at the time of the change. For
    example, a `charge.succeeded` event contains a charge, and an
    `invoice.payment_failed` event contains an invoice.

    As with other API resources, you can use endpoints to retrieve an
    [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events)
    from the API. We also have a separate
    [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the
    `Event` objects directly to an endpoint on your server. You can manage
    webhooks in your
    [account settings](https://dashboard.stripe.com/account/webhooks). Learn how
    to [listen for events]
    (/docs/webhooks) so that your integration can automatically trigger reactions.

    When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications
    that occur in connected accounts. For these events, there's an
    additional `account` attribute in the received `Event` object.

    We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event)
    for 30 days.
    eventOBJECT_NAMEc                   >    e Zd ZU eeef   ed<   	 eeeef      ed<   y)
Event.Dataobjectprevious_attributesN)__name__
__module____qualname__r	   strr   __annotations__r        M/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/event.pyDatar   5   s/    S#X	 &d38n55	r   r!   c                   0    e Zd ZU ee   ed<   	 ee   ed<   y)Event.Requestididempotency_keyN)r   r   r   r   r   r   r   r   r    Requestr#   ?   s"    SM	 "#&	r   r&   c                       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<   	 ed   ed<   	 ed   ed<   y)Event.ListParamszEvent.ListParamsCreated|intcreatedbooldelivery_successr   ending_before	List[str]expandintlimitstarting_aftertypetypesNr   r   r   r   r   r   r   r    
ListParamsr(   K   s     !>??)&11 'u--  ,, u%% (.. e$$ {++r   r5   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)Event.ListParamsCreatedr/   gtgteltlteNr4   r   r   r    ListParamsCreatedr7   j   sH    E"" U## E"" U##r   r<   c                       e Zd ZU ed   ed<   y)Event.RetrieveParamsr-   r.   Nr4   r   r   r    RetrieveParamsr>   |   s    ,,r   r?   accountapi_versionr)   datar$   livemoder   pending_webhooksrequest)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.updatedr2   Napi_keystripe_versionstripe_accountparamsr(   returnc                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )a4  
        List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header).
        get)rF   rG   rH   rI   z%Expected list object from API, got %s)_static_request	class_url
isinstancer   	TypeErrorr2   r   )clsrF   rG   rH   rI   results         r    listz
Event.list  sf     $$MMO)) % 
 &*-7<((* 
 r   r>   c                 8     | |fi |}|j                          |S )z
        Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook.
        )refresh)rQ   r$   rI   instances       r    retrievezEvent.retrieve  s$     r$V$r   )rB   rE   )NNN)r   r   r   __doc__r   r   r   r   r   r!   r&   r   r   r5   r   r<   r?   r   r   r/   r*   classmethodr   r   rS   rW   _inner_class_typesr   r   r    r   r      s   B /6K''*+5| ,  	 	>		 	$	^ 	 c] # L JG N G  g `	b bF  "&(,(,	# ! !	
 +, 
G	 6  &'= >	  #'7;r   r   N)stripe.api_resources.abstractr    stripe.api_resources.list_objectr   stripe.request_optionsr   stripe.stripe_objectr   typingr   r   r	   r
   r   typing_extensionsr   r   r   r   r   r   r   r   r    <module>ra      s7    > 7 1 - 6 6 `<( `<r   