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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .event_stream_cloud_event_connection_updated_object_4_options_set_user_root_attributes_enum import (
    EventStreamCloudEventConnectionUpdatedObject4OptionsSetUserRootAttributesEnum,
)
from .event_stream_cloud_event_connection_updated_object_4_options_should_trust_email_verified_connection_enum import (
    EventStreamCloudEventConnectionUpdatedObject4OptionsShouldTrustEmailVerifiedConnectionEnum,
)
from .event_stream_cloud_event_connection_updated_object_4_options_upstream_params import (
    EventStreamCloudEventConnectionUpdatedObject4OptionsUpstreamParams,
)


class EventStreamCloudEventConnectionUpdatedObject4Options(UniversalBaseModel):
    """
    Options for the 'adfs' connection
    """

    adfs_server: typing.Optional[str] = pydantic.Field(default=None)
    """
    ADFS federation metadata host or XML URL used to discover WS-Fed endpoints and certificates. Errors if adfs_server and fedMetadataXml are both absent.
    """

    cert_rollover_notification: typing.Optional[dt.datetime] = pydantic.Field(default=None)
    """
    Timestamp of the last certificate expiring soon notification.
    """

    domain_aliases: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Email domains associated with this connection for Home Realm Discovery (HRD). When a user's email matches one of these domains, they are automatically routed to this connection during authentication.
    """

    entity_id: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="entityId"),
        pydantic.Field(
            alias="entityId",
            description="The entity identifier (Issuer) for the ADFS Service Provider. When not provided, defaults to 'urn:auth0:{tenant}:{connection}'.",
        ),
    ] = None
    """
    The entity identifier (Issuer) for the ADFS Service Provider. When not provided, defaults to 'urn:auth0:{tenant}:{connection}'.
    """

    fed_metadata_xml: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="fedMetadataXml"),
        pydantic.Field(
            alias="fedMetadataXml",
            description="Inline XML alternative to 'adfs_server'. Cannot be set together with 'adfs_server'.",
        ),
    ] = None
    """
    Inline XML alternative to 'adfs_server'. Cannot be set together with 'adfs_server'.
    """

    icon_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL for the connection icon displayed in Auth0 login pages. Accepts HTTPS URLs. Used for visual branding in authentication flows.
    """

    non_persistent_attrs: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    An array of user fields that should not be stored in the Auth0 database (https://auth0.com/docs/security/data-security/denylist)
    """

    prev_thumbprints: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Array of certificate thumbprints (SHA-128/SHA-256/SHA-512 hex hashes) for validating SAML signatures. Used with WS-Federation protocol. Maximum 20 thumbprints. Each thumbprint must be a hexadecimal string.
    """

    set_user_root_attributes: typing.Optional[
        EventStreamCloudEventConnectionUpdatedObject4OptionsSetUserRootAttributesEnum
    ] = None
    should_trust_email_verified_connection: typing.Optional[
        EventStreamCloudEventConnectionUpdatedObject4OptionsShouldTrustEmailVerifiedConnectionEnum
    ] = None
    sign_in_endpoint: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="signInEndpoint"),
        pydantic.Field(
            alias="signInEndpoint",
            description="Passive Requestor (WS-Fed) sign-in endpoint discovered from metadata or provided explicitly.",
        ),
    ] = None
    """
    Passive Requestor (WS-Fed) sign-in endpoint discovered from metadata or provided explicitly.
    """

    tenant_domain: typing.Optional[str] = pydantic.Field(default=None)
    """
    Tenant domain
    """

    thumbprints: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Array of certificate thumbprints (SHA-128/SHA-256/SHA-512 hex hashes) for validating SAML signatures. Used with WS-Federation protocol. Maximum 20 thumbprints. Each thumbprint must be a hexadecimal string.
    """

    upstream_params: typing.Optional[EventStreamCloudEventConnectionUpdatedObject4OptionsUpstreamParams] = None
    user_id_attribute: typing.Optional[str] = pydantic.Field(default=None)
    """
    Custom ADFS claim to use as the unique user identifier. When provided, this attribute is prepended to the default user_id mapping list with highest priority. Accepts a string (single ADFS claim name).
    """

    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
