
    Aiz                         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e      Zy)    )StripeService)sanitize_id)Optionalcast)TYPE_CHECKING)File)
ListObject)RequestOptions)FileCreateParams)FileListParams)FileRetrieveParamsc            	           e Zd Z	 	 dded   ded   ddfdZ	 	 dded   ded   ddfd	Z	 ddd
ded   ddfdZ	 ddd
ded   ddfdZ	 	 ddeded   ded   ddfdZ		 	 ddeded   ded   ddfdZ
y)FileServiceNparamsr   optionsr
   returnListObject[File]c           
      B    t        d| j                  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   s      G/var/www/html/immo/lib/python3.12/site-packages/stripe/_file_service.pylistzFileService.list   s4     MM"  	
 		
    c           
      ^   K   t        d| j                  ddd||       d{         S 7 w)r   r   r   r   r   r   Nr   _request_asyncr   s      r   
list_asynczFileService.list_async%   sD      %%" &  	
 		
s    -+
	-r   r   c           
      T    |i }d|d<   t        d| j                  ddd||            S )%  
        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.
        multipart/form-datacontent_typer   postr   filesr   r   r   s      r   createzFileService.create8   sH     ?G"7MM$  	
 		
r!   c           
      p   K   |i }d|d<   t        d| j                  ddd||       d{         S 7 w)	r'   Nr(   r)   r   r*   r   r+   r   r#   r   s      r   create_asynczFileService.create_asyncP   sX      ?G"7%%$ &  	
 		
s   )64
	6filer   c                 t    t        d| j                  ddj                  t        |            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   s       r   retrievezFileService.retrieveh   sG     MM")){4/@)A"  	
 		
r!   c                    K   t        d| j                  ddj                  t        |            d||       d{         S 7 w)r1   r   r   r2   r3   r   r   N)r   r$   r4   r   r5   s       r   retrieve_asynczFileService.retrieve_async|   sW      %%")){4/@)A" &  	
 		
s   9AA
	A)NN)N)__name__
__module____qualname__r   r    r%   r,   r.   strr6   r8    r!   r   r   r      sB    .2.2
)*
 *+
 
	
* .2.2
)*
 *+
 
	
, /3
"
 *+
 
	
6 /3
"
 *+
 
	
6 26.2	

 -.
 *+	

 

. 26.2	

 -.
 *+	

 

r!   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   <module>rH      s6    1 $ ! +!.6B>F}
- }
r!   