using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core.Models.Editors;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models
{
///
/// A model that represents uploading a local package
///
[DataContract(Name = "localPackageInstallModel")]
public class LocalPackageInstallModel : PackageInstallModel, IHaveUploadedFiles, INotificationModel
{
public List UploadedFiles { get; } = new List();
[DataMember(Name = "notifications")]
public List Notifications { get; } = new List();
///
/// A flag to determine if this package is compatible to be installed
///
[DataMember(Name = "isCompatible")]
public bool IsCompatible { get; set; }
///
/// The minimum umbraco version that this package is pinned to
///
[DataMember(Name = "umbracoVersion")]
public string UmbracoVersion { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "url")]
public string Url { get; set; }
[DataMember(Name = "version")]
public string Version { get; set; }
///
/// If this is not null then it means the package is being from this version
///
[DataMember(Name = "originalVersion")]
public string OriginalVersion { get; set; }
[DataMember(Name = "containsUnsecureFiles")]
public bool ContainsUnsecureFiles { get; set; }
[DataMember(Name = "containsTemplateConflicts")]
public bool ContainsTemplateConflicts => ConflictingTemplateAliases != null && ConflictingTemplateAliases.Count > 0;
[DataMember(Name = "containsStyleSheetConflicts")]
public bool ContainsStyleSheetConflicts => ConflictingStyleSheetNames != null && ConflictingStyleSheetNames.Count > 0;
[DataMember(Name = "containsMacroConflict")]
public bool ContainsMacroConflict => ConflictingMacroAliases != null && ConflictingMacroAliases.Count > 0;
///
/// Key value of name + alias
///
[DataMember(Name = "conflictingTemplateAliases")]
public IDictionary ConflictingTemplateAliases { get; set; }
///
/// Key value of name + alias
///
[DataMember(Name = "conflictingStyleSheetNames")]
public IDictionary ConflictingStyleSheetNames { get; set; }
///
/// Key value of name + alias
///
[DataMember(Name = "conflictingMacroAliases")]
public IDictionary ConflictingMacroAliases { get; set; }
[DataMember(Name = "readme")]
public string Readme { get; set; }
[DataMember(Name = "licenseUrl")]
public string LicenseUrl { get; set; }
[DataMember(Name = "license")]
public string License { get; set; }
[DataMember(Name = "authorUrl")]
public string AuthorUrl { get; set; }
[DataMember(Name = "author")]
public string Author { get; set; }
[DataMember(Name = "contributors")]
public IList Contributors { get; set; }
[DataMember(Name = "iconUrl")]
public string IconUrl { get; set; }
}
}