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

from typing import Any, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    AgentTypes,
    ContentTypes,
    EntityState,
    FileTypes,
    FilterMode,
    ObservableTypes,
    TimedPolicyRecurrenceTypes,
)


class QueryAgents(BaseModel):
    agents: Optional["QueryAgentsAgents"]


class QueryAgentsAgents(BaseModel):
    results: Optional[list["QueryAgentsAgentsResults"]]


class QueryAgentsAgentsResults(BaseModel):
    id: str
    name: str
    creation_date: Any = Field(alias="creationDate")
    modified_date: Optional[Any] = Field(alias="modifiedDate")
    relevance: Optional[float]
    owner: "QueryAgentsAgentsResultsOwner"
    state: EntityState
    correlation_id: Optional[str] = Field(alias="correlationId")
    type: AgentTypes
    specification: Optional["QueryAgentsAgentsResultsSpecification"]
    filter: Optional["QueryAgentsAgentsResultsFilter"]
    schedule_policy: Optional["QueryAgentsAgentsResultsSchedulePolicy"] = Field(
        alias="schedulePolicy"
    )
    timeout: Optional[Any]
    scratchpad: Optional[str]


class QueryAgentsAgentsResultsOwner(BaseModel):
    id: str


class QueryAgentsAgentsResultsSpecification(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilter(BaseModel):
    date_range: Optional["QueryAgentsAgentsResultsFilterDateRange"] = Field(
        alias="dateRange"
    )
    in_last: Optional[Any] = Field(alias="inLast")
    in_next: Optional[Any] = Field(alias="inNext")
    creation_date_range: Optional["QueryAgentsAgentsResultsFilterCreationDateRange"] = (
        Field(alias="creationDateRange")
    )
    created_in_last: Optional[Any] = Field(alias="createdInLast")
    types: Optional[list[ContentTypes]]
    file_types: Optional[list[FileTypes]] = Field(alias="fileTypes")
    formats: Optional[list[str]]
    file_extensions: Optional[list[str]] = Field(alias="fileExtensions")
    file_size_range: Optional["QueryAgentsAgentsResultsFilterFileSizeRange"] = Field(
        alias="fileSizeRange"
    )
    similar_contents: Optional[
        list["QueryAgentsAgentsResultsFilterSimilarContents"]
    ] = Field(alias="similarContents")
    contents: Optional[list["QueryAgentsAgentsResultsFilterContents"]]
    feeds: Optional[list["QueryAgentsAgentsResultsFilterFeeds"]]
    workflows: Optional[list["QueryAgentsAgentsResultsFilterWorkflows"]]
    collections: Optional[list["QueryAgentsAgentsResultsFilterCollections"]]
    users: Optional[list["QueryAgentsAgentsResultsFilterUsers"]]
    observations: Optional[list["QueryAgentsAgentsResultsFilterObservations"]]
    or_: Optional[list["QueryAgentsAgentsResultsFilterOr"]] = Field(alias="or")
    and_: Optional[list["QueryAgentsAgentsResultsFilterAnd"]] = Field(alias="and")
    has_observations: Optional[bool] = Field(alias="hasObservations")
    has_feeds: Optional[bool] = Field(alias="hasFeeds")
    has_collections: Optional[bool] = Field(alias="hasCollections")
    has_workflows: Optional[bool] = Field(alias="hasWorkflows")
    collection_mode: Optional[FilterMode] = Field(alias="collectionMode")
    observation_mode: Optional[FilterMode] = Field(alias="observationMode")


class QueryAgentsAgentsResultsFilterDateRange(BaseModel):
    from_: Optional[Any] = Field(alias="from")
    to: Optional[Any]


class QueryAgentsAgentsResultsFilterCreationDateRange(BaseModel):
    from_: Optional[Any] = Field(alias="from")
    to: Optional[Any]


class QueryAgentsAgentsResultsFilterFileSizeRange(BaseModel):
    from_: Optional[Any] = Field(alias="from")
    to: Optional[Any]


class QueryAgentsAgentsResultsFilterSimilarContents(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterContents(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterFeeds(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterWorkflows(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterCollections(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterUsers(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterObservations(BaseModel):
    type: ObservableTypes
    observable: "QueryAgentsAgentsResultsFilterObservationsObservable"
    states: Optional[list[EntityState]]


class QueryAgentsAgentsResultsFilterObservationsObservable(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterOr(BaseModel):
    feeds: Optional[list["QueryAgentsAgentsResultsFilterOrFeeds"]]
    workflows: Optional[list["QueryAgentsAgentsResultsFilterOrWorkflows"]]
    collections: Optional[list["QueryAgentsAgentsResultsFilterOrCollections"]]
    users: Optional[list["QueryAgentsAgentsResultsFilterOrUsers"]]
    observations: Optional[list["QueryAgentsAgentsResultsFilterOrObservations"]]


class QueryAgentsAgentsResultsFilterOrFeeds(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterOrWorkflows(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterOrCollections(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterOrUsers(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterOrObservations(BaseModel):
    type: ObservableTypes
    observable: "QueryAgentsAgentsResultsFilterOrObservationsObservable"
    states: Optional[list[EntityState]]


class QueryAgentsAgentsResultsFilterOrObservationsObservable(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterAnd(BaseModel):
    feeds: Optional[list["QueryAgentsAgentsResultsFilterAndFeeds"]]
    workflows: Optional[list["QueryAgentsAgentsResultsFilterAndWorkflows"]]
    collections: Optional[list["QueryAgentsAgentsResultsFilterAndCollections"]]
    users: Optional[list["QueryAgentsAgentsResultsFilterAndUsers"]]
    observations: Optional[list["QueryAgentsAgentsResultsFilterAndObservations"]]


class QueryAgentsAgentsResultsFilterAndFeeds(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterAndWorkflows(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterAndCollections(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterAndUsers(BaseModel):
    id: str


class QueryAgentsAgentsResultsFilterAndObservations(BaseModel):
    type: ObservableTypes
    observable: "QueryAgentsAgentsResultsFilterAndObservationsObservable"
    states: Optional[list[EntityState]]


class QueryAgentsAgentsResultsFilterAndObservationsObservable(BaseModel):
    id: str


class QueryAgentsAgentsResultsSchedulePolicy(BaseModel):
    recurrence_type: Optional[TimedPolicyRecurrenceTypes] = Field(
        alias="recurrenceType"
    )
    repeat_interval: Optional[Any] = Field(alias="repeatInterval")
    cron: Optional[str]
    time_zone_id: Optional[str] = Field(alias="timeZoneId")


QueryAgents.model_rebuild()
QueryAgentsAgents.model_rebuild()
QueryAgentsAgentsResults.model_rebuild()
QueryAgentsAgentsResultsFilter.model_rebuild()
QueryAgentsAgentsResultsFilterObservations.model_rebuild()
QueryAgentsAgentsResultsFilterOr.model_rebuild()
QueryAgentsAgentsResultsFilterOrObservations.model_rebuild()
QueryAgentsAgentsResultsFilterAnd.model_rebuild()
QueryAgentsAgentsResultsFilterAndObservations.model_rebuild()
