# coding: utf-8

"""
    IGVF Project API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 73.0.0
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
import pprint
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
from typing import Any, List, Optional
from igvf_client.models.access_key import AccessKey
from igvf_client.models.alignment_file import AlignmentFile
from igvf_client.models.analysis_set import AnalysisSet
from igvf_client.models.analysis_step import AnalysisStep
from igvf_client.models.analysis_step_version import AnalysisStepVersion
from igvf_client.models.assay_term import AssayTerm
from igvf_client.models.auxiliary_set import AuxiliarySet
from igvf_client.models.award import Award
from igvf_client.models.biomarker import Biomarker
from igvf_client.models.configuration_file import ConfigurationFile
from igvf_client.models.construct_library_set import ConstructLibrarySet
from igvf_client.models.crispr_modification import CrisprModification
from igvf_client.models.curated_set import CuratedSet
from igvf_client.models.degron_modification import DegronModification
from igvf_client.models.document import Document
from igvf_client.models.gene import Gene
from igvf_client.models.genome_browser_annotation_file import GenomeBrowserAnnotationFile
from igvf_client.models.human_donor import HumanDonor
from igvf_client.models.image import Image
from igvf_client.models.image_file import ImageFile
from igvf_client.models.in_vitro_system import InVitroSystem
from igvf_client.models.index_file import IndexFile
from igvf_client.models.institutional_certificate import InstitutionalCertificate
from igvf_client.models.lab import Lab
from igvf_client.models.matrix_file import MatrixFile
from igvf_client.models.measurement_set import MeasurementSet
from igvf_client.models.model_file import ModelFile
from igvf_client.models.model_set import ModelSet
from igvf_client.models.mpra_quality_metric import MpraQualityMetric
from igvf_client.models.multiplexed_sample import MultiplexedSample
from igvf_client.models.open_reading_frame import OpenReadingFrame
from igvf_client.models.page import Page
from igvf_client.models.perturb_seq_quality_metric import PerturbSeqQualityMetric
from igvf_client.models.phenotype_term import PhenotypeTerm
from igvf_client.models.phenotypic_feature import PhenotypicFeature
from igvf_client.models.platform_term import PlatformTerm
from igvf_client.models.prediction_set import PredictionSet
from igvf_client.models.primary_cell import PrimaryCell
from igvf_client.models.publication import Publication
from igvf_client.models.reference_file import ReferenceFile
from igvf_client.models.rodent_donor import RodentDonor
from igvf_client.models.sample_term import SampleTerm
from igvf_client.models.sequence_file import SequenceFile
from igvf_client.models.signal_file import SignalFile
from igvf_client.models.single_cell_atac_seq_quality_metric import SingleCellAtacSeqQualityMetric
from igvf_client.models.single_cell_rna_seq_quality_metric import SingleCellRnaSeqQualityMetric
from igvf_client.models.software import Software
from igvf_client.models.software_version import SoftwareVersion
from igvf_client.models.source import Source
from igvf_client.models.starr_seq_quality_metric import StarrSeqQualityMetric
from igvf_client.models.tabular_file import TabularFile
from igvf_client.models.technical_sample import TechnicalSample
from igvf_client.models.tissue import Tissue
from igvf_client.models.treatment import Treatment
from igvf_client.models.user import User
from igvf_client.models.whole_organism import WholeOrganism
from igvf_client.models.workflow import Workflow
from pydantic import StrictStr, Field
from typing import Union, List, Set, Optional, Dict
from typing_extensions import Literal, Self
import logging
SEARCHRESULTITEM_ONE_OF_SCHEMAS = ["AccessKey", "AlignmentFile", "AnalysisSet", "AnalysisStep", "AnalysisStepVersion", "AssayTerm", "AuxiliarySet", "Award", "Biomarker", "ConfigurationFile", "ConstructLibrarySet", "CrisprModification", "CuratedSet", "DegronModification", "Document", "Gene", "GenomeBrowserAnnotationFile", "HumanDonor", "Image", "ImageFile", "InVitroSystem", "IndexFile", "InstitutionalCertificate", "Lab", "MatrixFile", "MeasurementSet", "ModelFile", "ModelSet", "MpraQualityMetric", "MultiplexedSample", "OpenReadingFrame", "Page", "PerturbSeqQualityMetric", "PhenotypeTerm", "PhenotypicFeature", "PlatformTerm", "PredictionSet", "PrimaryCell", "Publication", "ReferenceFile", "RodentDonor", "SampleTerm", "SequenceFile", "SignalFile", "SingleCellAtacSeqQualityMetric", "SingleCellRnaSeqQualityMetric", "Software", "SoftwareVersion", "Source", "StarrSeqQualityMetric", "TabularFile", "TechnicalSample", "Tissue", "Treatment", "User", "WholeOrganism", "Workflow"]

class SearchResultItem(BaseModel):
    """
    SearchResultItem
    """
    # data type: AccessKey
    oneof_schema_1_validator: Optional[AccessKey] = None
    # data type: AnalysisStep
    oneof_schema_2_validator: Optional[AnalysisStep] = None
    # data type: AnalysisStepVersion
    oneof_schema_3_validator: Optional[AnalysisStepVersion] = None
    # data type: Award
    oneof_schema_4_validator: Optional[Award] = None
    # data type: Biomarker
    oneof_schema_5_validator: Optional[Biomarker] = None
    # data type: Document
    oneof_schema_6_validator: Optional[Document] = None
    # data type: HumanDonor
    oneof_schema_7_validator: Optional[HumanDonor] = None
    # data type: RodentDonor
    oneof_schema_8_validator: Optional[RodentDonor] = None
    # data type: AlignmentFile
    oneof_schema_9_validator: Optional[AlignmentFile] = None
    # data type: ConfigurationFile
    oneof_schema_10_validator: Optional[ConfigurationFile] = None
    # data type: GenomeBrowserAnnotationFile
    oneof_schema_11_validator: Optional[GenomeBrowserAnnotationFile] = None
    # data type: ImageFile
    oneof_schema_12_validator: Optional[ImageFile] = None
    # data type: IndexFile
    oneof_schema_13_validator: Optional[IndexFile] = None
    # data type: MatrixFile
    oneof_schema_14_validator: Optional[MatrixFile] = None
    # data type: ModelFile
    oneof_schema_15_validator: Optional[ModelFile] = None
    # data type: ReferenceFile
    oneof_schema_16_validator: Optional[ReferenceFile] = None
    # data type: SequenceFile
    oneof_schema_17_validator: Optional[SequenceFile] = None
    # data type: SignalFile
    oneof_schema_18_validator: Optional[SignalFile] = None
    # data type: TabularFile
    oneof_schema_19_validator: Optional[TabularFile] = None
    # data type: AnalysisSet
    oneof_schema_20_validator: Optional[AnalysisSet] = None
    # data type: AuxiliarySet
    oneof_schema_21_validator: Optional[AuxiliarySet] = None
    # data type: ConstructLibrarySet
    oneof_schema_22_validator: Optional[ConstructLibrarySet] = None
    # data type: CuratedSet
    oneof_schema_23_validator: Optional[CuratedSet] = None
    # data type: MeasurementSet
    oneof_schema_24_validator: Optional[MeasurementSet] = None
    # data type: ModelSet
    oneof_schema_25_validator: Optional[ModelSet] = None
    # data type: PredictionSet
    oneof_schema_26_validator: Optional[PredictionSet] = None
    # data type: Gene
    oneof_schema_27_validator: Optional[Gene] = None
    # data type: Image
    oneof_schema_28_validator: Optional[Image] = None
    # data type: InstitutionalCertificate
    oneof_schema_29_validator: Optional[InstitutionalCertificate] = None
    # data type: Lab
    oneof_schema_30_validator: Optional[Lab] = None
    # data type: CrisprModification
    oneof_schema_31_validator: Optional[CrisprModification] = None
    # data type: DegronModification
    oneof_schema_32_validator: Optional[DegronModification] = None
    # data type: AssayTerm
    oneof_schema_33_validator: Optional[AssayTerm] = None
    # data type: PhenotypeTerm
    oneof_schema_34_validator: Optional[PhenotypeTerm] = None
    # data type: PlatformTerm
    oneof_schema_35_validator: Optional[PlatformTerm] = None
    # data type: SampleTerm
    oneof_schema_36_validator: Optional[SampleTerm] = None
    # data type: OpenReadingFrame
    oneof_schema_37_validator: Optional[OpenReadingFrame] = None
    # data type: Page
    oneof_schema_38_validator: Optional[Page] = None
    # data type: PhenotypicFeature
    oneof_schema_39_validator: Optional[PhenotypicFeature] = None
    # data type: Publication
    oneof_schema_40_validator: Optional[Publication] = None
    # data type: MpraQualityMetric
    oneof_schema_41_validator: Optional[MpraQualityMetric] = None
    # data type: PerturbSeqQualityMetric
    oneof_schema_42_validator: Optional[PerturbSeqQualityMetric] = None
    # data type: SingleCellAtacSeqQualityMetric
    oneof_schema_43_validator: Optional[SingleCellAtacSeqQualityMetric] = None
    # data type: SingleCellRnaSeqQualityMetric
    oneof_schema_44_validator: Optional[SingleCellRnaSeqQualityMetric] = None
    # data type: StarrSeqQualityMetric
    oneof_schema_45_validator: Optional[StarrSeqQualityMetric] = None
    # data type: InVitroSystem
    oneof_schema_46_validator: Optional[InVitroSystem] = None
    # data type: MultiplexedSample
    oneof_schema_47_validator: Optional[MultiplexedSample] = None
    # data type: PrimaryCell
    oneof_schema_48_validator: Optional[PrimaryCell] = None
    # data type: TechnicalSample
    oneof_schema_49_validator: Optional[TechnicalSample] = None
    # data type: Tissue
    oneof_schema_50_validator: Optional[Tissue] = None
    # data type: WholeOrganism
    oneof_schema_51_validator: Optional[WholeOrganism] = None
    # data type: Software
    oneof_schema_52_validator: Optional[Software] = None
    # data type: SoftwareVersion
    oneof_schema_53_validator: Optional[SoftwareVersion] = None
    # data type: Source
    oneof_schema_54_validator: Optional[Source] = None
    # data type: Treatment
    oneof_schema_55_validator: Optional[Treatment] = None
    # data type: User
    oneof_schema_56_validator: Optional[User] = None
    # data type: Workflow
    oneof_schema_57_validator: Optional[Workflow] = None
    actual_instance: Optional[Union[AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow]] = None
    one_of_schemas: Set[str] = { "AccessKey", "AlignmentFile", "AnalysisSet", "AnalysisStep", "AnalysisStepVersion", "AssayTerm", "AuxiliarySet", "Award", "Biomarker", "ConfigurationFile", "ConstructLibrarySet", "CrisprModification", "CuratedSet", "DegronModification", "Document", "Gene", "GenomeBrowserAnnotationFile", "HumanDonor", "Image", "ImageFile", "InVitroSystem", "IndexFile", "InstitutionalCertificate", "Lab", "MatrixFile", "MeasurementSet", "ModelFile", "ModelSet", "MpraQualityMetric", "MultiplexedSample", "OpenReadingFrame", "Page", "PerturbSeqQualityMetric", "PhenotypeTerm", "PhenotypicFeature", "PlatformTerm", "PredictionSet", "PrimaryCell", "Publication", "ReferenceFile", "RodentDonor", "SampleTerm", "SequenceFile", "SignalFile", "SingleCellAtacSeqQualityMetric", "SingleCellRnaSeqQualityMetric", "Software", "SoftwareVersion", "Source", "StarrSeqQualityMetric", "TabularFile", "TechnicalSample", "Tissue", "Treatment", "User", "WholeOrganism", "Workflow" }

    model_config = ConfigDict(
        validate_assignment=True,
        protected_namespaces=(),
    )


    discriminator_value_class_map: Dict[str, str] = {
    }

    def __init__(self, *args, **kwargs) -> None:
        if args:
            if len(args) > 1:
                raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
            if kwargs:
                raise ValueError("If a position argument is used, keyword arguments cannot be used.")
            super().__init__(actual_instance=args[0])
        else:
            super().__init__(**kwargs)

    @field_validator('actual_instance')
    def actual_instance_must_validate_oneof(cls, v):
        instance = SearchResultItem.model_construct()
        error_messages = []
        match = 0
        # validate data type: AccessKey
        if not isinstance(v, AccessKey):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AccessKey`")
        else:
            match += 1
        # validate data type: AnalysisStep
        if not isinstance(v, AnalysisStep):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AnalysisStep`")
        else:
            match += 1
        # validate data type: AnalysisStepVersion
        if not isinstance(v, AnalysisStepVersion):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AnalysisStepVersion`")
        else:
            match += 1
        # validate data type: Award
        if not isinstance(v, Award):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Award`")
        else:
            match += 1
        # validate data type: Biomarker
        if not isinstance(v, Biomarker):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Biomarker`")
        else:
            match += 1
        # validate data type: Document
        if not isinstance(v, Document):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Document`")
        else:
            match += 1
        # validate data type: HumanDonor
        if not isinstance(v, HumanDonor):
            error_messages.append(f"Error! Input type `{type(v)}` is not `HumanDonor`")
        else:
            match += 1
        # validate data type: RodentDonor
        if not isinstance(v, RodentDonor):
            error_messages.append(f"Error! Input type `{type(v)}` is not `RodentDonor`")
        else:
            match += 1
        # validate data type: AlignmentFile
        if not isinstance(v, AlignmentFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AlignmentFile`")
        else:
            match += 1
        # validate data type: ConfigurationFile
        if not isinstance(v, ConfigurationFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ConfigurationFile`")
        else:
            match += 1
        # validate data type: GenomeBrowserAnnotationFile
        if not isinstance(v, GenomeBrowserAnnotationFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `GenomeBrowserAnnotationFile`")
        else:
            match += 1
        # validate data type: ImageFile
        if not isinstance(v, ImageFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ImageFile`")
        else:
            match += 1
        # validate data type: IndexFile
        if not isinstance(v, IndexFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `IndexFile`")
        else:
            match += 1
        # validate data type: MatrixFile
        if not isinstance(v, MatrixFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MatrixFile`")
        else:
            match += 1
        # validate data type: ModelFile
        if not isinstance(v, ModelFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ModelFile`")
        else:
            match += 1
        # validate data type: ReferenceFile
        if not isinstance(v, ReferenceFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ReferenceFile`")
        else:
            match += 1
        # validate data type: SequenceFile
        if not isinstance(v, SequenceFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SequenceFile`")
        else:
            match += 1
        # validate data type: SignalFile
        if not isinstance(v, SignalFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SignalFile`")
        else:
            match += 1
        # validate data type: TabularFile
        if not isinstance(v, TabularFile):
            error_messages.append(f"Error! Input type `{type(v)}` is not `TabularFile`")
        else:
            match += 1
        # validate data type: AnalysisSet
        if not isinstance(v, AnalysisSet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AnalysisSet`")
        else:
            match += 1
        # validate data type: AuxiliarySet
        if not isinstance(v, AuxiliarySet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AuxiliarySet`")
        else:
            match += 1
        # validate data type: ConstructLibrarySet
        if not isinstance(v, ConstructLibrarySet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ConstructLibrarySet`")
        else:
            match += 1
        # validate data type: CuratedSet
        if not isinstance(v, CuratedSet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CuratedSet`")
        else:
            match += 1
        # validate data type: MeasurementSet
        if not isinstance(v, MeasurementSet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MeasurementSet`")
        else:
            match += 1
        # validate data type: ModelSet
        if not isinstance(v, ModelSet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `ModelSet`")
        else:
            match += 1
        # validate data type: PredictionSet
        if not isinstance(v, PredictionSet):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PredictionSet`")
        else:
            match += 1
        # validate data type: Gene
        if not isinstance(v, Gene):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Gene`")
        else:
            match += 1
        # validate data type: Image
        if not isinstance(v, Image):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Image`")
        else:
            match += 1
        # validate data type: InstitutionalCertificate
        if not isinstance(v, InstitutionalCertificate):
            error_messages.append(f"Error! Input type `{type(v)}` is not `InstitutionalCertificate`")
        else:
            match += 1
        # validate data type: Lab
        if not isinstance(v, Lab):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Lab`")
        else:
            match += 1
        # validate data type: CrisprModification
        if not isinstance(v, CrisprModification):
            error_messages.append(f"Error! Input type `{type(v)}` is not `CrisprModification`")
        else:
            match += 1
        # validate data type: DegronModification
        if not isinstance(v, DegronModification):
            error_messages.append(f"Error! Input type `{type(v)}` is not `DegronModification`")
        else:
            match += 1
        # validate data type: AssayTerm
        if not isinstance(v, AssayTerm):
            error_messages.append(f"Error! Input type `{type(v)}` is not `AssayTerm`")
        else:
            match += 1
        # validate data type: PhenotypeTerm
        if not isinstance(v, PhenotypeTerm):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PhenotypeTerm`")
        else:
            match += 1
        # validate data type: PlatformTerm
        if not isinstance(v, PlatformTerm):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PlatformTerm`")
        else:
            match += 1
        # validate data type: SampleTerm
        if not isinstance(v, SampleTerm):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SampleTerm`")
        else:
            match += 1
        # validate data type: OpenReadingFrame
        if not isinstance(v, OpenReadingFrame):
            error_messages.append(f"Error! Input type `{type(v)}` is not `OpenReadingFrame`")
        else:
            match += 1
        # validate data type: Page
        if not isinstance(v, Page):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Page`")
        else:
            match += 1
        # validate data type: PhenotypicFeature
        if not isinstance(v, PhenotypicFeature):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PhenotypicFeature`")
        else:
            match += 1
        # validate data type: Publication
        if not isinstance(v, Publication):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Publication`")
        else:
            match += 1
        # validate data type: MpraQualityMetric
        if not isinstance(v, MpraQualityMetric):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MpraQualityMetric`")
        else:
            match += 1
        # validate data type: PerturbSeqQualityMetric
        if not isinstance(v, PerturbSeqQualityMetric):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PerturbSeqQualityMetric`")
        else:
            match += 1
        # validate data type: SingleCellAtacSeqQualityMetric
        if not isinstance(v, SingleCellAtacSeqQualityMetric):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SingleCellAtacSeqQualityMetric`")
        else:
            match += 1
        # validate data type: SingleCellRnaSeqQualityMetric
        if not isinstance(v, SingleCellRnaSeqQualityMetric):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SingleCellRnaSeqQualityMetric`")
        else:
            match += 1
        # validate data type: StarrSeqQualityMetric
        if not isinstance(v, StarrSeqQualityMetric):
            error_messages.append(f"Error! Input type `{type(v)}` is not `StarrSeqQualityMetric`")
        else:
            match += 1
        # validate data type: InVitroSystem
        if not isinstance(v, InVitroSystem):
            error_messages.append(f"Error! Input type `{type(v)}` is not `InVitroSystem`")
        else:
            match += 1
        # validate data type: MultiplexedSample
        if not isinstance(v, MultiplexedSample):
            error_messages.append(f"Error! Input type `{type(v)}` is not `MultiplexedSample`")
        else:
            match += 1
        # validate data type: PrimaryCell
        if not isinstance(v, PrimaryCell):
            error_messages.append(f"Error! Input type `{type(v)}` is not `PrimaryCell`")
        else:
            match += 1
        # validate data type: TechnicalSample
        if not isinstance(v, TechnicalSample):
            error_messages.append(f"Error! Input type `{type(v)}` is not `TechnicalSample`")
        else:
            match += 1
        # validate data type: Tissue
        if not isinstance(v, Tissue):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Tissue`")
        else:
            match += 1
        # validate data type: WholeOrganism
        if not isinstance(v, WholeOrganism):
            error_messages.append(f"Error! Input type `{type(v)}` is not `WholeOrganism`")
        else:
            match += 1
        # validate data type: Software
        if not isinstance(v, Software):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Software`")
        else:
            match += 1
        # validate data type: SoftwareVersion
        if not isinstance(v, SoftwareVersion):
            error_messages.append(f"Error! Input type `{type(v)}` is not `SoftwareVersion`")
        else:
            match += 1
        # validate data type: Source
        if not isinstance(v, Source):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Source`")
        else:
            match += 1
        # validate data type: Treatment
        if not isinstance(v, Treatment):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Treatment`")
        else:
            match += 1
        # validate data type: User
        if not isinstance(v, User):
            error_messages.append(f"Error! Input type `{type(v)}` is not `User`")
        else:
            match += 1
        # validate data type: Workflow
        if not isinstance(v, Workflow):
            error_messages.append(f"Error! Input type `{type(v)}` is not `Workflow`")
        else:
            match += 1
        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when setting `actual_instance` in SearchResultItem with oneOf schemas: AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when setting `actual_instance` in SearchResultItem with oneOf schemas: AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow. Details: " + ", ".join(error_messages))
        else:
            return v

    @classmethod
    def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
        return cls.from_json(json.dumps(obj))

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Returns the object represented by the json string"""
        instance = cls.model_construct()
        error_messages = []
        match = 0

        # use oneOf discriminator to lookup the data type
        _data = json.loads(json_str)
        if "@type" in _data:
            _data_type = _data.get('@type')[0]
            logging.info(f"Found {_data_type} when deserializing")
        else:
            _data_type = json.loads(json_str).get("@type")
        if not _data_type:
            raise ValueError("Failed to lookup data type from the field `@type` in the input.")

        # check if data type is `AccessKey`
        if _data_type == "AccessKey":
            instance.actual_instance = AccessKey.from_json(json_str)
            return instance

        # check if data type is `AlignmentFile`
        if _data_type == "AlignmentFile":
            instance.actual_instance = AlignmentFile.from_json(json_str)
            return instance

        # check if data type is `AnalysisSet`
        if _data_type == "AnalysisSet":
            instance.actual_instance = AnalysisSet.from_json(json_str)
            return instance

        # check if data type is `AnalysisStep`
        if _data_type == "AnalysisStep":
            instance.actual_instance = AnalysisStep.from_json(json_str)
            return instance

        # check if data type is `AnalysisStepVersion`
        if _data_type == "AnalysisStepVersion":
            instance.actual_instance = AnalysisStepVersion.from_json(json_str)
            return instance

        # check if data type is `AssayTerm`
        if _data_type == "AssayTerm":
            instance.actual_instance = AssayTerm.from_json(json_str)
            return instance

        # check if data type is `AuxiliarySet`
        if _data_type == "AuxiliarySet":
            instance.actual_instance = AuxiliarySet.from_json(json_str)
            return instance

        # check if data type is `Award`
        if _data_type == "Award":
            instance.actual_instance = Award.from_json(json_str)
            return instance

        # check if data type is `Biomarker`
        if _data_type == "Biomarker":
            instance.actual_instance = Biomarker.from_json(json_str)
            return instance

        # check if data type is `ConfigurationFile`
        if _data_type == "ConfigurationFile":
            instance.actual_instance = ConfigurationFile.from_json(json_str)
            return instance

        # check if data type is `ConstructLibrarySet`
        if _data_type == "ConstructLibrarySet":
            instance.actual_instance = ConstructLibrarySet.from_json(json_str)
            return instance

        # check if data type is `CrisprModification`
        if _data_type == "CrisprModification":
            instance.actual_instance = CrisprModification.from_json(json_str)
            return instance

        # check if data type is `CuratedSet`
        if _data_type == "CuratedSet":
            instance.actual_instance = CuratedSet.from_json(json_str)
            return instance

        # check if data type is `DegronModification`
        if _data_type == "DegronModification":
            instance.actual_instance = DegronModification.from_json(json_str)
            return instance

        # check if data type is `Document`
        if _data_type == "Document":
            instance.actual_instance = Document.from_json(json_str)
            return instance

        # check if data type is `Gene`
        if _data_type == "Gene":
            instance.actual_instance = Gene.from_json(json_str)
            return instance

        # check if data type is `GenomeBrowserAnnotationFile`
        if _data_type == "GenomeBrowserAnnotationFile":
            instance.actual_instance = GenomeBrowserAnnotationFile.from_json(json_str)
            return instance

        # check if data type is `HumanDonor`
        if _data_type == "HumanDonor":
            instance.actual_instance = HumanDonor.from_json(json_str)
            return instance

        # check if data type is `Image`
        if _data_type == "Image":
            instance.actual_instance = Image.from_json(json_str)
            return instance

        # check if data type is `ImageFile`
        if _data_type == "ImageFile":
            instance.actual_instance = ImageFile.from_json(json_str)
            return instance

        # check if data type is `InVitroSystem`
        if _data_type == "InVitroSystem":
            instance.actual_instance = InVitroSystem.from_json(json_str)
            return instance

        # check if data type is `IndexFile`
        if _data_type == "IndexFile":
            instance.actual_instance = IndexFile.from_json(json_str)
            return instance

        # check if data type is `InstitutionalCertificate`
        if _data_type == "InstitutionalCertificate":
            instance.actual_instance = InstitutionalCertificate.from_json(json_str)
            return instance

        # check if data type is `Lab`
        if _data_type == "Lab":
            instance.actual_instance = Lab.from_json(json_str)
            return instance

        # check if data type is `MatrixFile`
        if _data_type == "MatrixFile":
            instance.actual_instance = MatrixFile.from_json(json_str)
            return instance

        # check if data type is `MeasurementSet`
        if _data_type == "MeasurementSet":
            instance.actual_instance = MeasurementSet.from_json(json_str)
            return instance

        # check if data type is `ModelFile`
        if _data_type == "ModelFile":
            instance.actual_instance = ModelFile.from_json(json_str)
            return instance

        # check if data type is `ModelSet`
        if _data_type == "ModelSet":
            instance.actual_instance = ModelSet.from_json(json_str)
            return instance

        # check if data type is `MpraQualityMetric`
        if _data_type == "MpraQualityMetric":
            instance.actual_instance = MpraQualityMetric.from_json(json_str)
            return instance

        # check if data type is `MultiplexedSample`
        if _data_type == "MultiplexedSample":
            instance.actual_instance = MultiplexedSample.from_json(json_str)
            return instance

        # check if data type is `OpenReadingFrame`
        if _data_type == "OpenReadingFrame":
            instance.actual_instance = OpenReadingFrame.from_json(json_str)
            return instance

        # check if data type is `Page`
        if _data_type == "Page":
            instance.actual_instance = Page.from_json(json_str)
            return instance

        # check if data type is `PerturbSeqQualityMetric`
        if _data_type == "PerturbSeqQualityMetric":
            instance.actual_instance = PerturbSeqQualityMetric.from_json(json_str)
            return instance

        # check if data type is `PhenotypeTerm`
        if _data_type == "PhenotypeTerm":
            instance.actual_instance = PhenotypeTerm.from_json(json_str)
            return instance

        # check if data type is `PhenotypicFeature`
        if _data_type == "PhenotypicFeature":
            instance.actual_instance = PhenotypicFeature.from_json(json_str)
            return instance

        # check if data type is `PlatformTerm`
        if _data_type == "PlatformTerm":
            instance.actual_instance = PlatformTerm.from_json(json_str)
            return instance

        # check if data type is `PredictionSet`
        if _data_type == "PredictionSet":
            instance.actual_instance = PredictionSet.from_json(json_str)
            return instance

        # check if data type is `PrimaryCell`
        if _data_type == "PrimaryCell":
            instance.actual_instance = PrimaryCell.from_json(json_str)
            return instance

        # check if data type is `Publication`
        if _data_type == "Publication":
            instance.actual_instance = Publication.from_json(json_str)
            return instance

        # check if data type is `ReferenceFile`
        if _data_type == "ReferenceFile":
            instance.actual_instance = ReferenceFile.from_json(json_str)
            return instance

        # check if data type is `RodentDonor`
        if _data_type == "RodentDonor":
            instance.actual_instance = RodentDonor.from_json(json_str)
            return instance

        # check if data type is `SampleTerm`
        if _data_type == "SampleTerm":
            instance.actual_instance = SampleTerm.from_json(json_str)
            return instance

        # check if data type is `SequenceFile`
        if _data_type == "SequenceFile":
            instance.actual_instance = SequenceFile.from_json(json_str)
            return instance

        # check if data type is `SignalFile`
        if _data_type == "SignalFile":
            instance.actual_instance = SignalFile.from_json(json_str)
            return instance

        # check if data type is `SingleCellAtacSeqQualityMetric`
        if _data_type == "SingleCellAtacSeqQualityMetric":
            instance.actual_instance = SingleCellAtacSeqQualityMetric.from_json(json_str)
            return instance

        # check if data type is `SingleCellRnaSeqQualityMetric`
        if _data_type == "SingleCellRnaSeqQualityMetric":
            instance.actual_instance = SingleCellRnaSeqQualityMetric.from_json(json_str)
            return instance

        # check if data type is `Software`
        if _data_type == "Software":
            instance.actual_instance = Software.from_json(json_str)
            return instance

        # check if data type is `SoftwareVersion`
        if _data_type == "SoftwareVersion":
            instance.actual_instance = SoftwareVersion.from_json(json_str)
            return instance

        # check if data type is `Source`
        if _data_type == "Source":
            instance.actual_instance = Source.from_json(json_str)
            return instance

        # check if data type is `StarrSeqQualityMetric`
        if _data_type == "StarrSeqQualityMetric":
            instance.actual_instance = StarrSeqQualityMetric.from_json(json_str)
            return instance

        # check if data type is `TabularFile`
        if _data_type == "TabularFile":
            instance.actual_instance = TabularFile.from_json(json_str)
            return instance

        # check if data type is `TechnicalSample`
        if _data_type == "TechnicalSample":
            instance.actual_instance = TechnicalSample.from_json(json_str)
            return instance

        # check if data type is `Tissue`
        if _data_type == "Tissue":
            instance.actual_instance = Tissue.from_json(json_str)
            return instance

        # check if data type is `Treatment`
        if _data_type == "Treatment":
            instance.actual_instance = Treatment.from_json(json_str)
            return instance

        # check if data type is `User`
        if _data_type == "User":
            instance.actual_instance = User.from_json(json_str)
            return instance

        # check if data type is `WholeOrganism`
        if _data_type == "WholeOrganism":
            instance.actual_instance = WholeOrganism.from_json(json_str)
            return instance

        # check if data type is `Workflow`
        if _data_type == "Workflow":
            instance.actual_instance = Workflow.from_json(json_str)
            return instance

        # deserialize data into AccessKey
        try:
            instance.actual_instance = AccessKey.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AnalysisStep
        try:
            instance.actual_instance = AnalysisStep.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AnalysisStepVersion
        try:
            instance.actual_instance = AnalysisStepVersion.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Award
        try:
            instance.actual_instance = Award.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Biomarker
        try:
            instance.actual_instance = Biomarker.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Document
        try:
            instance.actual_instance = Document.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into HumanDonor
        try:
            instance.actual_instance = HumanDonor.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into RodentDonor
        try:
            instance.actual_instance = RodentDonor.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AlignmentFile
        try:
            instance.actual_instance = AlignmentFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ConfigurationFile
        try:
            instance.actual_instance = ConfigurationFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into GenomeBrowserAnnotationFile
        try:
            instance.actual_instance = GenomeBrowserAnnotationFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ImageFile
        try:
            instance.actual_instance = ImageFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into IndexFile
        try:
            instance.actual_instance = IndexFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into MatrixFile
        try:
            instance.actual_instance = MatrixFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ModelFile
        try:
            instance.actual_instance = ModelFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ReferenceFile
        try:
            instance.actual_instance = ReferenceFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SequenceFile
        try:
            instance.actual_instance = SequenceFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SignalFile
        try:
            instance.actual_instance = SignalFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into TabularFile
        try:
            instance.actual_instance = TabularFile.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AnalysisSet
        try:
            instance.actual_instance = AnalysisSet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AuxiliarySet
        try:
            instance.actual_instance = AuxiliarySet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ConstructLibrarySet
        try:
            instance.actual_instance = ConstructLibrarySet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CuratedSet
        try:
            instance.actual_instance = CuratedSet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into MeasurementSet
        try:
            instance.actual_instance = MeasurementSet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into ModelSet
        try:
            instance.actual_instance = ModelSet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PredictionSet
        try:
            instance.actual_instance = PredictionSet.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Gene
        try:
            instance.actual_instance = Gene.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Image
        try:
            instance.actual_instance = Image.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into InstitutionalCertificate
        try:
            instance.actual_instance = InstitutionalCertificate.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Lab
        try:
            instance.actual_instance = Lab.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into CrisprModification
        try:
            instance.actual_instance = CrisprModification.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into DegronModification
        try:
            instance.actual_instance = DegronModification.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into AssayTerm
        try:
            instance.actual_instance = AssayTerm.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PhenotypeTerm
        try:
            instance.actual_instance = PhenotypeTerm.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PlatformTerm
        try:
            instance.actual_instance = PlatformTerm.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SampleTerm
        try:
            instance.actual_instance = SampleTerm.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into OpenReadingFrame
        try:
            instance.actual_instance = OpenReadingFrame.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Page
        try:
            instance.actual_instance = Page.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PhenotypicFeature
        try:
            instance.actual_instance = PhenotypicFeature.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Publication
        try:
            instance.actual_instance = Publication.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into MpraQualityMetric
        try:
            instance.actual_instance = MpraQualityMetric.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PerturbSeqQualityMetric
        try:
            instance.actual_instance = PerturbSeqQualityMetric.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SingleCellAtacSeqQualityMetric
        try:
            instance.actual_instance = SingleCellAtacSeqQualityMetric.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SingleCellRnaSeqQualityMetric
        try:
            instance.actual_instance = SingleCellRnaSeqQualityMetric.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into StarrSeqQualityMetric
        try:
            instance.actual_instance = StarrSeqQualityMetric.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into InVitroSystem
        try:
            instance.actual_instance = InVitroSystem.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into MultiplexedSample
        try:
            instance.actual_instance = MultiplexedSample.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into PrimaryCell
        try:
            instance.actual_instance = PrimaryCell.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into TechnicalSample
        try:
            instance.actual_instance = TechnicalSample.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Tissue
        try:
            instance.actual_instance = Tissue.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into WholeOrganism
        try:
            instance.actual_instance = WholeOrganism.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Software
        try:
            instance.actual_instance = Software.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into SoftwareVersion
        try:
            instance.actual_instance = SoftwareVersion.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Source
        try:
            instance.actual_instance = Source.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Treatment
        try:
            instance.actual_instance = Treatment.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into User
        try:
            instance.actual_instance = User.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))
        # deserialize data into Workflow
        try:
            instance.actual_instance = Workflow.from_json(json_str)
            match += 1
        except (ValidationError, ValueError) as e:
            error_messages.append(str(e))

        if match > 1:
            # more than 1 match
            raise ValueError("Multiple matches found when deserializing the JSON string into SearchResultItem with oneOf schemas: AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow. Details: " + ", ".join(error_messages))
        elif match == 0:
            # no match
            raise ValueError("No match found when deserializing the JSON string into SearchResultItem with oneOf schemas: AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow. Details: " + ", ".join(error_messages))
        else:
            return instance

    def to_json(self) -> str:
        """Returns the JSON representation of the actual instance"""
        if self.actual_instance is None:
            return "null"

        if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
            return self.actual_instance.to_json()
        else:
            return json.dumps(self.actual_instance)

    def to_dict(self) -> Optional[Union[Dict[str, Any], AccessKey, AlignmentFile, AnalysisSet, AnalysisStep, AnalysisStepVersion, AssayTerm, AuxiliarySet, Award, Biomarker, ConfigurationFile, ConstructLibrarySet, CrisprModification, CuratedSet, DegronModification, Document, Gene, GenomeBrowserAnnotationFile, HumanDonor, Image, ImageFile, InVitroSystem, IndexFile, InstitutionalCertificate, Lab, MatrixFile, MeasurementSet, ModelFile, ModelSet, MpraQualityMetric, MultiplexedSample, OpenReadingFrame, Page, PerturbSeqQualityMetric, PhenotypeTerm, PhenotypicFeature, PlatformTerm, PredictionSet, PrimaryCell, Publication, ReferenceFile, RodentDonor, SampleTerm, SequenceFile, SignalFile, SingleCellAtacSeqQualityMetric, SingleCellRnaSeqQualityMetric, Software, SoftwareVersion, Source, StarrSeqQualityMetric, TabularFile, TechnicalSample, Tissue, Treatment, User, WholeOrganism, Workflow]]:
        """Returns the dict representation of the actual instance"""
        if self.actual_instance is None:
            return None

        if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
            return self.actual_instance.to_dict()
        else:
            # primitive type
            return self.actual_instance

    def to_str(self) -> str:
        """Returns the string representation of the actual instance"""
        return self.to_dict()

    def __repr_str__(self, join_str: str) -> str:
        return join_str.join(
            repr(v) if a is None else f'{a}={v!r}'
            for a, v in self.__repr_args__()
            if (True if a is None else not (a.startswith('oneof') or a.startswith('one_of') or a.startswith('discriminator_value')))
        )

    def __getattr__(self, name):
        try:
            return super().__getattribute__(name)
        except AttributeError as e:
            if hasattr(self.actual_instance, name):
                return getattr(self.actual_instance, name)
            raise e


