
    +hY                         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 d dlmZ erd dlmZ d dlmZ  G d	 d
ed
         Zy)    )APIResource)Customer)ExpandableField)ClassVarDictOptional)LiteralTYPE_CHECKING)
quote_plus)
CreditNote)Invoicec                       e Zd ZU dZdZeed      ed<   eed<   	 eed<   	 e	e
d      ed<   	 eed<   	 e
d	   ed
<   	 e	e   ed<   	 eed<   	 eed<   	 e	e
d      ed<   	 eed<   	 e	eeef      ed<   	 ed   ed<   	 ed   ed<   	 d Zedd       Zy)CustomerBalanceTransactiona5  
    Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value,
    which denotes a debit or credit that's automatically applied to their next invoice upon finalization.
    You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update),
    or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.

    Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance)
    customer_balance_transactionOBJECT_NAMEamountcreatedr   credit_notecurrencyr   customerdescriptionending_balanceidr   invoicelivemodemetadataobject)

adjustmentapplied_to_invoicer   initialinvoice_overpaidinvoice_too_largeinvoice_too_small	migrationunapplied_from_invoiceunspent_receiver_credittypec                     | j                   }| j                  }t        |t              r|j                   }t        j                         }t        |      }t        |      }|d|d|S )N/z/balance_transactions/)r   r   
isinstancer   	class_urlr   )selftokenr   base	cust_extnextns         d/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/customer_balance_transaction.pyinstance_urlz'CustomerBalanceTransaction.instance_url\   sV    ==h){{H!!#x(	% 26	4HH    Nc                     t        d      )NzCan't retrieve a Customer Balance Transaction without a Customer ID. Use Customer.retrieve_customer_balance_transaction('cus_123', 'cbtxn_123'))NotImplementedError)clsr   api_keyparamss       r1   retrievez#CustomerBalanceTransaction.retrievef   s    !Y
 	
r3   )N)__name__
__module____qualname____doc__r   r   r	   __annotations__intr   r   strboolr   r2   classmethodr9    r3   r1   r   r      s     	' ./ ' K L /,788 M j)) #  	G oi011 N tCH~&& 233 		# I 
 
r3   r   N)stripe.api_resources.abstractr   stripe.api_resources.customerr   %stripe.api_resources.expandable_fieldr   typingr   r   r   typing_extensionsr	   r
   urllib.parser    stripe.api_resources.credit_noter   stripe.api_resources.invoicer   r   rC   r3   r1   <module>rL      s9    6 2 A + + 4 #;4\
-I!J \
r3   