o
    ih                     @   s   d dl mZ d dlmZ d dlmZmZ d dlmZ erLd 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 d dlmZ d dlmZ G dd deZdS )    )StripeService)sanitize_id)Optionalcast)TYPE_CHECKING)
ListObject)RequestOptions)Order)OrderCancelParams)OrderCreateParams)OrderListParams)OrderRetrieveParams)OrderUpdateParamsc                	   @   s  e Zd Z		d"ded ded ddfdd	Z		d"ded ded ddfd
dZ	d#ddded ddfddZ	d#ddded ddfddZ		d"deded ded ddfddZ			d"deded ded ddfddZ
		d"deded ded ddfddZ		d"deded ded ddfddZ		d"deded ded ddfddZ		d"deded ded ddfd d!ZdS )$OrderServiceNparamsr   optionsr   returnListObject[Order]c              	   C      t d| 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.
        r   get/v1/climate/ordersapibase_addressr   r   r   _requestselfr   r    r   }/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/climate/_order_service.pylist      	zOrderService.listc              	      "   t d| jddd||dI dH S )r   r   r   r   r   r   Nr   _request_asyncr   r   r   r    
list_async*      	
zOrderService.list_asyncr   r	   c              	   C   r   )
        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.
        r	   postr   r   r   r   r   r   r   r    create>   r"   zOrderService.createc              	      r#   )r(   r	   r)   r   r   r   Nr$   r   r   r   r    create_asyncR   r'   zOrderService.create_asyncorderr   c              	   C   &   t d| jddjt|dd||dS )T
        Retrieves the details of a Climate order object with the given ID.
        r	   r   /v1/climate/orders/{order}r,   r   r   r   r   formatr   r   r,   r   r   r   r   r    retrievef      	zOrderService.retrievec              	      .   t d| jddjt|dd||dI dH S )r.   r	   r   r/   r0   r   r   Nr   r%   r2   r   r3   r   r   r    retrieve_asyncz      	
zOrderService.retrieve_asyncr   c              	   C   r-   )]
        Updates the specified order by setting the values of the parameters passed.
        r	   r)   r/   r0   r   r   r1   r3   r   r   r    update   r5   zOrderService.updatec              	      r6   )r:   r	   r)   r/   r0   r   r   Nr7   r3   r   r   r    update_async   r9   zOrderService.update_asyncr
   c              	   C   r-   )  
        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.
        r	   r)   !/v1/climate/orders/{order}/cancelr0   r   r   r1   r3   r   r   r    cancel   s   zOrderService.cancelc              	      r6   )r=   r	   r)   r>   r0   r   r   Nr7   r3   r   r   r    cancel_async   s   
zOrderService.cancel_async)NN)N)__name__
__module____qualname__r   r!   r&   r*   r+   strr4   r8   r;   r<   r?   r@   r   r   r   r    r      s    








r   N)stripe._stripe_servicer   stripe._utilr   typingr   r   typing_extensionsr   stripe._list_objectr   stripe._request_optionsr   stripe.climate._orderr	   *stripe.params.climate._order_cancel_paramsr
   *stripe.params.climate._order_create_paramsr   (stripe.params.climate._order_list_paramsr   ,stripe.params.climate._order_retrieve_paramsr   *stripe.params.climate._order_update_paramsr   r   r   r   r   r    <module>   s   