File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 11BASE_URL = "https://v1.fastpix.io"
2+
3+ import re
4+ import uuid
5+ from typing import Any , Dict
6+
7+ def validate_uuid (uuid_str : str ) -> bool :
8+ """
9+ Validate if the given string is a valid UUID.
10+
11+ Args:
12+ uuid_str (str): The UUID string to validate
13+
14+ Returns:
15+ bool: True if valid UUID, False otherwise
16+ """
17+ try :
18+ uuid_obj = uuid .UUID (uuid_str )
19+ return str (uuid_obj ) == uuid_str
20+ except ValueError :
21+ return False
22+
23+ def validate_request_body (body : Dict [str , Any ]) -> bool :
24+ """
25+ Validate if the request body is a non-empty dictionary.
26+
27+ Args:
28+ body (Dict[str, Any]): The request body to validate
29+
30+ Returns:
31+ bool: True if valid request body, False otherwise
32+ """
33+ return isinstance (body , dict ) and len (body ) > 0
You can’t perform that action at this time.
0 commit comments