using FluentValidation; namespace Azaion.Common.Requests; public class PublishResourceRequest { public string ResourceName { get; set; } = null!; public string DevStage { get; set; } = null!; public string Architecture { get; set; } = null!; public string Version { get; set; } = null!; public string CdnUrl { get; set; } = null!; public string Sha256 { get; set; } = null!; public string EncryptionKey { get; set; } = null!; public long SizeBytes { get; set; } } public class PublishResourceValidator : AbstractValidator { public PublishResourceValidator() { RuleFor(r => r.ResourceName).NotEmpty().MaximumLength(120); RuleFor(r => r.DevStage).NotEmpty().MaximumLength(40); RuleFor(r => r.Architecture).NotEmpty().MaximumLength(40); RuleFor(r => r.Version).NotEmpty().MaximumLength(40); RuleFor(r => r.CdnUrl).NotEmpty().MaximumLength(500); RuleFor(r => r.Sha256).NotEmpty().MaximumLength(128); RuleFor(r => r.EncryptionKey).NotEmpty(); RuleFor(r => r.SizeBytes).GreaterThan(0); } }