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

from ...core.pydantic_utilities import UniversalBaseModel
from .risk_change_filters import RiskChangeFilters
import typing
from .project_risk_changes_response_data import ProjectRiskChangesResponseData
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class ProjectRiskChangesResponse(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.project_entity import (
        ProjectRiskChange,
        ProjectRiskChangesResponse,
        ProjectRiskChangesResponseData,
        RiskChangeFactor,
        RiskChangeFilters,
    )

    ProjectRiskChangesResponse(
        filters=RiskChangeFilters(
            from_="2025-04-20 22:54:00.913586+00",
            to="2025-05-20 22:54:00.913586+00",
        ),
        next="eyJzYXZlZF9yZXNvdXJjZV9pZCI6MSwiZmllbGQiOiJyZWd1bGF0b3J5X2FjdGlvbiIsImRhdGUiOiIyMDIxLTA1LTE5IDAwOjA",
        limit=100,
        data=ProjectRiskChangesResponseData(
            project_id="YVB88Y",
            risk_changes=[
                ProjectRiskChange(
                    project_entity_id="52z4Wa",
                    risk_factors=[
                        RiskChangeFactor(
                            id="pep",
                            timestamp="2025-04-22 22:54:00.913586+00",
                            change_type="added",
                        ),
                        RiskChangeFactor(
                            id="regulatory_action",
                            timestamp="2025-04-22 22:54:00.913586+00",
                            change_type="removed",
                        ),
                    ],
                ),
                ProjectRiskChange(
                    project_entity_id="Gyvp8E",
                    risk_factors=[
                        RiskChangeFactor(
                            id="export_to_sanctioned",
                            timestamp="2025-04-28 22:54:00.913586+00",
                            change_type="added",
                        )
                    ],
                ),
            ],
        ),
    )
    """

    filters: RiskChangeFilters
    next: typing.Optional[str] = None
    prev: typing.Optional[str] = None
    limit: int
    data: ProjectRiskChangesResponseData

    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
