o
    Bi+                     @   s|   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 G dd	 d	eZd
S )    )
ListObject)RequestOptions)StripeService)sanitize_id)Order)DictListUnion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	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 fdddedefddZi f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 )-OrderServicec                   @      e Zd ZU eee  ed< dS )OrderService.CancelParamsexpandN__name__
__module____qualname__r   r   str__annotations__ r   r   ]/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/climate/_order_service.pyCancelParams      
 r   c                   @   sv   e Zd ZU ee ed< 	 ed ed< 	 ee ed< 	 eee  ed< 	 eeeef  ed< 	 ee ed< 	 eed< d	S )
OrderService.CreateParamsamount$OrderService.CreateParamsBeneficiarybeneficiarycurrencyr   metadatametric_tonsproductN)	r   r   r   r   intr   r   r   r   r   r   r   r   CreateParams   s   
 r%   c                   @   s   e Zd ZU eed< dS )r   public_nameN)r   r   r   r   r   r   r   r   r   CreateParamsBeneficiary1   s   
 r'   c                   @   sH   e Zd ZU ee ed< 	 eee  ed< 	 ee ed< 	 ee ed< dS )OrderService.ListParamsending_beforer   limitstarting_afterN)r   r   r   r   r   r   r   r$   r   r   r   r   
ListParams7   s   
 r,   c                   @   r   )OrderService.RetrieveParamsr   Nr   r   r   r   r   RetrieveParamsI   r   r.   c                   @   sB   e Zd ZU ed ed< 	 eee  ed< 	 eeeef  ed< dS )OrderService.UpdateParamsz0Literal['']|OrderService.UpdateParamsBeneficiaryr   r   r!   N)r   r   r   r   r   r   r   r   r   r   r   r   UpdateParamsO   s   
 r0   c                   @   s"   e Zd ZU eed ef ed< dS )z$OrderService.UpdateParamsBeneficiary r&   N)r   r   r   r	   r   r   r   r   r   r   r   UpdateParamsBeneficiary_   s   
 r2   paramsr(   optionsreturnc              	   C   s   t tt | jddd||dS )
        Lists all Climate order objects. The orders are returned sorted by creation date, with the
        most recently created orders appearing first.
        get/v1/climate/ordersapibase_addressr3   r4   )r
   r   r   _requestselfr3   r4   r   r   r   liste   s   	zOrderService.listc              	      s&   t tt | jddd||dI dH S )r6   r7   r8   r9   r:   N)r
   r   r   _request_asyncr=   r   r   r   
list_asyncy   s   	
zOrderService.list_asyncr   c              	   C   s   t t| jddd||dS )
        Creates a Climate order object for a given Climate product. The order will be processed immediately
        after creation and payment will be deducted your Stripe balance.
        postr8   r9   r:   )r
   r   r<   r=   r   r   r   create   s   zOrderService.createc              	      s"   t t| jddd||dI dH S )rB   rC   r8   r9   r:   N)r
   r   r@   r=   r   r   r   create_async   s   
zOrderService.create_asyncorderr-   c              	   C   &   t t| jddjt|dd||dS )T
        Retrieves the details of a Climate order object with the given ID.
        r7   /v1/climate/orders/{order}rF   r9   r:   r
   r   r<   formatr   r>   rF   r3   r4   r   r   r   retrieve      	zOrderService.retrievec              	      .   t t| jddjt|dd||dI dH S )rH   r7   rI   rJ   r9   r:   Nr
   r   r@   rL   r   rM   r   r   r   retrieve_async      	
zOrderService.retrieve_asyncr/   c              	   C   rG   )]
        Updates the specified order by setting the values of the parameters passed.
        rC   rI   rJ   r9   r:   rK   rM   r   r   r   update   rO   zOrderService.updatec              	      rP   )rT   rC   rI   rJ   r9   r:   NrQ   rM   r   r   r   update_async   rS   zOrderService.update_asyncr   c              	   C   rG   )  
        Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the
        reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
        might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
        provides 90 days advance notice and refunds the amount_total.
        rC   !/v1/climate/orders/{order}/cancelrJ   r9   r:   rK   rM   r   r   r   cancel  s   zOrderService.cancelc              	      rP   )rW   rC   rX   rJ   r9   r:   NrQ   rM   r   r   r   cancel_async  s   
zOrderService.cancel_asyncN)r   r   r   r   r   r%   r'   r,   r.   r0   r2   r   r   r   r?   rA   rD   rE   r   rN   rR   rU   rV   rY   rZ   r   r   r   r   r      s    








r   N)stripe._list_objectr   stripe._request_optionsr   stripe._stripe_servicer   stripe._utilr   stripe.climate._orderr   typingr   r   r	   r
   typing_extensionsr   r   r   r   r   r   r   r   <module>   s   