a
    !f	                     @   s@   d dl mZ d dlmZ d dlmZ d	eeee dddZdS )
    )Optional)util)
quote_plusNF)name	http_verb	http_pathc                    s6   dvrt d  d u r   fdd}|S )N)getpostdeletez?Invalid http_verb: %s. Must be one of 'get', 'post' or 'delete'c                    s    fdd} fdd}r*t |}nt |}t| d }|d u rTt| | n.t| d | td |}t| | | S )Nc                    sB   d|   t| f }| j||d}d|v r>|jdkr>||_|S )N%s/%s/%sparamsobjectlist)	class_urlr   Z_static_requestr   Z_retrieve_params)clssidr   urlobjr   r    l/var/www/html/python-backend/venv/lib/python3.9/site-packages/stripe/api_resources/abstract/custom_method.pycustom_method_request   s    z=custom_method.<locals>.wrapper.<locals>.custom_method_requestc                    s&   d|   t| f }| j||dS )Nr   r   )r   r   Z_static_request_stream)r   r   r   r   r   r   r   custom_method_request_stream$   s    zDcustom_method.<locals>.wrapper.<locals>.custom_method_request_streamZ_cls_)classmethodgetattrsetattrr   Zclass_method_variant)r   r   r   Zclass_method_implZexisting_methodZinstance_methodr   r   is_streamingr   r   r   wrapper   s    
zcustom_method.<locals>.wrapper)
ValueError)r   r   r   r   r   r   r   r   custom_method   s    /r!   )NF)typingr   Zstriper   urllib.parser   strr!   r   r   r   r   <module>   s     