o
    Bi	3                     @   sx   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 d dlmZmZmZ G dd	 d	eZd
S )    )
ListObject)RequestOptions)StripeService)sanitize_id)Authorization)DictListcast)LiteralNotRequired	TypedDictc                	   @   s  e Zd ZG dd deZG dd deZG dd deZG dd deZG d	d
 d
eZG dd deZ	i i fddde
dee fddZi i fddde
dee fddZi i fdeddde
defddZi i fdeddde
defddZi i fdeddde
defddZi i fdeddde
defddZi i fdedd de
defd!d"Zi i fdedd de
defd#d$Zi i fdedd%de
defd&d'Zi i fdedd%de
defd(d)Zd*S )+AuthorizationServicec                   @   s:   e Zd ZU ee ed< 	 eee  ed< 	 ed ed< dS )"AuthorizationService.ApproveParamsamountexpandLiteral['']|Dict[str, str]metadataN)__name__
__module____qualname__r   int__annotations__r   str r   r   e/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/issuing/_authorization_service.pyApproveParams   s   
 r   c                   @   ,   e Zd ZU eee  ed< 	 ed ed< dS )"AuthorizationService.DeclineParamsr   r   r   Nr   r   r   r   r   r   r   r   r   r   r   DeclineParams   
   
 r   c                   @   s   e Zd ZU ee ed< 	 ee ed< 	 ed ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< 	 eed	  ed
< dS )AuthorizationService.ListParamscard
cardholderz*AuthorizationService.ListParamsCreated|intcreatedending_beforer   limitstarting_after)closedpendingreversedstatusN)	r   r   r   r   r   r   r   r   r
   r   r   r   r   
ListParams%   s"   
 r,   c                   @   sD   e Zd ZU ee ed< 	 ee ed< 	 ee ed< 	 ee ed< dS )z&AuthorizationService.ListParamsCreatedgtgteltlteN)r   r   r   r   r   r   r   r   r   r   ListParamsCreatedG   s   
 r1   c                   @   s   e Zd ZU eee  ed< dS )#AuthorizationService.RetrieveParamsr   Nr   r   r   r   r   RetrieveParamsY   s   
 r3   c                   @   r   )!AuthorizationService.UpdateParamsr   r   r   Nr   r   r   r   r   UpdateParams_   r    r5   paramsr!   optionsreturnc              	   C   s   t tt | jddd||dS )
        Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
        get/v1/issuing/authorizationsapibase_addressr6   r7   )r	   r   r   _requestselfr6   r7   r   r   r   listi   s   zAuthorizationService.listc              	      s&   t tt | jddd||dI dH S )r9   r:   r;   r<   r=   N)r	   r   r   _request_asyncr@   r   r   r   
list_async|   s   
zAuthorizationService.list_asyncauthorizationr2   c              	   C   &   t t| jddjt|dd||dS )<
        Retrieves an Issuing Authorization object.
        r:   */v1/issuing/authorizations/{authorization}rE   r<   r=   r	   r   r?   formatr   rA   rE   r6   r7   r   r   r   retrieve      	zAuthorizationService.retrievec              	      .   t t| jddjt|dd||dI dH S )rG   r:   rH   rI   r<   r=   Nr	   r   rC   rK   r   rL   r   r   r   retrieve_async      	
z#AuthorizationService.retrieve_asyncr4   c              	   C   rF   )
        Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
        postrH   rI   r<   r=   rJ   rL   r   r   r   update   rN   zAuthorizationService.updatec              	      rO   )rS   rT   rH   rI   r<   r=   NrP   rL   r   r   r   update_async   rR   z!AuthorizationService.update_asyncr   c              	   C   rF   )  
        [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
        This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
        rT   2/v1/issuing/authorizations/{authorization}/approverI   r<   r=   rJ   rL   r   r   r   approve      
zAuthorizationService.approvec              	      rO   )rW   rT   rX   rI   r<   r=   NrP   rL   r   r   r   approve_async      

z"AuthorizationService.approve_asyncr   c              	   C   rF   )  
        [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
        This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
        rT   2/v1/issuing/authorizations/{authorization}/declinerI   r<   r=   rJ   rL   r   r   r   decline  rZ   zAuthorizationService.declinec              	      rO   )r]   rT   r^   rI   r<   r=   NrP   rL   r   r   r   decline_async,  r\   z"AuthorizationService.decline_asyncN)r   r   r   r   r   r   r,   r1   r3   r5   r   r   r   rB   rD   r   rM   rQ   rU   rV   rY   r[   r_   r`   r   r   r   r   r      s    
"








r   N)stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   stripe.issuing._authorizationr   typingr   r   r	   typing_extensionsr
   r   r   r   r   r   r   r   <module>   s   