o
    i	                  	   @   sR   d dl mZ d dlmZ d dlmZ ed		ddeded	ee fd
dZdS )    )Optional)_util)
quote_pluszthe custom_method class decorator will be removed in a future version of stripe-python. Define custom methods directly and use StripeObject._static_request within.NF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 r+t| | | S 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   _static_requestr   _retrieve_params)clssidr   urlobjr   r    u/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/env/lib/python3.10/site-packages/stripe/_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   _static_request_stream)r   r   r   r   r   r   r   custom_method_request_stream(   s   zDcustom_method.<locals>.wrapper.<locals>.custom_method_request_stream_cls_)classmethodgetattrsetattrr   class_method_variant)r   r   r   class_method_implexisting_method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   striper   urllib.parser   
deprecatedstrr)   r   r   r   r   <module>   s    