# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .requeue_rejected_tasks_mode_enum import RequeueRejectedTasksModeEnum
from .review_criteria_enum import ReviewCriteriaEnum
from .review_settings_sampling_enum import ReviewSettingsSamplingEnum


class ReviewSettingsRequest(UncheckedBaseModel):
    anonymize_annotations: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Hide annotator names from annotations while review
    """

    instruction: typing.Optional[str] = pydantic.Field(default=None)
    """
    Reviewer instructions in HTML format
    """

    only_finished_tasks: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Show only finished tasks in the review stream
    """

    project: typing.Optional[int] = None
    requeue_rejected_tasks_mode: typing.Optional[RequeueRejectedTasksModeEnum] = pydantic.Field(default=None)
    """
    Requeue mode for rejected tasks
    
    * `requeue` - Requeue
    * `remove` - Remove
    * `flexible` - Flexible
    """

    require_comment_on_reject: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If set, the reviewer must leave a comment on reject
    """

    review_criteria: typing.Optional[ReviewCriteriaEnum] = pydantic.Field(default=None)
    """
    Criteria to mark task as reviewed
    
    * `all` - Task is reviewed if all annotations are reviewed
    * `one` - Task is reviewed if at least one annotation is reviewed
    """

    review_only_manual_assignments: typing.Optional[bool] = pydantic.Field(default=None)
    """
    When set True, review queue is built only from manually assigned tasks
    """

    review_task_limit_percent: typing.Optional[str] = pydantic.Field(default=None)
    """
    Percent of tasks to include in review stream (0-100). Null/0 disables.
    """

    sampling: typing.Optional[ReviewSettingsSamplingEnum] = pydantic.Field(default=None)
    """
    Task sampling strategy in the review stream (by task id or random)
    
    * `task_id` - By Task ID
    * `random` - Random
    """

    show_agreement_to_reviewers: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Show the agreement column to reviewers
    """

    show_data_manager_to_reviewers: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Show the data manager to reviewers
    """

    show_instruction: typing.Optional[bool] = pydantic.Field(default=None)
    """
    Show instructions to the reviewers before they start
    """

    show_unused_data_columns_to_reviewers: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If true, Data Manager shows all task.data columns to reviewers; if false, hides columns not referenced by the label interface
    """

    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
