# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing_extensions import Literal, Required, TypedDict

from ..._types import SequenceNotStr
from .widget_domain import WidgetDomain

__all__ = ["WidgetCreateParams"]


class WidgetCreateParams(TypedDict, total=False):
    account_id: Required[str]
    """Identifier"""

    domains: Required[SequenceNotStr[WidgetDomain]]

    mode: Required[Literal["non-interactive", "invisible", "managed"]]
    """Widget Mode"""

    name: Required[str]
    """Human readable widget name.

    Not unique. Cloudflare suggests that you set this to a meaningful string to make
    it easier to identify your widget, and where it is used.
    """

    direction: Literal["asc", "desc"]
    """Direction to order widgets."""

    filter: str
    """
    Filter widgets by field using case-insensitive substring matching. Format:
    `field:value`

    Supported fields:

    - `name` - Filter by widget name (e.g., `filter=name:login-form`)
    - `sitekey` - Filter by sitekey (e.g., `filter=sitekey:0x4AAA`)

    Returns 400 Bad Request if the field is unsupported or format is invalid. An
    empty filter value returns all results.
    """

    order: Literal["id", "sitekey", "name", "created_on", "modified_on"]
    """Field to order widgets by."""

    page: float
    """Page number of paginated results."""

    per_page: float
    """Number of items per page."""

    bot_fight_mode: bool
    """
    If bot_fight_mode is set to `true`, Cloudflare issues computationally expensive
    challenges in response to malicious bots (ENT only).
    """

    clearance_level: Literal["no_clearance", "jschallenge", "managed", "interactive"]
    """
    If Turnstile is embedded on a Cloudflare site and the widget should grant
    challenge clearance, this setting can determine the clearance level to be set
    """

    ephemeral_id: bool
    """Return the Ephemeral ID in /siteverify (ENT only)."""

    offlabel: bool
    """Do not show any Cloudflare branding on the widget (ENT only)."""

    region: Literal["world", "china"]
    """Region where this widget can be used. This cannot be changed after creation."""
