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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .connection_attribute_map_attributes import ConnectionAttributeMapAttributes
from .connection_attribute_map_userinfo_scope import ConnectionAttributeMapUserinfoScope
from .connection_mapping_mode_enum_oidc import ConnectionMappingModeEnumOidc


class ConnectionAttributeMapOidc(UniversalBaseModel):
    """
    Configuration for mapping claims from the identity provider to Auth0 user profile attributes. Allows customizing which IdP claims populate user fields and how they are transformed.
    """

    attributes: typing.Optional[ConnectionAttributeMapAttributes] = None
    mapping_mode: typing.Optional[ConnectionMappingModeEnumOidc] = None
    userinfo_scope: typing.Optional[ConnectionAttributeMapUserinfoScope] = 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
