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

from ...core.pydantic_utilities import UniversalBaseModel
from ...supply_chain.types.trade_traversal_filters import TradeTraversalFilters
from .project_entity_supply_chain_summary_response_data import ProjectEntitySupplyChainSummaryResponseData
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import typing
import pydantic


class ProjectEntitySupplyChainSummaryResponse(UniversalBaseModel):
    """
    Examples
    --------
    from sayari.project_entity import (
        ProjectEntitySupplyChainSummaryResponse,
        ProjectEntitySupplyChainSummaryResponseData,
        ProjectEntitySupplyChainUpstream,
        RiskCategoriesSummary,
    )
    from sayari.supply_chain import TradeTraversalFilters

    ProjectEntitySupplyChainSummaryResponse(
        filters=TradeTraversalFilters(
            min_date="2023-03-15",
            product=["8536", "8544", "4016"],
            risk_factors=[
                "forced_labor_xinjiang_name",
                "forced_labor_xinjiang_uflpa",
                "forced_labor_uflpa_origin_direct",
                "exports_russian_gold",
                "export_to_sanctioned",
            ],
        ),
        data=ProjectEntitySupplyChainSummaryResponseData(
            project_id="8YMJNG",
            project_entity_id="Gyvp8E",
            upstream=ProjectEntitySupplyChainUpstream(
                components=["8536", "8544", "4016"],
                countries=["JPN", "IND", "VNM", "PHL"],
                risk_categories=[
                    RiskCategoriesSummary(
                        id="forced_labor",
                        label="Forced labor",
                        risk_factors=[
                            "forced_labor_xinjiang_name",
                            "forced_labor_xinjiang_uflpa",
                            "forced_labor_uflpa_origin_direct",
                        ],
                    ),
                    RiskCategoriesSummary(
                        id="export_controls",
                        label="Export controls",
                        risk_factors=[
                            "exports_russian_gold",
                            "export_to_sanctioned",
                        ],
                    ),
                ],
            ),
        ),
    )
    """

    filters: TradeTraversalFilters
    data: ProjectEntitySupplyChainSummaryResponseData

    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
