namespace AzureRestApi.Models.Resources
{
    public class Resource
    {
        public string? id { get; set; }
        public string? name { get; set; }
        public string? type { get; set; }
        public string? location { get; set; }
        public string? createdTime { get; set; }
        public string? changedTime { get; set; }
        public Dictionary<string, string> tags { get; set; } = new Dictionary<string, string>();

        public string? CreatedOn
        {
            get
            {
                if (string.IsNullOrWhiteSpace(createdTime))
                {
                    return changedTime;
                }
                else
                {
                    return createdTime;
                }
            }
        }
    }
}
