using System.Text.Json.Serialization; using AIStudio.Settings.DataModel; namespace AIStudio.Settings; /// /// The common interface for all data sources. /// [JsonPolymorphic(TypeDiscriminatorPropertyName = "$type_discriminator")] [JsonDerivedType(typeof(DataSourceLocalDirectory), nameof(DataSourceType.LOCAL_DIRECTORY))] [JsonDerivedType(typeof(DataSourceLocalFile), nameof(DataSourceType.LOCAL_FILE))] [JsonDerivedType(typeof(DataSourceERI_V1), nameof(DataSourceType.ERI_V1))] public interface IDataSource { /// /// The number of the data source. /// public uint Num { get; init; } /// /// The unique identifier of the data source. /// public string Id { get; init; } /// /// The name of the data source. /// public string Name { get; init; } /// /// Which type of data source is this? /// public DataSourceType Type { get; init; } }