#ifndef EXPERIMENT_HPP_INCLUDED
#define EXPERIMENT_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/AnnotationRef.h>
#include <NBO/NBO/Denomination_Type.h>
#include <NBO/NBO/Description.h>
#include <NBO/NBO/ExperimentID_Type.h>
#include <NBO/NBO/ExperimentPurpose_Type.h>
#include <NBO/NBO/ExperimenterRef.h>
#include <NBO/NBO/HystochemistryType_Type.h>
#include <NBO/NBO/MicrobeamManipulation.h>
#include <NBO/NBO/Sample.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element Experiment.
*
* This element describes the experiment during which this Image was acquired. The optional Description element may contain free text to further describe the experiment.
*/
class NBO_EXPORT Experiment : public NBOBaseClass {

public:
	
	Experiment();
	~Experiment();

	/*!
	* \brief Cast a NBOBaseClass to a Experiment.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<Experiment> fromBase(NBOBaseClassPtr base);

	/*!
	* \brief Returns the class type name.
	*
	* \return The class type name
	*/
	std::string getTypeName() const override;

	/*!
	* \brief Returns the XML element name corresponding to this class.
	*
	* \return The XML element name
	*/
	std::string getXMLName() const override;

	/*!
	* \brief Returns the NBO Type corresponding to this class.
	*
	* \return The NBO Type value
	*/
	ENBOType getNBOType() const override;

	/*!
	* \brief Returns a list of all classes derived from this class.
	*
	* \return The list of derived classes
	*/
	std::vector<NBOBaseClassPtr> getChildren() const override;

	/*!
	* \brief Returns a list of all child elements contained in this class.
	*
	* \return The list of child classes
	*/
	std::vector<NBOBaseClassPtr> getSubElements() const override;

	/*!
	* \brief Populates this object from a JSON file.
	*
	* \param path The path to the JSON file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a JSON string.
	*
	* \param json_string The JSON content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromJsonString(const std::string& json_string, bool validate = true);

	/*!
	* \brief Populates this object from a XML file.
	*
	* \param path The path to the XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlFile(const std::string& path, bool validate = true);

	/*!
	* \brief Populates this object from a XML string.
	*
	* \param xml_string The XML content as a string
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void fromXmlString(const std::string& xml_string, bool validate = true);

	/*!
	* \brief Serializes this object to an XML file.
	*
	* \param filename The path to the output XML file
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void toXmlFile(const std::string& filename, bool validate = true) const;

	/*!
	* \brief Serializes this object to an XML string.
	*
	* \param validate If true, validates constraints on value. Default is true.
	* \return A string containing the XML representation of this object
	*/
	std::string toXmlString(bool validate = true) const;

	/*!
	* \brief Sets the value of the ID attribute.
	*
	* A unique identifier for this Experiment.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setID(const Inscoper::NBO::ExperimentID_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the ID attribute.
	*
	* A unique identifier for this Experiment.
	*
	* \return The value of the attribute
	*/
	ExperimentID_TypePtr getID() const;

	/*!
	* \brief Resets the ID attribute to an unset state.
	*
	* A unique identifier for this Experiment.
	*/
	void resetID();

	/*!
	* \brief Checks whether the optional ID attribute is present.
	*
	* A unique identifier for this Experiment.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasID() const;

	/*!
	* \brief Sets the value of the Name attribute.
	*
	* A user assigned name for this Experiment.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setName(const Inscoper::NBO::Denomination_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Name attribute.
	*
	* A user assigned name for this Experiment.
	*
	* \return The value of the attribute
	*/
	Denomination_TypePtr getName() const;

	/*!
	* \brief Resets the Name attribute to an unset state.
	*
	* A user assigned name for this Experiment.
	*/
	void resetName();

	/*!
	* \brief Checks whether the optional Name attribute is present.
	*
	* A user assigned name for this Experiment.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasName() const;

	/*!
	* \brief Sets the value of the Purpose attribute.
	*
	* This field records a term used the general purpose of the imaging experiment performed in this case.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setPurpose(const Inscoper::NBO::ExperimentPurpose_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Purpose attribute.
	*
	* This field records a term used the general purpose of the imaging experiment performed in this case.
	*
	* \return The value of the attribute
	*/
	ExperimentPurpose_TypePtr getPurpose() const;

