namespace Azure.Iot.Operations.ProtocolCompilerLib
{
    using System.Collections.Generic;
    using System.Linq;
    using DTDLParser.Models;

    public partial class ObjectJsonSchema : ITemplateTransform
    {
        private readonly CodeName genNamespace;
        private readonly string schemaId;
        private readonly string description;
        private readonly CodeName schema;
        private readonly List<(string, string, DTSchemaInfo, bool, bool, int)> nameDescSchemaIndirectRequiredIndices;
        private readonly CodeName? sharedPrefix;
        private readonly bool setIndex;

        public ObjectJsonSchema(CodeName genNamespace, string schemaId, string description, CodeName schema, List<(string, string, DTSchemaInfo, bool, bool, int)> nameDescSchemaIndirectRequiredIndices, CodeName? sharedPrefix, bool setIndex)
        {
            this.genNamespace = genNamespace;
            this.schemaId = schemaId;
            this.description = description;
            this.schema = schema;
            this.nameDescSchemaIndirectRequiredIndices = nameDescSchemaIndirectRequiredIndices;
            this.sharedPrefix = sharedPrefix;
            this.setIndex = setIndex;
        }

        public string FileName { get => $"{this.schema.GetFileName(TargetLanguage.Independent)}.schema.json"; }

        public string FolderPath { get => this.genNamespace.GetFolderName(TargetLanguage.Independent); }
    }
}
