using PrivaPub.ClientModels.Resources; using System.ComponentModel.DataAnnotations; namespace PrivaPub.ClientModels.Admin { public class DomainBlockForm { [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)), StringLength(253, MinimumLength = 3, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource))] public string Domain { get; set; } public bool Suspend { get; set; } = true; public bool RejectMedia { get; set; } // listed at /api/v1/instance/domain_blocks (off by default: it tells the blocked server, and everyone, of the block) public bool Published { get; set; } = false; public bool Obfuscate { get; set; } = false;//listed with part of its name hidden [StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))] public string PublicComment { get; set; } [StringLength(1000, ErrorMessageResourceName = "MaxLengthString", ErrorMessageResourceType = typeof(ErrorsResource))] public string PrivateComment { get; set; } } public class ViewDomainBlock { public string Id { get; set; } public string Domain { get; set; } public string Severity { get; set; } public bool RejectMedia { get; set; } public string PublicComment { get; set; } public string PrivateComment { get; set; } public bool Published { get; set; } = false; public bool Obfuscate { get; set; } = false; public DateTime CreatedAt { get; set; } } }