o
    iz                     @   s   d dl mZ d dlmZ d dlmZmZ d dlmZ er@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)File)
ListObject)RequestOptions)FileCreateParams)FileListParams)FileRetrieveParamsc                	   @   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S )FileServiceNparamsr   optionsr	   returnListObject[File]c              	   C   s   t d| jddd||dS )
        Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top.
        r   get	/v1/filesapibase_addressr   r   r   _requestselfr   r    r   t/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/_file_service.pylist   s   zFileService.listc              	      s"   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%   s   
zFileService.list_asyncr
   r   c              	   C   s.   |du ri }d|d< t d| jddd||dS 	a%  
        To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file.

        All of Stripe's officially supported Client libraries support sending multipart/form-data.
        Nzmultipart/form-datacontent_typer   postr   filesr   r   r   r   r   r   create8   s   
zFileService.createc              	      s6   |du ri }d|d< t d| jddd||dI dH S r"   r   r   r   r   r   create_asyncP   s   

zFileService.create_asyncfiler   c              	   C   s&   t d| jddjt|dd||dS )
        Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://docs.stripe.com/docs/file-upload#download-file-contents).
        r   r   /v1/files/{file}r(   r   r   )r   r   formatr   r   r(   r   r   r   r   r   retrieveh   s   	zFileService.retrievec              	      s.   t d| jddjt|dd||dI dH S )r)   r   r   r*   r+   r   r   N)r   r    r,   r   r-   r   r   r   retrieve_async|   s   	
zFileService.retrieve_async)NN)N)__name__
__module____qualname__r   r   r!   r&   r'   strr.   r/   r   r   r   r   r      sr    




r   N)stripe._stripe_servicer   stripe._utilr   typingr   r   typing_extensionsr   stripe._filer   stripe._list_objectr   stripe._request_optionsr	   !stripe.params._file_create_paramsr
   stripe.params._file_list_paramsr   #stripe.params._file_retrieve_paramsr   r   r   r   r   r   <module>   s   