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

from __future__ import annotations
from .extractionrequest import Extractionrequest, ExtractionrequestTypedDict
from .policeexternaluser import Policeexternaluser, PoliceexternaluserTypedDict
from acuvity.types import BaseModel
from enum import Enum
import pydantic
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class Anonymization(str, Enum):
    r"""How to anonymize the data. If deanonymize is true, then VariablSize is required."""

    FIXED_SIZE = "FixedSize"
    VARIABLE_SIZE = "VariableSize"


class Type(str, Enum):
    r"""The type of text."""

    INPUT = "Input"
    OUTPUT = "Output"


class PolicerequestTypedDict(TypedDict):
    r"""This is a scan and police request."""

    annotations: NotRequired[Dict[str, str]]
    r"""Annotations attached to the extraction."""
    anonymization: NotRequired[Anonymization]
    r"""How to anonymize the data. If deanonymize is true, then VariablSize is required."""
    bypass_hash: NotRequired[str]
    r"""In the case of a contentPolicy that asks for a confirmation, this is the
    hash you must send back to bypass the block. This is only useful when a
    content policy has been set or is evaluated remotely.
    """
    extractions: NotRequired[List[ExtractionrequestTypedDict]]
    r"""The extractions to request."""
    messages: NotRequired[List[str]]
    r"""Messages to process and provide detections for. Use data in extractions for
    processing binary data.
    """
    provider: NotRequired[str]
    r"""The name of the provider to use for policy resolutions. If not set, it will
    default to the principal name (the application itself).
    """
    type: NotRequired[Type]
    r"""The type of text."""
    user: NotRequired[PoliceexternaluserTypedDict]
    r"""PoliceExternalUser holds the information about the remote user for a
    PoliceRequest.
    """


class Policerequest(BaseModel):
    r"""This is a scan and police request."""

    annotations: Optional[Dict[str, str]] = None
    r"""Annotations attached to the extraction."""

    anonymization: Optional[Anonymization] = Anonymization.FIXED_SIZE
    r"""How to anonymize the data. If deanonymize is true, then VariablSize is required."""

    bypass_hash: Annotated[Optional[str], pydantic.Field(alias="bypassHash")] = None
    r"""In the case of a contentPolicy that asks for a confirmation, this is the
    hash you must send back to bypass the block. This is only useful when a
    content policy has been set or is evaluated remotely.
    """

    extractions: Optional[List[Extractionrequest]] = None
    r"""The extractions to request."""

    messages: Optional[List[str]] = None
    r"""Messages to process and provide detections for. Use data in extractions for
    processing binary data.
    """

    provider: Optional[str] = None
    r"""The name of the provider to use for policy resolutions. If not set, it will
    default to the principal name (the application itself).
    """

    type: Optional[Type] = None
    r"""The type of text."""

    user: Optional[Policeexternaluser] = None
    r"""PoliceExternalUser holds the information about the remote user for a
    PoliceRequest.
    """
