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

from __future__ import annotations
from .contentfilterbuiltinaction import ContentFilterBuiltinAction
from .contentfilterbuiltinslug import ContentFilterBuiltinSlug
from .promptinjectionscanscope import PromptInjectionScanScope
from openrouter.types import BaseModel
from openrouter.utils import validate_open_enum
import pydantic
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ContentFilterBuiltinEntryInputTypedDict(TypedDict):
    r"""A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller."""

    action: ContentFilterBuiltinAction
    r"""Action taken when the builtin filter triggers"""
    slug: ContentFilterBuiltinSlug
    r"""The builtin filter identifier"""
    label: NotRequired[str]
    r"""Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored."""
    scan_scope: NotRequired[PromptInjectionScanScope]
    r"""Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages."""


class ContentFilterBuiltinEntryInput(BaseModel):
    r"""A builtin content filter entry for create/update requests. Labels are system-assigned and cannot be set by the caller."""

    action: Annotated[
        ContentFilterBuiltinAction, PlainValidator(validate_open_enum(False))
    ]
    r"""Action taken when the builtin filter triggers"""

    slug: Annotated[ContentFilterBuiltinSlug, PlainValidator(validate_open_enum(False))]
    r"""The builtin filter identifier"""

    label: Annotated[
        Optional[str],
        pydantic.Field(
            deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
        ),
    ] = None
    r"""Deprecated: labels are system-assigned and cannot be set by the caller. Accepted for backward compatibility but silently ignored."""

    scan_scope: Annotated[
        Optional[PromptInjectionScanScope], PlainValidator(validate_open_enum(False))
    ] = None
    r"""Which message roles to scan for prompt injection. Only applies to the regex-prompt-injection builtin. Defaults to all_messages."""
