a
    !f                     @   s   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rpd dlmZ d dlmZ G d	d
 d
ed
 ZdS )    )APIResource)Customer)ExpandableField)ClassVarDictOptional)LiteralTYPE_CHECKING)
quote_plus)
CreditNote)Invoicec                   @   s   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d Zedd dddZdS )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)
    Zcustomer_balance_transactionOBJECT_NAMEamountcreatedr   credit_notecurrencyr   customerdescriptionZending_balanceidr   ZinvoiceZlivemodemetadataobject)
Z
adjustmentZapplied_to_invoicer   initialZinvoice_overpaidZinvoice_too_largeZinvoice_too_smallZ	migrationZunapplied_from_invoiceZunspent_receiver_credittypec                 C   sB   | j }| j}t|tr|j }t }t|}t|}d|||f S )Nz%s/%s/balance_transactions/%s)r   r   
isinstancer   Z	class_urlr
   )selftokenr   baseZ	cust_extnZextn r   r/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/customer_balance_transaction.pyinstance_url\   s    
z'CustomerBalanceTransaction.instance_urlN)returnc                 K   s   t dd S )NzCan't retrieve a Customer Balance Transaction without a Customer ID. Use Customer.retrieve_customer_balance_transaction('cus_123', 'cbtxn_123'))NotImplementedError)clsr   Zapi_keyparamsr   r   r   retrievef   s    z#CustomerBalanceTransaction.retrieve)N)__name__
__module____qualname____doc__r   r   r   __annotations__intr   r   strboolr   r    classmethodr%   r   r   r   r   r      s4   

 r   N)Zstripe.api_resources.abstractr   Zstripe.api_resources.customerr   Z%stripe.api_resources.expandable_fieldr   typingr   r   r   Ztyping_extensionsr   r	   urllib.parser
   Z stripe.api_resources.credit_noter   Zstripe.api_resources.invoicer   r   r   r   r   r   <module>   s   