
    hb8                     T   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mZ d dlmZmZmZmZmZ er`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) d dl*m+Z+ d dl,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2m Z3 d dl4m5Z5  G d ded         Z6y)    )ExpandableField)
ListObject)ListableAPIResource)RequestOptions)StripeObject)ClassVarListOptionalUnion)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)ApplicationFee)ApplicationFeeRefund)Charge)ConnectCollectionTransfer)CustomerCashBalanceTransaction)Dispute)Payout)Refund)ReserveTransaction)Reversal)TaxDeductedAtSource)Topup)Transfer)Authorization)Transactionc                      e Zd ZU dZdZeed      ed<    G d de      Z	 G d de
      Z G d d	e      Z G d
 de
      Zeed<   	 eed<   	 eed<   	 eed<   	 ee   ed<   	 ee   ed<   	 eed<   	 ee	   ed<   	 eed<   	 eed<   	 ed   ed<   	 eed<   	 eeed         ed<   	 eed<   	 ed   ed<   	 eded   ded    fd        Z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d"   dd fd$       Zde	iZy%)&BalanceTransactiona&  
    Balance transactions represent funds moving through your Stripe account.
    Stripe creates them for every type of transaction that enters or leaves your Stripe account balance.

    Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types)
    balance_transactionOBJECT_NAMEc                   T    e Zd ZU eed<   	 ee   ed<   	 eed<   	 ee   ed<   	 eed<   y)BalanceTransaction.FeeDetailamountapplicationcurrencydescriptiontypeN)__name__
__module____qualname__int__annotations__r
   str     [/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/stripe/_balance_transaction.py	FeeDetailr%   2   sF    	 c]"	 	 c]"	 		r2   r4   c                       e Zd ZU ed   ed<   	 ee   ed<   	 ee   ed<   	 eee      ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed	<   	 ee   ed
<   y)BalanceTransaction.ListParamsz(BalanceTransaction.ListParamsCreated|intcreatedr(   ending_beforeexpandlimitpayoutsourcestarting_afterr*   N)r+   r,   r-   r   r/   r0   r	   r.   r1   r2   r3   
ListParamsr6   H   s    GHH	 c""	 #3''	 DI&&	 3	 C  	 C  	 $C((	 #	r2   r>   c                   T    e Zd ZU ee   ed<   	 ee   ed<   	 ee   ed<   	 ee   ed<   y)$BalanceTransaction.ListParamsCreatedgtgteltlteN)r+   r,   r-   r   r.   r/   r1   r2   r3   ListParamsCreatedr@   n   sH    	 	 	 	r2   rE   c                   $    e Zd ZU eee      ed<   y)!BalanceTransaction.RetrieveParamsr9   N)r+   r,   r-   r   r	   r0   r/   r1   r2   r3   RetrieveParamsrG      s    DI&&	r2   rH   r&   available_onr7   r(   r)   exchange_ratefeefee_detailsidnetobjectreporting_category)r   r   r   r   DisputeResourcer   r   IssuingDisputeResourcer   r   r   r   r   r   r   r   r<   status),
adjustmentadvanceadvance_fundinganticipation_repaymentapplication_feeapplication_fee_refundchargeclimate_order_purchaseclimate_order_refundconnect_collection_transfercontributionissuing_authorization_holdissuing_authorization_releaseissuing_disputeissuing_transactionobligation_outboundobligation_reversal_inboundpaymentpayment_failure_refundpayment_network_reserve_holdpayment_network_reserve_releasepayment_refundpayment_reversalpayment_unreconciledr;   payout_cancelpayout_failurepayout_minimum_balance_holdpayout_minimum_balance_releaserefundrefund_failurereserve_transactionreserved_fundsstripe_balance_payment_debit%stripe_balance_payment_debit_reversal
stripe_feestripe_fx_feetax_feetopuptopup_reversaltransfertransfer_canceltransfer_failuretransfer_refundr*   paramsr6   returnc                     | j                  d| j                         |      }t        |t              s!t	        dt        |      j                  z        |S )d  
        Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.

        Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
        getr   %Expected list object from API, got %s)_static_request	class_url
isinstancer   	TypeErrorr*   r+   clsr   results      r3   listzBalanceTransaction.list  s]     $$MMO % 

 &*-7<((* 
 r2   c                    K   | j                  d| j                         |       d{   }t        |t              s!t	        dt        |      j                  z        |S 7 7w)r   r   r   Nr   )_static_request_asyncr   r   r   r   r*   r+   r   s      r3   
list_asynczBalanceTransaction.list_async  sk      00MMO 1 
 

 &*-7<((* 
 
s   &A"A 8A"rG   c                 8     | |fi |}|j                          |S )
        Retrieves the balance transaction with the given ID.

        Note that this endpoint previously used the path /v1/balance/history/:id.
        )refreshr   rM   r   instances       r3   retrievezBalanceTransaction.retrieve1  s$     r$V$r2   c                 T   K    | |fi |}|j                          d{    |S 7 w)r   N)refresh_asyncr   s       r3   retrieve_asyncz!BalanceTransaction.retrieve_async>  s3      r$V$$$&&& 	's   (&(N)r+   r,   r-   __doc__r#   r   r   r/   r   r4   r   r>   r   rE   rH   r.   r0   r
   floatr	   r   r   classmethodr   r   r   r   r   r   _inner_class_typesr1   r2   r3   r!   r!   &   s    	 '"789 L ,$^ $LI $  K  L M # E?" 
H i  	G 
H )**  	
 , K +	- -\ =>	(	) * =>	(	) * 

 &'J K
	
 
 

 &'J K
	
 
 (3r2   r!   N)7stripe._expandable_fieldr   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   stripe._stripe_objectr   typingr   r	   r
   r   typing_extensionsr   r   r   r   r   stripe._application_feer   stripe._application_fee_refundr   stripe._charger   #stripe._connect_collection_transferr   )stripe._customer_cash_balance_transactionr   stripe._disputer   rQ   stripe._payoutr   stripe._refundr   stripe._reserve_transactionr   stripe._reversalr   stripe._tax_deducted_at_sourcer   stripe._topupr   stripe._transferr   stripe.issuing._authorizationr   stripe.issuing._disputerR   stripe.issuing._transactionr   r!   r1   r2   r3   <module>r      st    5 * = 2 . 2 2  6C%M ;%%>)B#);I7e4,-AB e4r2   