"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
from ..shared import chartconfig as shared_chartconfig
from ..shared import cputimemetric as shared_cputimemetric
from ..shared import datatypeoverrides as shared_datatypeoverrides
from ..shared import searchconfig as shared_searchconfig
from ..shared import searchjoberrorstateconfig as shared_searchjoberrorstateconfig
from ..shared import searchjobstatus as shared_searchjobstatus
from ..shared import searchjobtype as shared_searchjobtype
from ..shared import searchparameter as shared_searchparameter
from ..shared import tableviewsettings as shared_tableviewsettings
from cribl import utils
from dataclasses_json import Undefined, dataclass_json
from typing import Any, Optional


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class SearchJobCompatibilityChecks:
    datatypes: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datatypes'), 'exclude': lambda f: f is None }})
    



@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class SearchJob:
    r"""New SearchJob object"""
    group: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('group') }})
    id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('id') }})
    query: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('query') }})
    search_config: shared_searchconfig.SearchConfig = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('searchConfig') }})
    status: shared_searchjobstatus.SearchJobStatus = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('status') }})
    time_created: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeCreated') }})
    user: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user') }})
    chart_config: Optional[shared_chartconfig.ChartConfig] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('chartConfig'), 'exclude': lambda f: f is None }})
    compatibility_checks: Optional[SearchJobCompatibilityChecks] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('compatibilityChecks'), 'exclude': lambda f: f is None }})
    correlation_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('correlationId'), 'exclude': lambda f: f is None }})
    cpu_metrics: Optional[shared_cputimemetric.CPUTimeMetric] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cpuMetrics'), 'exclude': lambda f: f is None }})
    datatype_overrides: Optional[shared_datatypeoverrides.DatatypeOverrides] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('datatypeOverrides'), 'exclude': lambda f: f is None }})
    earliest_epoch: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('earliestEpoch'), 'exclude': lambda f: f is None }})
    error_state_config: Optional[shared_searchjoberrorstateconfig.SearchJobErrorStateConfig] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('errorStateConfig'), 'exclude': lambda f: f is None }})
    latest_epoch: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latestEpoch'), 'exclude': lambda f: f is None }})
    num_events_after: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('numEventsAfter'), 'exclude': lambda f: f is None }})
    num_events_before: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('numEventsBefore'), 'exclude': lambda f: f is None }})
    sample_rate: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sampleRate'), 'exclude': lambda f: f is None }})
    search_parameter_declarations: Optional[list[shared_searchparameter.SearchParameter]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('searchParameterDeclarations'), 'exclude': lambda f: f is None }})
    search_parameter_values: Optional[Any] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('searchParameterValues'), 'exclude': lambda f: f is None }})
    table_config: Optional[shared_tableviewsettings.TableViewSettings] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('tableConfig'), 'exclude': lambda f: f is None }})
    target_event_time: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('targetEventTime'), 'exclude': lambda f: f is None }})
    time_completed: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeCompleted'), 'exclude': lambda f: f is None }})
    time_started: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('timeStarted'), 'exclude': lambda f: f is None }})
    type: Optional[shared_searchjobtype.SearchJobType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }})
    

