# 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 .self_service_profile_sso_ticket_idp_initiated_client_protocol_enum import (
    SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum,
)


class SelfServiceProfileSsoTicketIdpInitiatedOptions(UniversalBaseModel):
    """
    Allows IdP-initiated login
    """

    enabled: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Enables IdP-initiated login for this connection
    """

    client_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Default application <code>client_id</code> user is redirected to after validated SAML response
    """

    client_protocol: typing.Optional[SelfServiceProfileSsoTicketIdpInitiatedClientProtocolEnum] = None
    client_authorizequery: typing.Optional[str] = pydantic.Field(default=None)
    """
    Query string options to customize the behaviour for OpenID Connect when <code>idpinitiated.client_protocol</code> is <code>oauth2</code>. Allowed parameters: <code>redirect_uri</code>, <code>scope</code>, <code>response_type</code>. For example, <code>redirect_uri=https://jwt.io&scope=openid email&response_type=token</code>
    """

    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
