# Generated by ariadne-codegen
# Source: ./documents

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    ContentTypes,
    EntityState,
    FileTypes,
    LinkTypes,
    MailImportance,
    MailPriority,
    MailSensitivity,
    ObservableTypes,
    OccurrenceTypes,
)


class QueryContents(BaseModel):
    contents: Optional["QueryContentsContents"]


class QueryContentsContents(BaseModel):
    results: Optional[List[Optional["QueryContentsContentsResults"]]]


class QueryContentsContentsResults(BaseModel):
    id: str
    name: str
    creation_date: Any = Field(alias="creationDate")
    owner: "QueryContentsContentsResultsOwner"
    state: EntityState
    original_date: Optional[Any] = Field(alias="originalDate")
    finished_date: Optional[Any] = Field(alias="finishedDate")
    workflow_duration: Optional[Any] = Field(alias="workflowDuration")
    uri: Optional[Any]
    type: Optional[ContentTypes]
    file_type: Optional[FileTypes] = Field(alias="fileType")
    mime_type: Optional[str] = Field(alias="mimeType")
    file_name: Optional[str] = Field(alias="fileName")
    file_size: Optional[Any] = Field(alias="fileSize")
    master_uri: Optional[Any] = Field(alias="masterUri")
    image_uri: Optional[Any] = Field(alias="imageUri")
    text_uri: Optional[Any] = Field(alias="textUri")
    audio_uri: Optional[Any] = Field(alias="audioUri")
    transcript_uri: Optional[Any] = Field(alias="transcriptUri")
    video: Optional["QueryContentsContentsResultsVideo"]
    audio: Optional["QueryContentsContentsResultsAudio"]
    image: Optional["QueryContentsContentsResultsImage"]
    document: Optional["QueryContentsContentsResultsDocument"]
    email: Optional["QueryContentsContentsResultsEmail"]
    issue: Optional["QueryContentsContentsResultsIssue"]
    observations: Optional[List[Optional["QueryContentsContentsResultsObservations"]]]
    parent: Optional["QueryContentsContentsResultsParent"]
    children: Optional[List[Optional["QueryContentsContentsResultsChildren"]]]
    collections: Optional[List[Optional["QueryContentsContentsResultsCollections"]]]
    feed: Optional["QueryContentsContentsResultsFeed"]
    workflow: Optional["QueryContentsContentsResultsWorkflow"]
    markdown: Optional[str]
    links: Optional[List["QueryContentsContentsResultsLinks"]]
    error: Optional[str]


class QueryContentsContentsResultsOwner(BaseModel):
    id: str


class QueryContentsContentsResultsVideo(BaseModel):
    width: Optional[int]
    height: Optional[int]
    duration: Optional[str]
    software: Optional[str]
    make: Optional[str]
    model: Optional[str]


class QueryContentsContentsResultsAudio(BaseModel):
    keywords: Optional[List[Optional[str]]]
    author: Optional[str]
    series: Optional[str]
    episode: Optional[str]
    episode_type: Optional[str] = Field(alias="episodeType")
    season: Optional[str]
    publisher: Optional[str]
    copyright: Optional[str]
    language: Optional[str]
    genre: Optional[str]
    title: Optional[str]
    bitrate: Optional[int]
    channels: Optional[int]
    sample_rate: Optional[int] = Field(alias="sampleRate")
    bits_per_sample: Optional[int] = Field(alias="bitsPerSample")
    duration: Optional[str]


class QueryContentsContentsResultsImage(BaseModel):
    width: Optional[int]
    height: Optional[int]
    description: Optional[str]
    software: Optional[str]
    identifier: Optional[str]
    make: Optional[str]
    model: Optional[str]


class QueryContentsContentsResultsDocument(BaseModel):
    title: Optional[str]
    subject: Optional[str]
    author: Optional[str]
    software: Optional[str]
    publisher: Optional[str]
    description: Optional[str]
    summary: Optional[str]
    keywords: Optional[List[Optional[str]]]
    page_count: Optional[int] = Field(alias="pageCount")
    worksheet_count: Optional[int] = Field(alias="worksheetCount")
    slide_count: Optional[int] = Field(alias="slideCount")
    word_count: Optional[int] = Field(alias="wordCount")
    line_count: Optional[int] = Field(alias="lineCount")
    paragraph_count: Optional[int] = Field(alias="paragraphCount")
    character_count: Optional[int] = Field(alias="characterCount")
    is_encrypted: Optional[bool] = Field(alias="isEncrypted")
    has_digital_signature: Optional[bool] = Field(alias="hasDigitalSignature")


