#ifndef IMAGINGENVIRONMENT_HPP_INCLUDED
#define IMAGINGENVIRONMENT_HPP_INCLUDED

#include <iostream>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
#include <NBO/NBO/Description.h>
#include <NBO/NBO/EnvironmentalControlDeviceID_Type.h>
#include <NBO/NBO/Map_Type.h>
#include <NBO/NBO/PercentFraction_Type.h>
#include <NBO/NBO/UnitsPressure_Type.h>
#include <NBO/NBO/UnitsTemperature_Type.h>
#include <NBO/NBO/ENBOType.h>
#include <NBO/NBOGlobal.h>
#include <NBO/Shared/Base/NBOBaseClass.h>


namespace Inscoper::NBO {

/*!
* \brief Represents the XML element ImagingEnvironment.
*
* This element describes the environment in which the biological sample was maintained during the Acquisition of this Image.
*/
class NBO_EXPORT ImagingEnvironment : public NBOBaseClass {

public:
	
	ImagingEnvironment();
	~ImagingEnvironment();

	/*!
	* \brief Cast a NBOBaseClass to a ImagingEnvironment.
	*
	* \param base The base class to cast
	* \return The casted element, or nullptr if the cast fails
	*/
	static std::shared_ptr<ImagingEnvironment> 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.
	*
	* This is the Unique Identifier of the Environmental Control Device used in this case.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setID(const Inscoper::NBO::EnvironmentalControlDeviceID_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the ID attribute.
	*
	* This is the Unique Identifier of the Environmental Control Device used in this case.
	*
	* \return The value of the attribute
	*/
	EnvironmentalControlDeviceID_TypePtr getID() const;

	/*!
	* \brief Resets the ID attribute to an unset state.
	*
	* This is the Unique Identifier of the Environmental Control Device used in this case.
	*/
	void resetID();

	/*!
	* \brief Checks whether the optional ID attribute is present.
	*
	* This is the Unique Identifier of the Environmental Control Device used in this case.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasID() const;

	/*!
	* \brief Sets the value of the Temperature attribute.
	*
	* The field records the Temperature at which this Image Acquisition was performed. Allowed values include a number or the phrase "Room Temperature".
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setTemperature(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the Temperature attribute.
	*
	* The field records the Temperature at which this Image Acquisition was performed. Allowed values include a number or the phrase "Room Temperature".
	*
	* \return The value of the attribute
	*/
	std::string getTemperature() const;

	/*!
	* \brief Resets the Temperature attribute to an unset state.
	*
	* The field records the Temperature at which this Image Acquisition was performed. Allowed values include a number or the phrase "Room Temperature".
	*/
	void resetTemperature();

	/*!
	* \brief Checks whether the Temperature attribute is present.
	*
	* The field records the Temperature at which this Image Acquisition was performed. Allowed values include a number or the phrase "Room Temperature".
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasTemperature() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* The field records the Temperature at which this Image Acquisition was performed. Allowed values include a number or the phrase "Room Temperature".
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getTemperatureAllowedValues();

	/*!
	* \brief Sets the value of the TemperatureUnit attribute.
	*
	* 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 setTemperatureUnit(const Inscoper::NBO::UnitsTemperature_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the TemperatureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsTemperature_TypePtr getTemperatureUnit() const;

	/*!
	* \brief Resets the TemperatureUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetTemperatureUnit();

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

	/*!
	* \brief Sets the value of the CO2Percent attribute.
	*
	* The field records the Carbon Dioxide concentration (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Conditions".
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setCO2Percent(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the CO2Percent attribute.
	*
	* The field records the Carbon Dioxide concentration (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Conditions".
	*
	* \return The value of the attribute
	*/
	std::string getCO2Percent() const;

	/*!
	* \brief Resets the CO2Percent attribute to an unset state.
	*
	* The field records the Carbon Dioxide concentration (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Conditions".
	*/
	void resetCO2Percent();

	/*!
	* \brief Checks whether the CO2Percent attribute is present.
	*
	* The field records the Carbon Dioxide concentration (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Conditions".
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasCO2Percent() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* The field records the Carbon Dioxide concentration (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Conditions".
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getCO2PercentAllowedValues();

	/*!
	* \brief Sets the value of the Humidity attribute.
	*
	* The field records the Humidity (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Humidity".
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setHumidity(const std::string& value, bool validate = true);

	/*!
	* \brief Returns the value of the Humidity attribute.
	*
	* The field records the Humidity (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Humidity".
	*
	* \return The value of the attribute
	*/
	std::string getHumidity() const;

	/*!
	* \brief Resets the Humidity attribute to an unset state.
	*
	* The field records the Humidity (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Humidity".
	*/
	void resetHumidity();

	/*!
	* \brief Checks whether the Humidity attribute is present.
	*
	* The field records the Humidity (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Humidity".
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasHumidity() const;

	/*!
	* \brief Returns the allowed values for this attribut.
	*
	* The field records the Humidity (expressed as a % value) at which this Image Acquisition was performed. Allowed values include a number or the phrase "Ambient Humidity".
	*
	* \return The list of allowed values
	*/
	static const std::set<std::string>& getHumidityAllowedValues();

	/*!
	* \brief Sets the value of the AirPressure attribute.
	*
	* The field records the AirPressure the Acquisition of this Image was performed at.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setAirPressure(const float& value, bool validate = true);

	/*!
	* \brief Returns the value of the AirPressure attribute.
	*
	* The field records the AirPressure the Acquisition of this Image was performed at.
	*
	* \return The value of the attribute
	*/
	float getAirPressure() const;

	/*!
	* \brief Resets the AirPressure attribute to an unset state.
	*
	* The field records the AirPressure the Acquisition of this Image was performed at.
	*/
	void resetAirPressure();

	/*!
	* \brief Checks whether the AirPressure attribute is present.
	*
	* The field records the AirPressure the Acquisition of this Image was performed at.
	*
	* \return true if the attribute has been set, false otherwise
	*/
	bool hasAirPressure() const;

	/*!
	* \brief Sets the value of the AirPressureUnit attribute.
	*
	* 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 setAirPressureUnit(const Inscoper::NBO::UnitsPressure_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the AirPressureUnit attribute.
	*
	* No description available in the XSD standard.
	*
	* \return The value of the attribute
	*/
	UnitsPressure_TypePtr getAirPressureUnit() const;

	/*!
	* \brief Resets the AirPressureUnit attribute to an unset state.
	*
	* No description available in the XSD standard.
	*/
	void resetAirPressureUnit();

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

	/*!
	* \brief Sets the value of the O2Percent attribute.
	*
	* This field records the Oxygen concentration around the sample [units:none] during the Acquisition of this Image. Expressed as a percentage fraction as a value from 0.0 to 1.0.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setO2Percent(const Inscoper::NBO::PercentFraction_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the O2Percent attribute.
	*
	* This field records the Oxygen concentration around the sample [units:none] during the Acquisition of this Image. Expressed as a percentage fraction as a value from 0.0 to 1.0.
	*
	* \return The value of the attribute
	*/
	PercentFraction_TypePtr getO2Percent() const;

	/*!
	* \brief Resets the O2Percent attribute to an unset state.
	*
	* This field records the Oxygen concentration around the sample [units:none] during the Acquisition of this Image. Expressed as a percentage fraction as a value from 0.0 to 1.0.
	*/
	void resetO2Percent();

	/*!
	* \brief Checks whether the optional O2Percent attribute is present.
	*
	* This field records the Oxygen concentration around the sample [units:none] during the Acquisition of this Image. Expressed as a percentage fraction as a value from 0.0 to 1.0.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasO2Percent() const;

	/*!
	* \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 Map element.
	*
	* This is a Mapping of Key/Value pairs.
	*
	* \param value The value to set
	* \param validate If true, validates constraints on value. Default is true.
	*/
	void setMap(const Inscoper::NBO::Map_TypePtr& value, bool validate = true);

	/*!
	* \brief Returns the value of the Map element.
	*
	* This is a Mapping of Key/Value pairs.
	*
	* \return The value of the element
	*/
	Inscoper::NBO::Map_TypePtr getMap() const;

	/*!
	* \brief Resets the Map element to an unset state.
	*
	* This is a Mapping of Key/Value pairs.
	*/
	void resetMap();

	/*!
	* \brief Checks whether the optional Map element is present.
	*
	* This is a Mapping of Key/Value pairs.
	*
	* \return true if the optional attribute has been set, false otherwise
	*/
	bool hasMap() const;


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

	EnvironmentalControlDeviceID_TypePtr ID = nullptr; // Optional attribute
    std::optional<std::string> Temperature; // Required attribute
    static const std::set<std::string> TemperatureAllowedValues;
	UnitsTemperature_TypePtr TemperatureUnit = nullptr; // Optional attribute
    std::optional<std::string> CO2Percent; // Required attribute
    static const std::set<std::string> CO2PercentAllowedValues;
    std::optional<std::string> Humidity; // Required attribute
    static const std::set<std::string> HumidityAllowedValues;
    std::optional<float> AirPressure; // Optional attribute
	UnitsPressure_TypePtr AirPressureUnit = nullptr; // Optional attribute
	PercentFraction_TypePtr O2Percent = nullptr; // Optional attribute
    Inscoper::NBO::DescriptionPtr Description = nullptr;
    Inscoper::NBO::Map_TypePtr Map = nullptr;
};

/*! Shared pointer for ImagingEnvironment*/
typedef std::shared_ptr<ImagingEnvironment> ImagingEnvironmentPtr;

} // namespace Inscoper::NBO

#endif // IMAGINGENVIRONMENT_HPP_INCLUDED