	/*!
	* \brief Resets the Purpose attribute to an unset state.
	*
	* This field records a term used the general purpose of the imaging experiment performed in this case.
	*/
	void resetPurpose();

	/*!
	* \brief Checks whether the optional Purpose attribute is present.
	*
	* This field records a term used the general purpose of the imaging experiment performed in this case.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasPurpose() const;

	/*!
	* \brief Sets the value of the LabellingMethod attribute.
	*
	* This field records a term that describes the method used for the Labelling or Visualization of the structures (i.e. molecular components) under study in this Experiment. The use of a sub-class of the 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) term from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setLabellingMethod(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the LabellingMethod attribute.
	*
	* This field records a term that describes the method used for the Labelling or Visualization of the structures (i.e. molecular components) under study in this Experiment. The use of a sub-class of the 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) term from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return The value of the attribute
	*/
	std::string getLabellingMethod() const;

	/*!
	* \brief Resets the LabellingMethod attribute to an unset state.
	*
	* This field records a term that describes the method used for the Labelling or Visualization of the structures (i.e. molecular components) under study in this Experiment. The use of a sub-class of the 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) term from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*/
	void resetLabellingMethod();

	/*!
	* \brief Checks whether the LabellingMethod attribute is present.
	*
	* This field records a term that describes the method used for the Labelling or Visualization of the structures (i.e. molecular components) under study in this Experiment. The use of a sub-class of the 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) term from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasLabellingMethod() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* This field records a term that describes the method used for the Labelling or Visualization of the structures (i.e. molecular components) under study in this Experiment. The use of a sub-class of the 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) term from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getLabellingMethodAllowedValues();

	/*!
	* \brief Sets the value of the LabellingMethodTermAccession attribute.
	*
	* This field records the Accession ID for the term used to describe the Visualization Method (also often referred to as Labelling Method). The use of a sub-classes of 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setLabellingMethodTermAccession(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the LabellingMethodTermAccession attribute.
	*
	* This field records the Accession ID for the term used to describe the Visualization Method (also often referred to as Labelling Method). The use of a sub-classes of 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return The value of the attribute
	*/
	std::string getLabellingMethodTermAccession() const;

	/*!
	* \brief Resets the LabellingMethodTermAccession attribute to an unset state.
	*
	* This field records the Accession ID for the term used to describe the Visualization Method (also often referred to as Labelling Method). The use of a sub-classes of 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*/
	void resetLabellingMethodTermAccession();

	/*!
	* \brief Checks whether the LabellingMethodTermAccession attribute is present.
	*
	* This field records the Accession ID for the term used to describe the Visualization Method (also often referred to as Labelling Method). The use of a sub-classes of 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasLabellingMethodTermAccession() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* This field records the Accession ID for the term used to describe the Visualization Method (also often referred to as Labelling Method). The use of a sub-classes of 'Visualization Method' (http://purl.obolibrary.org/obo/FBbi_00000031) from the Biological Imaging Methods Ontology (FBbi; https://www.ebi.ac.uk/ols/ontologies/fbbi) is recommended.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getLabellingMethodTermAccessionAllowedValues();

	/*!
	* \brief Sets the value of the Tag attribute.
	*
	* This field describes small molecules, peptides or full proteins that were used as label in this Experiment. The use of a sub-class of the 'Tag' (http://purl.obolibrary.org/obo/MI_0507) term from the Molecular Interactions Controlled Vocabulary (MI; http://purl.obolibrary.org/obo/mi.owl) is recommended.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTag(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the Tag attribute.
	*
	* This field describes small molecules, peptides or full proteins that were used as label in this Experiment. The use of a sub-class of the 'Tag' (http://purl.obolibrary.org/obo/MI_0507) term from the Molecular Interactions Controlled Vocabulary (MI; http://purl.obolibrary.org/obo/mi.owl) is recommended.
	*
	* \return The value of the attribute
	*/
	std::string getTag() const;