class QueryContentsContentsResultsEmail(BaseModel):
    subject: Optional[str]
    identifier: Optional[str]
    sensitivity: Optional[MailSensitivity]
    priority: Optional[MailPriority]
    importance: Optional[MailImportance]
    labels: Optional[List[Optional[str]]]
    from_: Optional[List[Optional["QueryContentsContentsResultsEmailFrom"]]] = Field(
        alias="from"
    )
    to: Optional[List[Optional["QueryContentsContentsResultsEmailTo"]]]
    cc: Optional[List[Optional["QueryContentsContentsResultsEmailCc"]]]
    bcc: Optional[List[Optional["QueryContentsContentsResultsEmailBcc"]]]


class QueryContentsContentsResultsEmailFrom(BaseModel):
    name: Optional[str]
    family_name: Optional[str] = Field(alias="familyName")
    given_name: Optional[str] = Field(alias="givenName")
    email: Optional[str]


class QueryContentsContentsResultsEmailTo(BaseModel):
    name: Optional[str]
    family_name: Optional[str] = Field(alias="familyName")
    given_name: Optional[str] = Field(alias="givenName")
    email: Optional[str]


class QueryContentsContentsResultsEmailCc(BaseModel):
    name: Optional[str]
    family_name: Optional[str] = Field(alias="familyName")
    given_name: Optional[str] = Field(alias="givenName")
    email: Optional[str]


class QueryContentsContentsResultsEmailBcc(BaseModel):
    name: Optional[str]
    family_name: Optional[str] = Field(alias="familyName")
    given_name: Optional[str] = Field(alias="givenName")
    email: Optional[str]


class QueryContentsContentsResultsIssue(BaseModel):
    title: Optional[str]
    project: Optional[str]
    team: Optional[str]
    status: Optional[str]
    priority: Optional[str]
    type: Optional[str]
    identifier: Optional[str]
    labels: Optional[List[Optional[str]]]


class QueryContentsContentsResultsObservations(BaseModel):
    type: ObservableTypes
    observable: "QueryContentsContentsResultsObservationsObservable"
    occurrences: Optional[
        List[Optional["QueryContentsContentsResultsObservationsOccurrences"]]
    ]


class QueryContentsContentsResultsObservationsObservable(BaseModel):
    id: str
    name: Optional[str]


class QueryContentsContentsResultsObservationsOccurrences(BaseModel):
    type: Optional[OccurrenceTypes]
    confidence: Optional[float]
    bounding_box: Optional[
        "QueryContentsContentsResultsObservationsOccurrencesBoundingBox"
    ] = Field(alias="boundingBox")
    page_index: Optional[int] = Field(alias="pageIndex")
    start_time: Optional[Any] = Field(alias="startTime")
    end_time: Optional[Any] = Field(alias="endTime")


class QueryContentsContentsResultsObservationsOccurrencesBoundingBox(BaseModel):
    left: Optional[float]
    top: Optional[float]
    width: Optional[float]
    height: Optional[float]


class QueryContentsContentsResultsParent(BaseModel):
    id: str


class QueryContentsContentsResultsChildren(BaseModel):
    id: str


class QueryContentsContentsResultsCollections(BaseModel):
    id: str


class QueryContentsContentsResultsFeed(BaseModel):
    id: str


class QueryContentsContentsResultsWorkflow(BaseModel):
    id: str


class QueryContentsContentsResultsLinks(BaseModel):
    uri: Optional[Any]
    link_type: Optional[LinkTypes] = Field(alias="linkType")


QueryContents.model_rebuild()
QueryContentsContents.model_rebuild()
QueryContentsContentsResults.model_rebuild()
QueryContentsContentsResultsEmail.model_rebuild()
QueryContentsContentsResultsObservations.model_rebuild()
QueryContentsContentsResultsObservationsOccurrences.model_rebuild()
