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

from typing import Dict, List, Optional
from datetime import datetime
from typing_extensions import Literal

from pydantic import Field as FieldInfo

from ..._models import BaseModel

__all__ = ["TransformJobRetrieveResponse"]


class TransformJobRetrieveResponse(BaseModel):
    """A PII/PHI transform job."""

    id: Optional[str] = None
    """Unique identifier for the transform job."""

    company_id: Optional[str] = None
    """ID of the company that owns this job."""

    completed_at: Optional[datetime] = None
    """When the job completed (succeeded or failed)."""

    created_at: Optional[datetime] = None
    """When the job was created."""

    created_by: Optional[int] = None
    """ID of the user who created this job."""

    created_by_email: Optional[str] = None
    """Email of the user who created this job."""

    dataset_name: Optional[str] = None
    """Name of the seed dataset."""

    datasets_id: Optional[str] = None
    """UUID of the seed dataset being transformed."""

    detection_method: Optional[str] = None
    """Entity detection method used."""

    duration_seconds: Optional[int] = None
    """Time taken to complete the job in seconds. Null until completed."""

    mask_config: Optional[Dict[str, str]] = None
    """Per-entity-type masking strategy."""

    metrics_json: Optional[object] = None
    """Transform results once the job completes.

    Contains `transformed_samples` with masked content and entity summaries per
    sample.
    """

    api_model_name: Optional[str] = FieldInfo(alias="model_name", default=None)
    """LLM model name (when detection_method includes `llm`)."""

    name: Optional[str] = None
    """Human-readable name for this job."""

    pii_types: Optional[List[str]] = None
    """List of PII/PHI entity types being detected."""

    started_at: Optional[datetime] = None
    """When processing started."""

    status: Optional[Literal["PENDING", "RUNNING", "SUCCEEDED", "FAILED"]] = None
    """Current status of the transform job."""

    threshold: Optional[float] = None
    """Confidence threshold used for detection."""

    trace: Optional[object] = None
    """Internal trace information including task_id and dataset metadata."""

    updated_at: Optional[datetime] = None
    """When the job was last updated."""