	/*!
	* \brief Resets the Tag attribute to an unset state.
	*
	* This field describes small molecules, peptides or full proteins that were used as label in this Experiment. The use of a sub-class of the 'Tag' (http://purl.obolibrary.org/obo/MI_0507) term from the Molecular Interactions Controlled Vocabulary (MI; http://purl.obolibrary.org/obo/mi.owl) is recommended.
	*/
	void resetTag();

	/*!
	* \brief Checks whether the Tag attribute is present.
	*
	* This field describes small molecules, peptides or full proteins that were used as label in this Experiment. The use of a sub-class of the 'Tag' (http://purl.obolibrary.org/obo/MI_0507) term from the Molecular Interactions Controlled Vocabulary (MI; http://purl.obolibrary.org/obo/mi.owl) is recommended.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTag() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* This field describes small molecules, peptides or full proteins that were used as label in this Experiment. The use of a sub-class of the 'Tag' (http://purl.obolibrary.org/obo/MI_0507) term from the Molecular Interactions Controlled Vocabulary (MI; http://purl.obolibrary.org/obo/mi.owl) is recommended.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getTagAllowedValues();

	/*!
	* \brief Sets the value of the TagTermAccession attribute.
	*
	* This records the Accession ID for the term used to describe the Tag used in this Experiment. The use of a sub-class of http://purl.obolibrary.org/obo/MI_0507 is recommended.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTagTermAccession(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the TagTermAccession attribute.
	*
	* This records the Accession ID for the term used to describe the Tag used in this Experiment. The use of a sub-class of http://purl.obolibrary.org/obo/MI_0507 is recommended.
	*
	* \return The value of the attribute
	*/
	std::string getTagTermAccession() const;

	/*!
	* \brief Resets the TagTermAccession attribute to an unset state.
	*
	* This records the Accession ID for the term used to describe the Tag used in this Experiment. The use of a sub-class of http://purl.obolibrary.org/obo/MI_0507 is recommended.
	*/
	void resetTagTermAccession();

	/*!
	* \brief Checks whether the TagTermAccession attribute is present.
	*
	* This records the Accession ID for the term used to describe the Tag used in this Experiment. The use of a sub-class of http://purl.obolibrary.org/obo/MI_0507 is recommended.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTagTermAccession() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* This records the Accession ID for the term used to describe the Tag used in this Experiment. The use of a sub-class of http://purl.obolibrary.org/obo/MI_0507 is recommended.
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getTagTermAccessionAllowedValues();

	/*!
	* \brief Sets the value of the HystochemistryType attribute.
	*
	* This field records a term that describes the general category of Histochemistry staining used in this case.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setHystochemistryType(const Inscoper::NBO::HystochemistryType_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the HystochemistryType attribute.
	*
	* This field records a term that describes the general category of Histochemistry staining used in this case.
	*
	* \return The value of the attribute
	*/
	HystochemistryType_TypePtr getHystochemistryType() const;

	/*!
	* \brief Resets the HystochemistryType attribute to an unset state.
	*
	* This field records a term that describes the general category of Histochemistry staining used in this case.
	*/
	void resetHystochemistryType();

	/*!
	* \brief Checks whether the optional HystochemistryType attribute is present.
	*
	* This field records a term that describes the general category of Histochemistry staining used in this case.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasHystochemistryType() const;

	/*!
	* \brief Sets the list of ExperimenterRef elements.
	*
	* This empty element refers to the Scientist (i.e., Experimenter) that performed this experiment.
	*
	* \param value The new list of ExperimenterRef elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setExperimenterRef_List(const std::vector<Inscoper::NBO::ExperimenterRefPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of ExperimenterRef elements.
	*
	* This empty element refers to the Scientist (i.e., Experimenter) that performed this experiment.
	*
	* \return The list of ExperimenterRef elements
	*/
	std::vector<Inscoper::NBO::ExperimenterRefPtr> getExperimenterRef_List() const;

	/*!
	* \brief Adds a new ExperimenterRef element to this object.
	*
	* This empty element refers to the Scientist (i.e., Experimenter) that performed this experiment.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToExperimenterRef_List(const Inscoper::NBO::ExperimenterRefPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of ExperimenterRef.
	*
	* This empty element refers to the Scientist (i.e., Experimenter) that performed this experiment.
	*/
	void clearExperimenterRef_List();

