# 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 .event_stream_cloud_event_connection_updated_object_3_authentication import (
    EventStreamCloudEventConnectionUpdatedObject3Authentication,
)
from .event_stream_cloud_event_connection_updated_object_3_connected_accounts import (
    EventStreamCloudEventConnectionUpdatedObject3ConnectedAccounts,
)
from .event_stream_cloud_event_connection_updated_object_3_metadata import (
    EventStreamCloudEventConnectionUpdatedObject3Metadata,
)
from .event_stream_cloud_event_connection_updated_object_3_options import (
    EventStreamCloudEventConnectionUpdatedObject3Options,
)
from .event_stream_cloud_event_connection_updated_object_3_strategy_enum import (
    EventStreamCloudEventConnectionUpdatedObject3StrategyEnum,
)


class EventStreamCloudEventConnectionUpdatedObject3(UniversalBaseModel):
    authentication: typing.Optional[EventStreamCloudEventConnectionUpdatedObject3Authentication] = None
    connected_accounts: typing.Optional[EventStreamCloudEventConnectionUpdatedObject3ConnectedAccounts] = None
    display_name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Connection name used in the new universal login experience
    """

    enabled_clients: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Use of this property is NOT RECOMMENDED. Use the PATCH /v2/connections/{id}/clients endpoint to enable the connection for a set of clients.
    """

    id: str = pydantic.Field()
    """
    The connection's identifier
    """

    is_domain_connection: typing.Optional[bool] = pydantic.Field(default=None)
    """
    <code>true</code> promotes to a domain-level connection so that third-party applications can use it. <code>false</code> does not promote the connection, so only first-party applications with the connection enabled can use it. (Defaults to <code>false</code>.)
    """

    metadata: typing.Optional[EventStreamCloudEventConnectionUpdatedObject3Metadata] = None
    name: str = pydantic.Field()
    """
    The name of the connection. Must start and end with an alphanumeric character and can only contain alphanumeric characters and '-'. Max length 128
    """

    realms: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Defines the realms for which the connection will be used (ie: email domains). If the array is empty or the property is not specified, the connection name will be added as realm.
    """

    options: typing.Optional[EventStreamCloudEventConnectionUpdatedObject3Options] = None
    show_as_button: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Enables showing a button for the connection in the login page (new experience only). If false, it will be usable only by HRD. Defaults to `false`.
    """

    strategy: EventStreamCloudEventConnectionUpdatedObject3StrategyEnum

    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
