"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from enum import Enum
from outpost_sdk.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class DestinationSchemaFieldType(str, Enum):
    TEXT = "text"
    CHECKBOX = "checkbox"


class DestinationSchemaFieldTypedDict(TypedDict):
    type: DestinationSchemaFieldType
    required: bool
    label: NotRequired[str]
    description: NotRequired[str]
    sensitive: NotRequired[bool]
    r"""Indicates if the field contains sensitive information."""
    default: NotRequired[str]
    r"""Default value for the field."""
    minlength: NotRequired[int]
    r"""Minimum length for a text input."""
    maxlength: NotRequired[int]
    r"""Maximum length for a text input."""
    pattern: NotRequired[str]
    r"""Regex pattern for validation (compatible with HTML5 pattern attribute)."""


class DestinationSchemaField(BaseModel):
    type: DestinationSchemaFieldType

    required: bool

    label: Optional[str] = None

    description: Optional[str] = None

    sensitive: Optional[bool] = None
    r"""Indicates if the field contains sensitive information."""

    default: Optional[str] = None
    r"""Default value for the field."""

    minlength: Optional[int] = None
    r"""Minimum length for a text input."""

    maxlength: Optional[int] = None
    r"""Maximum length for a text input."""

    pattern: Optional[str] = None
    r"""Regex pattern for validation (compatible with HTML5 pattern attribute)."""
