
    @6iG                     T    d Z ddlZddlmZ ddlmZ ddlmZ edeeef   fd       Zy)	zUUID.    N)Union)UUID   )	validatorvaluec                    | syt        | t              ry	 t        |       xs t        j                  d|       S # t        $ r Y yw xY w)a  Return whether or not given value is a valid UUID-v4 string.

    This validator is based on [WTForms UUID validator][1].

    [1]: https://github.com/wtforms/wtforms/blob/master/src/wtforms/validators.py#L539

    Examples:
        >>> uuid('2bc1c94f-0deb-43e9-92a1-4775189ec9f8')
        True
        >>> uuid('2bc1c94f 0deb-43e9-92a1-4775189ec9f8')
        ValidationError(func=uuid, args={'value': '2bc1c94f 0deb-43e9-92a1-4775189ec9f8'})

    Args:
        value:
            UUID string or object to validate.

    Returns:
        (Literal[True]): If `value` is a valid UUID.
        (ValidationError): If `value` is an invalid UUID.
    FTz4^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$)
isinstancer   rematch
ValueError)r   s    R/home/azureuser/techstart-app/venv/lib/python3.12/site-packages/validators/uuid.pyuuidr      sQ    , %E{ 
bhhCU
 	
  s   "9 	AA)	__doc__r
   typingr   r   r   utilsr   str     r   <module>r      s<     
    c4i   r   