using System.Text.Json.Serialization;

namespace MarcusLaw.OutlookAddin.Core.Models
{
    /// <summary>
    /// One row from GET /NetworkStorage/folderContents — folder or file.
    /// </summary>
    public sealed class NetworkStorageItem
    {
        [JsonPropertyName("name")]
        public string Name { get; set; } = string.Empty;

        [JsonPropertyName("path")]
        public string Path { get; set; } = string.Empty;

        [JsonPropertyName("type")]
        public string Type { get; set; } = string.Empty;  // "folder" or "file"

        [JsonPropertyName("size")]
        public long Size { get; set; }

        [JsonPropertyName("modified")]
        public string? Modified { get; set; }

        public bool IsFolder => string.Equals(Type, "folder", System.StringComparison.OrdinalIgnoreCase);
    }
}
