# 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 .opt_in_method_enum import OptInMethodEnum


class TollFreeCampaignSchemaOptIn(UniversalBaseModel):
    """
    Opt-in method and workflow.
    """

    method: typing.Optional[OptInMethodEnum] = None
    url: typing.Optional[str] = pydantic.Field(default=None)
    """
    URL where the opt-in form or documentation can be found.
    """

    workflow_description: typing_extensions.Annotated[
        typing.Optional[str], FieldMetadata(alias="workflowDescription")
    ] = pydantic.Field(default=None)
    """
    Describe your opt-in workflow. See the [Opt-In Methods and Workflow](/guides/campaigns/opt-in-compliance#opt-in-methods-and-workflow) section for requirements and examples.
    """

    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
