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

from __future__ import annotations
import dataclasses
from ..shared import bucket as shared_bucket
from ..shared import fieldtype as shared_fieldtype
from ..shared import topvalue as shared_topvalue
from cribl import utils
from dataclasses_json import Undefined, dataclass_json
from typing import Optional


@dataclass_json(undefined=Undefined.EXCLUDE)

@dataclasses.dataclass
class Field:
    buckets: list[shared_bucket.Bucket] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('buckets') }})
    count: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('count') }})
    count_distinct: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('countDistinct') }})
    count_null: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('countNull') }})
    size: int = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('size') }})
    top_values: list[shared_topvalue.TopValue] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('topValues') }})
    type: shared_fieldtype.FieldType = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type') }})
    mean: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('mean'), 'exclude': lambda f: f is None }})
    name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }})
    stdev: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('stdev'), 'exclude': lambda f: f is None }})
    

