
    +h                         d dl Z d dl mZ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 d dlmZmZmZmZmZ erd dlmZ  G d	 d
ed
         ZeZy)    N)api_requestorutil)ListableAPIResource)
ListObject)RequestOptions)ClassVarListOptional)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)FileLinkc                      e Zd ZU dZdZeed      ed<   er! G d de	      Z
 G d de      Z G 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$dee   dee   dee   ded   ded    f
d       Zededed   dd fd        Zd!Zed"        Ze	 	 	 	 d%d#       Zy)&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 independetly (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                   v    e Zd ZU ed   ed<   ed   ed<   	 ed   ed<   	 ed   ed<   	 ed	   ed
<   	 ed   ed<   y)File.ListParamszFile.ListParamsCreated|intcreatedstrending_before	List[str]expandintlimitah  Literal['account_requirement', 'additional_verification', 'business_icon', 'business_logo', 'customer_signature', 'dispute_evidence', 'document_provider_identity_document', 'finance_report_run', 'identity_document', 'identity_document_downloadable', 'pci_document', 'selfie', 'sigma_scheduled_query', 'tax_document_user_upload', 'terminal_reader_splashscreen']purposestarting_afterN__name__
__module____qualname__r   __annotations__     L/var/www/html/venv/lib/python3.12/site-packages/stripe/api_resources/file.py
ListParamsr   #   sn     !=>>&u--  ,, u%% ! {  (..r&   r(   c                   T    e Zd ZU ed   ed<   	 ed   ed<   	 ed   ed<   	 ed   ed<   y)File.ListParamsCreatedr   gtgteltlteNr    r%   r&   r'   ListParamsCreatedr*   <   sH    E"" U## E"" U##r&   r/   c                       e Zd ZU ed   ed<   y)File.RetrieveParamsr   r   Nr    r%   r&   r'   RetrieveParamsr1   N   s    ,,r&   r2   r   
expires_atfilenameidr   linksobject)account_requirementadditional_verificationbusiness_iconbusiness_logocustomer_signaturedispute_evidence#document_provider_identity_documentfinance_report_runidentity_documentidentity_document_downloadablepci_documentselfiesigma_scheduled_querytax_document_user_uploadterminal_reader_splashscreenr   sizetitletypeurlNapi_keystripe_versionstripe_accountparamsr   returnc                     | j                  d| j                         ||||      }t        |t              s!t	        dt        |      j                  z        |S )z
        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)rK   rL   rM   rN   z%Expected list object from API, got %s)_static_request	class_url
isinstancer   	TypeErrorrI   r!   )clsrK   rL   rM   rN   results         r'   listz	File.list   sf     $$MMO)) % 
 &*-7<((* 
 r&   r1   c                 8     | |fi |}|j                          |S )z
        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)rV   r5   rN   instances       r'   retrievezFile.retrieve   s$     r$V$r&   file_uploadc                      y)Nz	/v1/filesr%   )rV   s    r'   rS   zFile.class_url   s    r&   c                     |xs |}t        j                  |t        j                  ||      }| j	                         }ddi}	|j                  d|||	      \  }
}t        j                  |
|||      S )N)api_baseapi_versionaccountzContent-Typezmultipart/form-datapost)rN   headers)r   APIRequestorstripeupload_api_baserS   requestr   convert_to_stripe_object)rV   rK   ra   rL   rM   rN   version	requestorrJ   supplied_headersresponses              r'   createzFile.create   s     /!..++"	
	 mmo*,AB%--C0@ . 
' ,,gw
 	
r&   )NNN)NNNN)r!   r"   r#   __doc__r   r   r   r$   r   r   r(   r   r/   r2   r   r
   r   r   classmethodr   rX   r\   OBJECT_NAME_ALTrS   rn   r%   r&   r'   r   r      s    .4K'&/*3	 	2		 	$	^ 	 L  sm 	G Jz*++ FO 	( " I C= 3- 
#  "&(,(,	# ! !	
 *+ 
F	 6  &'< =	  $O   
 
r&   r   )rf   r   r   stripe.api_resources.abstractr    stripe.api_resources.list_objectr   stripe.request_optionsr   typingr   r	   r
   typing_extensionsr   r   r   r   r   stripe.api_resources.file_linkr   r   
FileUploadr%   r&   r'   <module>ry      sJ     & = 7 1 + +  7E
v& E
R 
r&   