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

from ..core.pydantic_utilities import UniversalBaseModel
import typing_extensions
from ..core.serialization import FieldMetadata
from .custom_proxy import CustomProxy
import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
import typing


class SessionConfigV1ProxyItem(UniversalBaseModel):
    """
    You can set multiple proxies. You associate each proxy with a domain pattern. If the domain matches the pattern, the proxy is used. Pattern can contain '?' to match any single character, and '_' to match any sequence of characters. For example, '_.example.com' will match 'www.example.com' and 'sub.example.com'
    """

    domain_pattern: typing_extensions.Annotated[str, FieldMetadata(alias="domainPattern")]
    relay: CustomProxy = pydantic.Field()
    """
    Configuration for a single custom proxy.
    """

    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
