// Created with MonoDevelop
//
//    Copyright (C) 2024 Hiperscan GmbH Dresden, Germany
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Runtime.Serialization;

namespace Hiperscan.AnalysisModule.Authentification
{
    [DataContract]
    [Serializable]
    public class AuthentificationSet
    {
        public const string NO_SUBSTANCE = "NO_SUBSTANCE";

        public AuthentificationSet()
        {
            this.Serial = null;
            this.ModelClassName = string.Empty;
            this.SubstanceId = AuthentificationSet.NO_SUBSTANCE;
            this.AccessDatabase = null;
            this.IsValidationMode = false;
        }

        public override string ToString()
        {
            string info = "AuthentificationSet:\n";

            info += String.Format(" => Serial          : {0}\n", this.Serial);
            info += String.Format(" => ModelClassName  : {0}\n", this.ModelClassName);
            info += String.Format(" => SubstanceId     : {0}\n", this.SubstanceId);
            info += String.Format(" => IsValidationMode: {0}\n", this.IsValidationMode);

            string[] tmp = this.AccessDatabase.ToString().Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
            info += " => " + tmp[0] + "\n";
            for (int i = 1; i < tmp.Length; i++)
                info += "    " + tmp[i] + "\n";

            return info;
        }

        [DataMember] public string Serial { get; set; }
        [DataMember] public string ModelClassName { get; set; }
        [DataMember] public string SubstanceId { get; set; }
        [DataMember] public AccessDatabaseInfo AccessDatabase { get; set; }
        [DataMember] public bool IsValidationMode { get; set; }
    }
}
