using System;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;

namespace StellaOps.Configuration;

public sealed class StellaOpsBootstrapOptions<TOptions>
    where TOptions : class, new()
{
    public StellaOpsBootstrapOptions()
    {
        ConfigurationOptions = new StellaOpsConfigurationOptions();
    }

    internal StellaOpsConfigurationOptions ConfigurationOptions { get; }

    public string? BasePath
    {
        get => ConfigurationOptions.BasePath;
        set => ConfigurationOptions.BasePath = value;
    }

    public bool IncludeJsonFiles
    {
        get => ConfigurationOptions.IncludeJsonFiles;
        set => ConfigurationOptions.IncludeJsonFiles = value;
    }

    public bool IncludeYamlFiles
    {
        get => ConfigurationOptions.IncludeYamlFiles;
        set => ConfigurationOptions.IncludeYamlFiles = value;
    }

    public bool IncludeEnvironmentVariables
    {
        get => ConfigurationOptions.IncludeEnvironmentVariables;
        set => ConfigurationOptions.IncludeEnvironmentVariables = value;
    }

    public string? EnvironmentPrefix
    {
        get => ConfigurationOptions.EnvironmentPrefix;
        set => ConfigurationOptions.EnvironmentPrefix = value;
    }

    public IList<JsonConfigurationFile> JsonFiles => ConfigurationOptions.JsonFiles;

    public IList<YamlConfigurationFile> YamlFiles => ConfigurationOptions.YamlFiles;

    public string? BindingSection
    {
        get => ConfigurationOptions.BindingSection;
        set => ConfigurationOptions.BindingSection = value;
    }

    public Action<IConfigurationBuilder>? ConfigureBuilder
    {
        get => ConfigurationOptions.ConfigureBuilder;
        set => ConfigurationOptions.ConfigureBuilder = value;
    }

    public Action<TOptions, IConfiguration>? PostBind { get; set; }
}
