File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
aws_lambda_powertools/utilities/parser/models Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change
1
+ import logging
2
+ import sys
1
3
from datetime import datetime
2
- from typing import List , Optional
4
+ from typing import List , NewType , Optional
3
5
4
6
from pydantic import BaseModel , Field
5
- from pydantic .networks import EmailStr
6
7
from pydantic .types import PositiveInt
7
8
8
9
from ..types import Literal
9
10
11
+ has_email_validator = "email_validator" in sys .modules
12
+
13
+ if has_email_validator :
14
+ from pydantic .networks import EmailStr
15
+ else :
16
+ logging .warning ("email_validator package is not installed" )
17
+ EmailStr = NewType ("EmailStr" , str ) # type: ignore[no-redef, misc]
18
+
10
19
11
20
class SesReceiptVerdict (BaseModel ):
12
21
status : Literal ["PASS" , "FAIL" , "GRAY" , "PROCESSING_FAILED" ]
You can’t perform that action at this time.
0 commit comments