# 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 .certificate_subject_dn_credential_type_enum import CertificateSubjectDnCredentialTypeEnum


class CertificateSubjectDnCredential(UniversalBaseModel):
    credential_type: CertificateSubjectDnCredentialTypeEnum
    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    Friendly name for a credential.
    """

    subject_dn: typing.Optional[str] = pydantic.Field(default=None)
    """
    Subject Distinguished Name. Mutually exclusive with `pem` property. Applies to `cert_subject_dn` credential type.
    """

    pem: typing.Optional[str] = pydantic.Field(default=None)
    """
    PEM-formatted X509 certificate. Must be JSON escaped. Mutually exclusive with `subject_dn` property.
    """

    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
