Module aws_lambda_powertools.utilities.parser.models.ses

Expand source code
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel, Field
from pydantic.types import PositiveInt

from ..types import Literal


class SesReceiptVerdict(BaseModel):
    status: Literal["PASS", "FAIL", "GRAY", "PROCESSING_FAILED"]


class SesReceiptAction(BaseModel):
    type: Literal["Lambda"]  # noqa A003,VNE003
    invocationType: Literal["Event"]
    functionArn: str


class SesReceipt(BaseModel):
    timestamp: datetime
    processingTimeMillis: PositiveInt
    recipients: List[str]
    spamVerdict: SesReceiptVerdict
    virusVerdict: SesReceiptVerdict
    spfVerdict: SesReceiptVerdict
    dmarcVerdict: SesReceiptVerdict
    action: SesReceiptAction


class SesMailHeaders(BaseModel):
    name: str
    value: str


class SesMailCommonHeaders(BaseModel):
    header_from: List[str] = Field(None, alias="from")
    to: List[str]
    cc: Optional[List[str]] = None
    bcc: Optional[List[str]] = None
    sender: Optional[List[str]] = None
    reply_to: Optional[List[str]] = Field(None, alias="reply-to")
    returnPath: str
    messageId: str
    date: str
    subject: str


class SesMail(BaseModel):
    timestamp: datetime
    source: str
    messageId: str
    destination: List[str]
    headersTruncated: bool
    headers: List[SesMailHeaders]
    commonHeaders: SesMailCommonHeaders


class SesMessage(BaseModel):
    mail: SesMail
    receipt: SesReceipt


class SesRecordModel(BaseModel):
    eventSource: Literal["aws:ses"]
    eventVersion: str
    ses: SesMessage


class SesModel(BaseModel):
    Records: List[SesRecordModel]

Classes

class SesMail (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesMail(BaseModel):
    timestamp: datetime
    source: str
    messageId: str
    destination: List[str]
    headersTruncated: bool
    headers: List[SesMailHeaders]
    commonHeaders: SesMailCommonHeaders

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var commonHeadersSesMailCommonHeaders
var destination : List[str]
var headers : List[SesMailHeaders]
var headersTruncated : bool
var messageId : str
var source : str
var timestamp : datetime.datetime
class SesMailCommonHeaders (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesMailCommonHeaders(BaseModel):
    header_from: List[str] = Field(None, alias="from")
    to: List[str]
    cc: Optional[List[str]] = None
    bcc: Optional[List[str]] = None
    sender: Optional[List[str]] = None
    reply_to: Optional[List[str]] = Field(None, alias="reply-to")
    returnPath: str
    messageId: str
    date: str
    subject: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var bcc : Optional[List[str]]
var cc : Optional[List[str]]
var date : str
var header_from : List[str]
var messageId : str
var reply_to : Optional[List[str]]
var returnPath : str
var sender : Optional[List[str]]
var subject : str
var to : List[str]
class SesMailHeaders (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesMailHeaders(BaseModel):
    name: str
    value: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var name : str
var value : str
class SesMessage (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesMessage(BaseModel):
    mail: SesMail
    receipt: SesReceipt

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var mailSesMail
var receiptSesReceipt
class SesModel (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesModel(BaseModel):
    Records: List[SesRecordModel]

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var Records : List[SesRecordModel]
class SesReceipt (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesReceipt(BaseModel):
    timestamp: datetime
    processingTimeMillis: PositiveInt
    recipients: List[str]
    spamVerdict: SesReceiptVerdict
    virusVerdict: SesReceiptVerdict
    spfVerdict: SesReceiptVerdict
    dmarcVerdict: SesReceiptVerdict
    action: SesReceiptAction

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var actionSesReceiptAction
var dmarcVerdictSesReceiptVerdict
var processingTimeMillis : pydantic.types.PositiveInt
var recipients : List[str]
var spamVerdictSesReceiptVerdict
var spfVerdictSesReceiptVerdict
var timestamp : datetime.datetime
var virusVerdictSesReceiptVerdict
class SesReceiptAction (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesReceiptAction(BaseModel):
    type: Literal["Lambda"]  # noqa A003,VNE003
    invocationType: Literal["Event"]
    functionArn: str

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var functionArn : str
var invocationType : Literal['Event']
var type : Literal['Lambda']
class SesReceiptVerdict (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesReceiptVerdict(BaseModel):
    status: Literal["PASS", "FAIL", "GRAY", "PROCESSING_FAILED"]

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var status : Literal['PASS', 'FAIL', 'GRAY', 'PROCESSING_FAILED']
class SesRecordModel (**data: Any)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class SesRecordModel(BaseModel):
    eventSource: Literal["aws:ses"]
    eventVersion: str
    ses: SesMessage

Ancestors

  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var eventSource : Literal['aws:ses']
var eventVersion : str
var sesSesMessage