using FluentValidation;
namespace Azaion.Common.Requests;
public class GetUpdateRequest
{
public string Architecture { get; set; } = null!;
public string DevStage { get; set; } = null!;
///
/// Map of resource_name → currently-installed-version. Resources missing
/// from the map are treated as "device has no version of this resource yet" and
/// will be returned in the response if any version exists server-side.
///
public Dictionary CurrentVersions { get; set; } = new();
}
public class GetUpdateValidator : AbstractValidator
{
public GetUpdateValidator()
{
RuleFor(r => r.Architecture).NotEmpty().MaximumLength(40);
RuleFor(r => r.DevStage).NotEmpty().MaximumLength(40);
}
}
public class ResourceUpdateItem
{
public string ResourceName { 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; }
}