# generated by datamodel-codegen:
#   filename:  dpcr.json
#   timestamp: 2024-01-12T14:18:33+00:00

from __future__ import annotations

from dataclasses import dataclass
from enum import Enum
from typing import Optional

from allotropy.allotrope.models.shared.definitions.custom import (
    TQuantityValueDegreeCelsius,
    TQuantityValueMicroliter,
    TQuantityValueNumber,
    TQuantityValueNumberPerMicroliter,
    TQuantityValueSecondTime,
    TQuantityValueUnitless,
)
from allotropy.allotrope.models.shared.definitions.definitions import (
    TDateTimeValue,
    TQuantityValue,
    TStringValue,
)


class ExperimentType(Enum):
    dPCR_experiment = "dPCR experiment"


class ContainerType(Enum):
    reactor = "reactor"
    controlled_lab_reactor = "controlled lab reactor"
    tube = "tube"
    well_plate = "well plate"
    differential_scanning_calorimetry_pan = "differential scanning calorimetry pan"
    qPCR_reaction_block = "qPCR reaction block"
    vial_rack = "vial rack"
    pan = "pan"
    reservoir = "reservoir"
    array_card_block = "array card block"
    capillary = "capillary"
    disintegration_apparatus_basket = "disintegration apparatus basket"
    jar = "jar"
    container = "container"
    tray = "tray"
    basket = "basket"
    cell_holder = "cell holder"


@dataclass
class DataSourceDocumentItem:
    data_source_identifier: Optional[TStringValue] = None
    data_source_feature: Optional[TStringValue] = None


@dataclass
class DataSourceAggregateDocument:
    data_source_document: Optional[list[DataSourceDocumentItem]] = None


@dataclass
class DeviceSystemDocument:
    device_identifier: TStringValue
    asset_management_identifier: Optional[TStringValue] = None
    model_number: Optional[TStringValue] = None
    device_serial_number: Optional[TStringValue] = None
    firmware_version: Optional[TStringValue] = None
    description: Optional[TStringValue] = None
    brand_name: Optional[TStringValue] = None
    product_manufacturer: Optional[TStringValue] = None


@dataclass
class DataSystemDocument:
    data_system_instance_identifier: Optional[TStringValue] = None
    file_name: Optional[TStringValue] = None
    UNC_path: Optional[TStringValue] = None
    software_name: Optional[TStringValue] = None
    software_version: Optional[TStringValue] = None
    ASM_converter_name: Optional[TStringValue] = None
    ASM_converter_version: Optional[TStringValue] = None


@dataclass
class SampleDocument:
    sample_identifier: TStringValue
    batch_identifier: Optional[TStringValue] = None
    sample_role_type: Optional[TStringValue] = None
    well_location_identifier: Optional[TStringValue] = None
    well_plate_identifier: Optional[TStringValue] = None


@dataclass
class DeviceControlDocumentItem:
    device_type: TStringValue
    device_identifier: Optional[TStringValue] = None
    detection_type: Optional[TStringValue] = None
    measurement_method_identifier: Optional[TStringValue] = None
    total_cycle_number_setting: Optional[TQuantityValueNumber] = None
    denaturing_temperature_setting: Optional[TQuantityValueDegreeCelsius] = None
    denaturing_time_setting: Optional[TQuantityValueSecondTime] = None
    annealing_temperature_setting: Optional[TQuantityValueDegreeCelsius] = None
    annealing_time_setting: Optional[TQuantityValueSecondTime] = None
    extension_temperature_setting: Optional[TQuantityValueDegreeCelsius] = None
    extension_time_setting: Optional[TQuantityValueSecondTime] = None
    PCR_detection_chemistry: Optional[TStringValue] = None
    reporter_dye_setting: Optional[TStringValue] = None
    quencher_dye_setting: Optional[TStringValue] = None
    passive_reference_dye_setting: Optional[TStringValue] = None


@dataclass
class DeviceControlAggregateDocument:
    device_control_document: list[DeviceControlDocumentItem]


@dataclass
class DataProcessingDocument:
    flourescence_intensity_threshold_setting: Optional[TQuantityValueUnitless] = None


@dataclass
class ProcessedDataDocumentItem:
    number_concentration: TQuantityValueNumberPerMicroliter
    positive_partition_count: TQuantityValueNumber
    data_processing_document: Optional[DataProcessingDocument] = None
    negative_partition_count: Optional[TQuantityValueNumber] = None


@dataclass
class ProcessedDataAggregateDocument:
    processed_data_document: list[ProcessedDataDocumentItem]


@dataclass
class MeasurementDocumentItem:
    measurement_identifier: TStringValue
    measurement_time: TDateTimeValue
    target_DNA_description: TStringValue
    sample_document: SampleDocument
    device_control_aggregate_document: DeviceControlAggregateDocument
    total_partition_count: TQuantityValueNumber
    processed_data_aggregate_document: ProcessedDataAggregateDocument


@dataclass
class MeasurementAggregateDocument:
    plate_well_count: TQuantityValueNumber
    measurement_document: list[MeasurementDocumentItem]
    analytical_method_identifier: Optional[TStringValue] = None
    experimental_data_identifier: Optional[TStringValue] = None
    experiment_type: Optional[ExperimentType] = None
    container_type: Optional[ContainerType] = None
    well_volume: Optional[TQuantityValueMicroliter] = None


@dataclass
class DataProcessingDocument1:
    reference_DNA_description: Optional[TStringValue] = None
    reference_DNA_copy_number_setting: Optional[TQuantityValueNumber] = None


@dataclass
class CalculatedDataDocumentItem:
    calculated_data_identifier: Optional[TStringValue] = None
    data_source_aggregate_document: Optional[DataSourceAggregateDocument] = None
    data_processing_document: Optional[DataProcessingDocument1] = None
    calculated_data_name: Optional[TStringValue] = None
    calculated_data_description: Optional[TStringValue] = None
    calculated_datum: Optional[TQuantityValue] = None


@dataclass
class TCalculatedDataAggregateDocument:
    calculated_data_document: Optional[list[CalculatedDataDocumentItem]] = None


@dataclass
class DPCRDocumentItem:
    measurement_aggregate_document: MeasurementAggregateDocument
    analyst: Optional[TStringValue] = None
    submitter: Optional[TStringValue] = None
    calculated_data_aggregate_document: Optional[
        TCalculatedDataAggregateDocument
    ] = None


@dataclass
class DPCRAggregateDocument:
    device_system_document: DeviceSystemDocument
    dPCR_document: list[DPCRDocumentItem]
    data_system_document: Optional[DataSystemDocument] = None
    calculated_data_aggregate_document: Optional[
        TCalculatedDataAggregateDocument
    ] = None


@dataclass
class Model:
    dPCR_aggregate_document: Optional[DPCRAggregateDocument] = None
    manifest: str = (
        "http://purl.allotrope.org/manifests/pcr/BENCHLING/2023/09/dpcr.manifest"
    )
