Module aws_lambda_powertools.utilities.parser.models.vpc_latticev2

Expand source code
from datetime import datetime
from typing import Dict, Optional, Type, Union

from pydantic import BaseModel, Field, validator


class VpcLatticeV2RequestContextIdentity(BaseModel):
    source_vpc_arn: Optional[str] = Field(None, alias="sourceVpcArn")
    get_type: Optional[str] = Field(None, alias="type")
    principal: Optional[str] = Field(None, alias="principal")
    principal_org_id: Optional[str] = Field(None, alias="principalOrgID")
    session_name: Optional[str] = Field(None, alias="sessionName")
    x509_subject_cn: Optional[str] = Field(None, alias="X509SubjectCn")
    x509_issuer_ou: Optional[str] = Field(None, alias="X509IssuerOu")
    x509_san_dns: Optional[str] = Field(None, alias="x509SanDns")
    x509_san_uri: Optional[str] = Field(None, alias="X509SanUri")
    x509_san_name_cn: Optional[str] = Field(None, alias="X509SanNameCn")


class VpcLatticeV2RequestContext(BaseModel):
    service_network_arn: str = Field(alias="serviceNetworkArn")
    service_arn: str = Field(alias="serviceArn")
    target_group_arn: str = Field(alias="targetGroupArn")
    identity: VpcLatticeV2RequestContextIdentity
    region: str
    time_epoch: float = Field(alias="timeEpoch")
    time_epoch_as_datetime: datetime = Field(alias="timeEpoch")

    @validator("time_epoch_as_datetime", pre=True, allow_reuse=True)
    def time_epoch_convert_to_miliseconds(cls, value: int):
        return round(int(value) / 1000)


class VpcLatticeV2Model(BaseModel):
    version: str
    path: str
    method: str
    headers: Dict[str, str]
    query_string_parameters: Optional[Dict[str, str]] = Field(None, alias="queryStringParameters")
    body: Optional[Union[str, Type[BaseModel]]] = None
    is_base64_encoded: Optional[bool] = Field(None, alias="isBase64Encoded")
    request_context: VpcLatticeV2RequestContext = Field(None, alias="requestContext")

Classes

class VpcLatticeV2Model (**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 VpcLatticeV2Model(BaseModel):
    version: str
    path: str
    method: str
    headers: Dict[str, str]
    query_string_parameters: Optional[Dict[str, str]] = Field(None, alias="queryStringParameters")
    body: Optional[Union[str, Type[BaseModel]]] = None
    is_base64_encoded: Optional[bool] = Field(None, alias="isBase64Encoded")
    request_context: VpcLatticeV2RequestContext = Field(None, alias="requestContext")

Ancestors

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

Class variables

var body : Union[str, Type[pydantic.main.BaseModel], ForwardRef(None)]
var headers : Dict[str, str]
var is_base64_encoded : Optional[bool]
var method : str
var path : str
var query_string_parameters : Optional[Dict[str, str]]
var request_contextVpcLatticeV2RequestContext
var version : str
class VpcLatticeV2RequestContext (**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 VpcLatticeV2RequestContext(BaseModel):
    service_network_arn: str = Field(alias="serviceNetworkArn")
    service_arn: str = Field(alias="serviceArn")
    target_group_arn: str = Field(alias="targetGroupArn")
    identity: VpcLatticeV2RequestContextIdentity
    region: str
    time_epoch: float = Field(alias="timeEpoch")
    time_epoch_as_datetime: datetime = Field(alias="timeEpoch")

    @validator("time_epoch_as_datetime", pre=True, allow_reuse=True)
    def time_epoch_convert_to_miliseconds(cls, value: int):
        return round(int(value) / 1000)

Ancestors

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

Class variables

var identityVpcLatticeV2RequestContextIdentity
var region : str
var service_arn : str
var service_network_arn : str
var target_group_arn : str
var time_epoch : float
var time_epoch_as_datetime : datetime.datetime

Static methods

def time_epoch_convert_to_miliseconds(value: int)
Expand source code
@validator("time_epoch_as_datetime", pre=True, allow_reuse=True)
def time_epoch_convert_to_miliseconds(cls, value: int):
    return round(int(value) / 1000)
class VpcLatticeV2RequestContextIdentity (**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 VpcLatticeV2RequestContextIdentity(BaseModel):
    source_vpc_arn: Optional[str] = Field(None, alias="sourceVpcArn")
    get_type: Optional[str] = Field(None, alias="type")
    principal: Optional[str] = Field(None, alias="principal")
    principal_org_id: Optional[str] = Field(None, alias="principalOrgID")
    session_name: Optional[str] = Field(None, alias="sessionName")
    x509_subject_cn: Optional[str] = Field(None, alias="X509SubjectCn")
    x509_issuer_ou: Optional[str] = Field(None, alias="X509IssuerOu")
    x509_san_dns: Optional[str] = Field(None, alias="x509SanDns")
    x509_san_uri: Optional[str] = Field(None, alias="X509SanUri")
    x509_san_name_cn: Optional[str] = Field(None, alias="X509SanNameCn")

Ancestors

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

Class variables

var get_type : Optional[str]
var principal : Optional[str]
var principal_org_id : Optional[str]
var session_name : Optional[str]
var source_vpc_arn : Optional[str]
var x509_issuer_ou : Optional[str]
var x509_san_dns : Optional[str]
var x509_san_name_cn : Optional[str]
var x509_san_uri : Optional[str]
var x509_subject_cn : Optional[str]