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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .connection_assertion_decryption_settings import ConnectionAssertionDecryptionSettings
from .connection_decryption_key_saml import ConnectionDecryptionKeySaml
from .connection_digest_algorithm_saml import ConnectionDigestAlgorithmSaml
from .connection_domain_aliases_saml import ConnectionDomainAliasesSaml
from .connection_entity_id_saml import ConnectionEntityIdSaml
from .connection_icon_url_saml import ConnectionIconUrlSaml
from .connection_options_idpinitiated_saml import ConnectionOptionsIdpinitiatedSaml
from .connection_protocol_binding_saml import ConnectionProtocolBindingSaml
from .connection_set_user_root_attributes_enum import ConnectionSetUserRootAttributesEnum
from .connection_sign_in_endpoint_saml import ConnectionSignInEndpointSaml
from .connection_sign_saml_request_saml import ConnectionSignSamlRequestSaml
from .connection_signature_algorithm_saml import ConnectionSignatureAlgorithmSaml
from .connection_signing_certificate_der_saml import ConnectionSigningCertificateDerSaml
from .connection_tenant_domain_saml import ConnectionTenantDomainSaml
from .connection_thumbprints_saml import ConnectionThumbprintsSaml
from .connection_upstream_params import ConnectionUpstreamParams


class ConnectionOptionsCommonSaml(UniversalBaseModel):
    """
    Common options for SAML-based enterprise connections (shared by samlp and pingfederate).
    """

    assertion_decryption_settings: typing.Optional[ConnectionAssertionDecryptionSettings] = None
    cert: typing.Optional[ConnectionSigningCertificateDerSaml] = None
    decryption_key: typing_extensions.Annotated[
        typing.Optional[ConnectionDecryptionKeySaml],
        FieldMetadata(alias="decryptionKey"),
        pydantic.Field(alias="decryptionKey"),
    ] = None
    digest_algorithm: typing_extensions.Annotated[
        typing.Optional[ConnectionDigestAlgorithmSaml],
        FieldMetadata(alias="digestAlgorithm"),
        pydantic.Field(alias="digestAlgorithm"),
    ] = None
    domain_aliases: typing.Optional[ConnectionDomainAliasesSaml] = None
    entity_id: typing_extensions.Annotated[
        typing.Optional[ConnectionEntityIdSaml], FieldMetadata(alias="entityId"), pydantic.Field(alias="entityId")
    ] = None
    icon_url: typing.Optional[ConnectionIconUrlSaml] = None
    idpinitiated: typing.Optional[ConnectionOptionsIdpinitiatedSaml] = None
    protocol_binding: typing_extensions.Annotated[
        typing.Optional[ConnectionProtocolBindingSaml],
        FieldMetadata(alias="protocolBinding"),
        pydantic.Field(alias="protocolBinding"),
    ] = None
    set_user_root_attributes: typing.Optional[ConnectionSetUserRootAttributesEnum] = None
    sign_in_endpoint: typing_extensions.Annotated[
        typing.Optional[ConnectionSignInEndpointSaml],
        FieldMetadata(alias="signInEndpoint"),
        pydantic.Field(alias="signInEndpoint"),
    ] = None
    sign_saml_request: typing_extensions.Annotated[
        typing.Optional[ConnectionSignSamlRequestSaml],
        FieldMetadata(alias="signSAMLRequest"),
        pydantic.Field(alias="signSAMLRequest"),
    ] = None
    signature_algorithm: typing_extensions.Annotated[
        typing.Optional[ConnectionSignatureAlgorithmSaml],
        FieldMetadata(alias="signatureAlgorithm"),
        pydantic.Field(alias="signatureAlgorithm"),
    ] = None
    tenant_domain: typing.Optional[ConnectionTenantDomainSaml] = None
    thumbprints: typing.Optional[ConnectionThumbprintsSaml] = None
    upstream_params: typing.Optional[ConnectionUpstreamParams] = 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
