# generated by datamodel-codegen:
#   filename:  mass-spectrometry.schema.json
#   timestamp: 2025-11-05T18:53:18+00:00

from __future__ import annotations

from dataclasses import dataclass

from allotropy.allotrope.models.shared.definitions.custom import (
    TQuantityValueDalton,
    TQuantityValueHertz,
    TQuantityValueMassPerCharge,
    TQuantityValueMilliliterPerMinute,
    TQuantityValuePercent,
    TQuantityValueSecondTime,
)
from allotropy.allotrope.models.shared.definitions.definitions import (
    TClass,
    TQuantityValue,
    TStringValue,
)

TNamed = str


@dataclass(kw_only=True)
class DeviceDocumentItem:
    device_type: TClass
    model_number: TStringValue
    product_manufacturer: TStringValue


@dataclass(kw_only=True)
class DeviceSystemDocument:
    asset_management_identifier: TStringValue
    device_document: list[DeviceDocumentItem] | None = None


@dataclass(kw_only=True)
class DataProcessingDocumentItem:
    data_processing_type: TStringValue | None = None


@dataclass(kw_only=True)
class DataProcessingAggregateDocument:
    data_processing_document: list[DataProcessingDocumentItem] | None = None


@dataclass(kw_only=True)
class DetectorControlDocumentItem:
    detection_type: TStringValue
    detection_duration_setting: TQuantityValueSecondTime | None = None
    detector_relative_offset_setting: TQuantityValueSecondTime | None = None
    detector_sampling_rate_setting: TQuantityValueHertz | None = None
    m_z_maximum_setting: TQuantityValueMassPerCharge | None = None
    m_z_minimum_setting: TQuantityValueMassPerCharge | None = None
    polarity_setting: TNamed | None = None
    field_index: int | None = None


@dataclass(kw_only=True)
class DetectorControlAggregateDocument:
    detector_control_document: list[DetectorControlDocumentItem] | None = None


@dataclass(kw_only=True)
class MeasurementDocument:
    measurement_mode_setting: TStringValue
    detector_control_aggregate_document: DetectorControlAggregateDocument | None = None


@dataclass(kw_only=True)
class ProcessedDataDocumentItem:
    data_format_specification_type: TStringValue


@dataclass(kw_only=True)
class ProcessedDataAggregateDocument:
    processed_data_document: list[ProcessedDataDocumentItem] | None = None


@dataclass(kw_only=True)
class SampleDocument:
    sample_identifier: TStringValue


@dataclass(kw_only=True)
class SampleIntroductionDocument:
    sample_introduction_medium: TStringValue
    sample_introduction_mode_setting: TStringValue
    flow_rate_setting: TQuantityValueMilliliterPerMinute | None = None
    laser_firing_frequency_setting: TQuantityValueHertz | None = None
    sample_introduction_description: TStringValue | None = None


@dataclass(kw_only=True)
class MassSpectrometryDocumentItem:
    analyst: TStringValue
    submitter: TStringValue
    data_processing_aggregate_document: DataProcessingAggregateDocument | None = None
    measurement_document: MeasurementDocument | None = None
    processed_data_aggregate_document: ProcessedDataAggregateDocument | None = None
    sample_document: SampleDocument | None = None
    sample_introduction_document: SampleIntroductionDocument | None = None


@dataclass(kw_only=True)
class MassSpectrometryAggregateDocument:
    device_system_document: DeviceSystemDocument | None = None
    mass_spectrometry_document: list[MassSpectrometryDocumentItem] | None = None


@dataclass(kw_only=True)
class PeakItem:
    identifier: TStringValue | None = None
    m_z: TQuantityValueMassPerCharge | None = None
    mass: TQuantityValueDalton | None = None
    peak_area: TQuantityValue | None = None
    peak_height: TQuantityValue | None = None
    peak_width: TQuantityValue | None = None
    relative_peak_area: TQuantityValuePercent | None = None
    relative_peak_height: TQuantityValuePercent | None = None
    written_name: TStringValue | None = None
    field_index: int | None = None


@dataclass(kw_only=True)
class PeakList:
    peak: list[PeakItem] | None = None


@dataclass(kw_only=True)
class Model:
    manifest: str = "http://purl.allotrope.org/manifests/mass-spectrometry/REC/2025/06/mass-spectrometry.manifest"
    data_processing_description: TStringValue | None = None
    mass_spectrometry_aggregate_document: MassSpectrometryAggregateDocument | None = (
        None
    )
    peak_list: PeakList | None = None