	/*!
	* \brief Sets the list of Sample elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of Sample elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setSample_List(const std::vector<Inscoper::NBO::SamplePtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of Sample elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of Sample elements
	*/
	std::vector<Inscoper::NBO::SamplePtr> getSample_List() const;

	/*!
	* \brief Adds a new Sample element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToSample_List(const Inscoper::NBO::SamplePtr& value, bool validate = true);

	/*!
	* \brief Clear the list of Sample.
	*
	* No description available in the XSD standard.
	*/
	void clearSample_List();

	/*!
	* \brief Sets the list of MicrobeamManipulation elements.
	*
	* No description available in the XSD standard.
	*
	* \param value The new list of MicrobeamManipulation elements
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMicrobeamManipulation_List(const std::vector<Inscoper::NBO::MicrobeamManipulationPtr>& value, bool validate = true);

	/*!
	* \brief Returns the list of MicrobeamManipulation elements.
	*
	* No description available in the XSD standard.
	*
	* \return The list of MicrobeamManipulation elements
	*/
	std::vector<Inscoper::NBO::MicrobeamManipulationPtr> getMicrobeamManipulation_List() const;

	/*!
	* \brief Adds a new MicrobeamManipulation element to this object.
	*
	* No description available in the XSD standard.
	*
	* \param value The element to add
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void addToMicrobeamManipulation_List(const Inscoper::NBO::MicrobeamManipulationPtr& value, bool validate = true);

	/*!
	* \brief Clear the list of MicrobeamManipulation.
	*
	* No description available in the XSD standard.
	*/
	void clearMicrobeamManipulation_List();

	/*!
	* \brief Sets the value of the Description element.
	*
	* No description available in the XSD standard.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setDescription(const Inscoper::NBO::DescriptionPtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Description element.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::DescriptionPtr getDescription() const;

	/*!
	* \brief Resets the Description element to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetDescription();

	/*!
	* \brief Checks whether the optional Description element is present.
	*
	* No description available in the XSD standard.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasDescription() const;

	/*!
	* \brief Sets the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAnnotationRef(const Inscoper::NBO::AnnotationRefPtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the AnnotationRef element.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::AnnotationRefPtr getAnnotationRef() const;

	/*!
	* \brief Resets the AnnotationRef element to an unset state.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*/
	void resetAnnotationRef();

	/*!
	* \brief Checks whether the optional AnnotationRef element is present.
	*
	* This is a simple multi-line comment or annotation describing this component.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasAnnotationRef() const;


private:
	class Impl;
	std::unique_ptr<Impl> pImpl;

	ExperimentID_TypePtr ID = nullptr; // Required attribute
	Denomination_TypePtr Name = nullptr; // Optional attribute
	ExperimentPurpose_TypePtr Purpose = nullptr; // Required attribute
    std::optional<std::string> LabellingMethod; // Required attribute
    static const std::set<std::string> LabellingMethodAllowedValues;
    std::optional<std::string> LabellingMethodTermAccession; // Optional attribute
    static const std::set<std::string> LabellingMethodTermAccessionAllowedValues;
    std::optional<std::string> Tag; // Optional attribute
    static const std::set<std::string> TagAllowedValues;
    std::optional<std::string> TagTermAccession; // Optional attribute
    static const std::set<std::string> TagTermAccessionAllowedValues;
	HystochemistryType_TypePtr HystochemistryType = nullptr; // Optional attribute
    std::vector<Inscoper::NBO::ExperimenterRefPtr> ExperimenterRef_List;
    std::vector<Inscoper::NBO::SamplePtr> Sample_List;
    std::vector<Inscoper::NBO::MicrobeamManipulationPtr> MicrobeamManipulation_List;
    Inscoper::NBO::DescriptionPtr Description = nullptr;
    Inscoper::NBO::AnnotationRefPtr AnnotationRef = nullptr;
};

/*! Shared pointer for Experiment*/
typedef std::shared_ptr<Experiment> ExperimentPtr;

} // namespace Inscoper::NBO

#endif // EXPERIMENT_HPP_INCLUDED