using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class DataSet
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private Input inputsField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private Output outputsField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private List<DataSetReference> dsRefField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string idField;

	[XmlElement("Inputs")]
	public Input Input
	{
		get
		{
			return inputsField;
		}
		set
		{
			inputsField = value;
		}
	}

	[XmlElement("Outputs")]
	public Output Output
	{
		get
		{
			return outputsField;
		}
		set
		{
			outputsField = value;
		}
	}

	[XmlElement("DsRef")]
	public List<DataSetReference> DataSetReferences
	{
		get
		{
			return dsRefField;
		}
		set
		{
			dsRefField = value;
		}
	}

	[XmlAttribute]
	public string Id
	{
		get
		{
			return idField;
		}
		set
		{
			idField = value;
		}
	}

	public bool ShouldSerializeInput()
	{
		if (Input != null)
		{
			if (!Input.ShouldSerializeInputs())
			{
				return Input.ShouldSerializeArrayInputs();
			}
			return true;
		}
		return false;
	}

	public bool ShouldSerializeOutput()
	{
		if (Output != null)
		{
			if (!Output.ShouldSerializeOutputs())
			{
				return Output.ShouldSerializeArrayOutputs();
			}
			return true;
		}
		return false;
	}

	public bool ShouldSerializeDataSetReferences()
	{
		if (DataSetReferences != null)
		{
			return DataSetReferences.Count > 0;
		}
		return false;
	}

	public bool ShouldSerializeId()
	{
		return !string.IsNullOrEmpty(Id);
	}

	public DataSet()
	{
		inputsField = new Input();
		outputsField = new Output();
		dsRefField = new List<DataSetReference>();
	}

	public DataSet(Input inputs = null, Output outputs = null, List<DataSetReference> dsRef = null)
	{
		if (inputs != null)
		{
			inputsField = inputs;
		}
		else
		{
			inputsField = new Input();
		}
		if (outputs != null)
		{
			outputsField = outputs;
		}
		else
		{
			outputsField = new Output();
		}
		if (dsRef != null)
		{
			dsRefField = dsRef;
		}
		else
		{
			dsRefField = new List<DataSetReference>();
		}
	}
}
