using System;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class Status
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private ErrorCode errorCodeField;

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

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

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

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

	public ErrorCode ErrorCode
	{
		get
		{
			return errorCodeField;
		}
		set
		{
			errorCodeField = value;
		}
	}

	[XmlAttribute("V")]
	public string Value
	{
		get
		{
			return vField;
		}
		set
		{
			vField = value;
		}
	}

	[XmlAttribute]
	public string LimitName
	{
		get
		{
			return limitNameField;
		}
		set
		{
			limitNameField = value;
		}
	}

	[XmlAttribute]
	public string LimitFile
	{
		get
		{
			return limitFileField;
		}
		set
		{
			limitFileField = value;
		}
	}

	[XmlAttribute]
	public string LimitVersion
	{
		get
		{
			return limitVersionField;
		}
		set
		{
			limitVersionField = value;
		}
	}

	public bool ShouldSerializeErrorCode()
	{
		if (ErrorCode != null)
		{
			if (!ErrorCode.ShouldSerializeError() && !ErrorCode.ShouldSerializeSubError())
			{
				return ErrorCode.ShouldSerializeDescription();
			}
			return true;
		}
		return false;
	}

	public bool ShouldSerializeValue()
	{
		return !string.IsNullOrEmpty(Value);
	}

	public bool ShouldSerializeLimitName()
	{
		return !string.IsNullOrEmpty(LimitName);
	}

	public bool ShouldSerializeLimitFile()
	{
		return !string.IsNullOrEmpty(LimitFile);
	}

	public bool ShouldSerializeLimitVersion()
	{
		return !string.IsNullOrEmpty(LimitVersion);
	}

	public Status()
	{
		errorCodeField = new ErrorCode();
		vField = string.Empty;
		limitNameField = string.Empty;
		limitFileField = string.Empty;
		limitVersionField = string.Empty;
	}

	public Status(ErrorCode errorCode = null, string v = null, string limitName = null, string limitFile = null, string limitVersion = null)
	{
		if (errorCode != null)
		{
			errorCodeField = errorCode;
		}
		else
		{
			errorCodeField = new ErrorCode();
		}
		if (!string.IsNullOrEmpty(v))
		{
			vField = v;
		}
		else
		{
			vField = string.Empty;
		}
		if (!string.IsNullOrEmpty(limitName))
		{
			limitNameField = limitName;
		}
		else
		{
			limitNameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(limitFile))
		{
			limitFileField = limitFile;
		}
		else
		{
			limitFileField = string.Empty;
		}
		if (!string.IsNullOrEmpty(limitVersion))
		{
			limitVersionField = limitVersion;
		}
		else
		{
			limitVersionField = string.Empty;
		}
	}
}
