# 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_gateway_authentication_audience_sms import ConnectionGatewayAuthenticationAudienceSms
from .connection_gateway_authentication_method_sms import ConnectionGatewayAuthenticationMethodSms
from .connection_gateway_authentication_subject_sms import ConnectionGatewayAuthenticationSubjectSms


class ConnectionGatewayAuthenticationSms(UniversalBaseModel):
    """
    Optional token-based authentication configuration for the SMS gateway
    """

    audience: ConnectionGatewayAuthenticationAudienceSms
    method: ConnectionGatewayAuthenticationMethodSms
    secret: str = pydantic.Field()
    """
    The secret used to sign the JSON Web Token sent to the SMS gateway
    """

    secret_base_64_encoded: typing_extensions.Annotated[
        typing.Optional[bool],
        FieldMetadata(alias="secret_base64_encoded"),
        pydantic.Field(alias="secret_base64_encoded", description="Set to true if the secret is base64-url-encoded"),
    ] = None
    """
    Set to true if the secret is base64-url-encoded
    """

    subject: typing.Optional[ConnectionGatewayAuthenticationSubjectSms] = 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
