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

from ...core.pydantic_utilities import UniversalBaseModel
import typing
from .project_risk_factor import ProjectRiskFactor
from .trade_counts import TradeCounts
from .upstream_count import UpstreamCount
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic


class UpstreamInfo(UniversalBaseModel):
    risk_factors: typing.List[ProjectRiskFactor]
    countries: typing.List[str]
    trade_counts: TradeCounts
    has_upstream: bool
    products: typing.List[str]
    risk_counts: typing.Optional[UpstreamCount] = None
    country_counts: typing.Optional[UpstreamCount] = None

    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
