
    Āi                    Z    d dl mZ d dlmZmZmZ dZdZdZdZ	dZ
ed   Zdd	Zdd
ZddZy)    )annotations)LiteralUnionget_args   zX-Fal-Request-TimeoutzX-Fal-Request-Timeout-TypezX-Fal-Runner-HintzX-Fal-Queue-Priority)normallowc                    	 t        |       } | t        k  rt        dt         d      t        |       |t        <   y# t        $ r t        d|        w xY w)zV
    Validates the timeout and adds the timeout header to the headers dictionary.
    zTimeout must be a number, got zTimeout must be greater than z secondsN)float
ValueErrorMIN_REQUEST_TIMEOUT_SECONDSstrREQUEST_TIMEOUT_HEADER)timeoutheaderss     W/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/fal_client/_headers.pyadd_timeout_headerr      sn    E.
 --+,G+HQ
 	
 '*'lG"#  E9'CDDEs	   < Ac                    | |t         <   y )N)RUNNER_HINT_HEADER)hintr   s     r   add_hint_headerr   "   s    "&G    c                `    t        t              }| |vrt        d| d|  d      | |t        <   y)a&  
    Validates the priority and adds the priority header to the headers dictionary.

    Args:
        priority: Queue priority, must be "normal" or "low".
        headers: Headers dictionary to add the priority header to.

    Raises:
        ValueError: If priority is not a valid value.
    zPriority must be one of z, got ''N)r   Priorityr   QUEUE_PRIORITY_HEADER)priorityr   valid_prioritiess      r   add_priority_headerr   &   sF      )''&'7&8zK
 	
 &.G!"r   N)r   zUnion[int, float]r   dict[str, str]returnNone)r   r   r   r    r!   r"   )r   r   r   r    r!   r"   )
__future__r   typingr   r   r   r   r   REQUEST_TIMEOUT_TYPE_HEADERr   r   r   r   r   r    r   r   <module>r'      sI    " + +  1 : ( .  ?#3"'.r   