# This file was auto-generated by Fern from our API Definition.

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .risk_evaluation_risk_level import RiskEvaluationRiskLevel
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class RiskEvaluation(UncheckedBaseModel):
    """
    Represents fraud risk information for the associated payment.

    When you take a payment through Square's Payments API (using the `CreatePayment`
    endpoint), Square evaluates it and assigns a risk level to the payment. Sellers
    can use this information to determine the course of action (for example,
    provide the goods/services or refund the payment).
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp when payment risk was evaluated, in RFC 3339 format.
    """

    risk_level: typing.Optional[RiskEvaluationRiskLevel] = pydantic.Field(default=None)
    """
    The risk level associated with the payment
    See [RiskEvaluationRiskLevel](#type-riskevaluationrisklevel) for possible values
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
