a
    !fM                     @   s   d dl mZ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mZ d dlmZmZmZmZ erd dlmZ G d	d
 d
ed
 ed
 ZdS )    )CreateableAPIResourceListableAPIResource)ExpandableField)
ListObject)RequestOptions)StripeObject)ClassVarDictListOptionalcast)LiteralNotRequiredUnpackTYPE_CHECKING)Transactionc                	   @   sz  e Zd ZU dZdZeed  ed< G dd deZ	G dd de
ZG dd	 d	e
ZG d
d de
Zeed< eed< eed< eed< ee ed< eed< eed< eeef ed< ed ed< ed ed< eed< ed ed< e	ed< eed  ed< ed*ee ee ee ee ed d dd d!Zed+ee ee ee ed" ed  d#d$d%Zeeed& d d'd(d)Zde	iZdS ),CreditReversalz
    You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.
    ztreasury.credit_reversalOBJECT_NAMEc                   @   s   e Zd ZU ee ed< dS )z CreditReversal.StatusTransitionsZ	posted_atN)__name__
__module____qualname__r   int__annotations__ r   r   n/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/treasury/credit_reversal.pyStatusTransitions   s   
r   c                   @   s.   e Zd ZU ed ed< ed ed< eed< dS )CreditReversal.CreateParams	List[str]expandzDict[str, str]metadatareceived_creditNr   r   r   r   r   strr   r   r   r   CreateParams$   s   
r#   c                   @   s^   e Zd ZU ed ed< ed ed< eed< ed ed< ed ed< ed ed	< ed
 ed< dS )CreditReversal.ListParamsr"   Zending_beforer   r   financial_accountr   limitr    Zstarting_afterz+Literal['canceled', 'posted', 'processing']statusNr!   r   r   r   r   
ListParams2   s   
r(   c                   @   s   e Zd ZU ed ed< dS )CreditReversal.RetrieveParamsr   r   N)r   r   r   r   r   r   r   r   r   RetrieveParamsP   s   
r*   amountcreatedcurrencyr%   Zhosted_regulatory_receipt_urlidZlivemoder   )ZachZstripenetworkobjectr    )canceledZposted
processingr'   Zstatus_transitionsr   ZtransactionNr   )api_keyidempotency_keystripe_versionstripe_accountparamsreturnc                 K   s    t d| d|  |||||S )zP
        Reverses a ReceivedCredit and creates a CreditReversal object.
        r   post)r   _static_request	class_url)clsr3   r4   r5   r6   r7   r   r   r   create   s    zCreditReversal.creater$   )r3   r5   r6   r7   r8   c                 K   s:   | j d|  ||||d}t|ts6tdt|j |S )z4
        Returns a list of CreditReversals.
        get)r3   r5   r6   r7   z%Expected list object from API, got %s)r:   r;   
isinstancer   	TypeErrortyper   )r<   r3   r5   r6   r7   resultr   r   r   list   s    
zCreditReversal.listr)   )r.   r7   r8   c                 K   s   | |fi |}|   |S )z
        Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list
        )refresh)r<   r.   r7   instancer   r   r   retrieve   s    zCreditReversal.retrieve)NNNN)NNN)r   r   r   __doc__r   r   r   r   r   r   r   r#   r(   r*   r   r"   r   boolr	   r   classmethodr   r=   r   rC   rF   Z_inner_class_typesr   r   r   r   r      sp   
       
r   N)Zstripe.api_resources.abstractr   r   Z%stripe.api_resources.expandable_fieldr   Z stripe.api_resources.list_objectr   Zstripe.request_optionsr   Zstripe.stripe_objectr   typingr   r	   r
   r   r   Ztyping_extensionsr   r   r   r   Z)stripe.api_resources.treasury.transactionr   r   r   r   r   r   <module>   s   
