a
    !f9                      @   s   d dl mZ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mZmZ d dlmZmZmZmZmZ d dlmZ erd dlmZ G d	d
 d
ed
 ed
 ed
 ZdS )    )CreateableAPIResourceListableAPIResourceUpdateableAPIResource)ExpandableField)
ListObject)RequestOptions)ClassVarDictListOptionalcast)LiteralNotRequired	TypedDictUnpackTYPE_CHECKING)
quote_plus)Filec                	   @   sl  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d< ee ed< ed ed< eed< eed< eeef ed< ed ed< ee ed< ed(ee ee ee ee ed d dddZed)ee ee ee ed ed  ddd Zeeed! d d"d#d$Zeeed% d d"d&d'ZdS )*FileLinkz
    To share the contents of a `File` object with non-Stripe users, you can
    create a `FileLink`. `FileLink`s contain a URL that you can use to
    retrieve the contents of the file without authentication.
    Z	file_linkOBJECT_NAMEc                   @   s:   e Zd ZU ed ed< ed ed< eed< ed ed< dS )	FileLink.CreateParams	List[str]expandint
expires_atfileLiteral['']|Dict[str, str]metadataN)__name__
__module____qualname__r   __annotations__str r#   r#   _/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/file_link.pyCreateParams&   s
   
r%   c                   @   sb   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< ed ed< dS )FileLink.ListParamszFileLink.ListParamsCreated|intcreatedr"   Zending_beforer   r   boolexpiredr   r   limitZstarting_afterNr   r   r    r   r!   r#   r#   r#   r$   
ListParams8   s   
r,   c                   @   s>   e Zd ZU ed ed< ed ed< ed ed< ed ed< dS )zFileLink.ListParamsCreatedr   gtZgteltZlteNr+   r#   r#   r#   r$   ListParamsCreatedS   s
   
r/   c                   @   s2   e Zd ZU ed ed< ed ed< ed ed< dS )FileLink.ModifyParamsr   r   zLiteral['']|Literal['now']|intr   r   r   Nr+   r#   r#   r#   r$   ModifyParamse   s   
r1   c                   @   s   e Zd ZU ed ed< dS )FileLink.RetrieveParamsr   r   Nr+   r#   r#   r#   r$   RetrieveParamss   s   
r3   r'   r)   r   r   r   idZlivemoder   objecturlNr   )api_keyidempotency_keystripe_versionstripe_accountparamsreturnc                 K   s    t d| d|  |||||S )z1
        Creates a new file link object.
        r   post)r   _static_request	class_url)clsr7   r8   r9   r:   r;   r#   r#   r$   create   s    zFileLink.creater&   )r7   r9   r:   r;   r<   c                 K   s:   | j d|  ||||d}t|ts6tdt|j |S )z/
        Returns a list of file links.
        get)r7   r9   r:   r;   z%Expected list object from API, got %s)r>   r?   
isinstancer   	TypeErrortyper   )r@   r7   r9   r:   r;   resultr#   r#   r$   list   s    
zFileLink.listr0   )r4   r;   r<   c                 K   s*   d|   t|f }td| jd||dS )z_
        Updates an existing file link object. Expired links can no longer be updated.
        z%s/%sr   r=   )r;   )r?   r   r   r>   )r@   r4   r;   r6   r#   r#   r$   modify   s
    zFileLink.modifyr2   c                 K   s   | |fi |}|   |S )z<
        Retrieves the file link with the given ID.
        )refresh)r@   r4   r;   instancer#   r#   r$   retrieve   s    zFileLink.retrieve)NNNN)NNN)r   r   r    __doc__r   r   r   r!   r   r%   r,   r   r/   r1   r3   r   r(   r   r   r"   r	   classmethodr   rA   r   rG   rH   rK   r#   r#   r#   r$   r      sh   
       r   N)Zstripe.api_resources.abstractr   r   r   Z%stripe.api_resources.expandable_fieldr   Z stripe.api_resources.list_objectr   Zstripe.request_optionsr   typingr   r	   r
   r   r   Ztyping_extensionsr   r   r   r   r   urllib.parser   Zstripe.api_resources.filer   r   r#   r#   r#   r$   <module>   s   
