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	m
Z
mZmZmZmZ d dlmZmZmZmZmZ er>d dlmZ G dd	 d	ed	 ed	 ZeZd
S )    )CreateableAPIResource)
ListObject)ListableAPIResource)RequestOptions)AnyClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)FileLinkc                   @   s  e Zd ZU dZdZeed  ed< 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eed< 	 ee ed< 	 ee ed< 	 eed< 	 eed  ed< 	 ed ed< 	 ed ed< 	 eed< 	 ee ed< 	 ee ed< 	 ee ed< 	 eded dd fddZeded dd fd d!Zeded" ded  fd#d$Zeded" ded  fd%d&Zededed' dd fd(d)Zededed' dd fd*d+Zd,Zed-d. Zd/S )0Filea  
    This object represents files hosted on Stripe's servers. You can upload
    files with the [create file](https://stripe.com/docs/api#create_file) request
    (for example, when uploading dispute evidence). Stripe also
    creates files independently (for example, the results of a [Sigma scheduled
    query](https://stripe.com/docs/api#scheduled_queries)).

    Related guide: [File upload guide](https://stripe.com/docs/file-upload)
    fileOBJECT_NAMEc                   @   sD   e Zd ZU eee  ed< 	 eed< 	 ed ed< 	 ed ed< dS )File.CreateParamsexpandr   File.CreateParamsFileLinkDatafile_link_data)account_requirementadditional_verificationbusiness_iconbusiness_logocustomer_signaturedispute_evidenceidentity_documentissuing_regulatory_reportingpci_documenttax_document_user_uploadterminal_reader_splashscreenpurposeN)	__name__
__module____qualname__r   r	   str__annotations__r   r    r*   r*   L/var/www/html/Trade-python/venv/lib/python3.10/site-packages/stripe/_file.pyCreateParams!   s   
 r,   c                   @   s2   e Zd ZU eed< 	 ee ed< 	 ed ed< dS )r   create
expires_atzLiteral['']|Dict[str, str]metadataN)r%   r&   r'   boolr)   r   intr*   r*   r*   r+   CreateParamsFileLinkData?   s   
 r2   c                   @   sh   e Zd ZU ed ed< 	 ee ed< 	 eee  ed< 	 ee ed< 	 eed  ed< 	 ee ed< d	S )
File.ListParamszFile.ListParamsCreated|intcreatedending_beforer   limitr   r   r   r   r   r   #document_provider_identity_documentfinance_report_runr   identity_document_downloadabler    r!   selfiesigma_scheduled_queryr"   r#   r$   starting_afterN)	r%   r&   r'   r   r)   r(   r	   r1   r   r*   r*   r*   r+   
ListParamsM   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File.ListParamsCreatedgtgteltlteN)r%   r&   r'   r   r1   r)   r*   r*   r*   r+   ListParamsCreatedz   s   
 rC   c                   @   s   e Zd ZU eee  ed< dS )File.RetrieveParamsr   N)r%   r&   r'   r   r	   r(   r)   r*   r*   r*   r+   RetrieveParams   s   
 rE   r4   r.   filenameidr   linksobjectr7   r$   sizetitletypeurlparamsr   returnc                 K   s$   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   postfilesrN   base_address)r   _static_request	class_urlclsrN   r*   r*   r+   r-      s   zFile.createc                    s,   d|d< t d| jd|  |ddI dH S )rP   rQ   rR   r   rS   rT   rU   N)r   _static_request_asyncrX   rY   r*   r*   r+   create_async   s   	
zFile.create_asyncr3   c                 K   s4   | j d|  |d}t|tstdt|j |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.
        getrN   %Expected list object from API, got %s)rW   rX   
isinstancer   	TypeErrorrL   r%   rZ   rN   resultr*   r*   r+   list   s   
z	File.listc                    s<   | j d|  |dI dH }t|tstdt|j |S )r]   r^   r_   Nr`   )r[   rX   ra   r   rb   rL   r%   rc   r*   r*   r+   
list_async
  s   
zFile.list_asyncrD   c                 K   s   | |fi |}|   |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://stripe.com/docs/file-upload#download-file-contents).
        )refreshrZ   rG   rN   instancer*   r*   r+   retrieve  s   zFile.retrievec                    s$   | |fi |}|  I dH  |S )rg   N)refresh_asyncri   r*   r*   r+   retrieve_async)  s   zFile.retrieve_asyncfile_uploadc                 C   s   dS )Nz	/v1/filesr*   )rZ   r*   r*   r+   rX   :  s   zFile.class_urlN)r%   r&   r'   __doc__r   r   r   r)   r   r,   r   r2   r>   rC   rE   r1   r
   r(   r   classmethodr   r-   r\   re   rf   rk   rm   OBJECT_NAME_ALTrX   r*   r*   r*   r+   r      s   
 
-
r   N)stripe._createable_api_resourcer   stripe._list_objectr   stripe._listable_api_resourcer   stripe._request_optionsr   typingr   r   r   r	   r
   r   typing_extensionsr   r   r   r   r   stripe._file_linkr   r   
FileUploadr*   r*   r*   r+   <module>   s      .