#nullable enable using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; using static System.Text.Json.Serialization.JsonNumberHandling; namespace Bit.Core.Tools.Models.Data; /// /// A file secret being sent. /// public class SendFileData : SendData { /// /// Instantiates a . /// public SendFileData() { } /// /// Attached file name. /// User-provided private notes of the send. /// Attached file name. public SendFileData(string name, string? notes, string fileName) : base(name, notes) { FileName = fileName; } /// /// Size of the attached file in bytes. /// /// /// Serialized as a string since JSON (or Javascript) doesn't support /// full precision for long numbers /// [JsonNumberHandling(WriteAsString | AllowReadingFromString)] public long Size { get; set; } /// /// Uniquely identifies an uploaded file. /// /// /// Should contain only when a file /// upload is pending. Should never contain null once the /// file upload completes. /// [DisallowNull] public string? Id { get; set; } /// /// Attached file name. /// /// /// Should contain a non-empty string once the file upload completes. /// public string FileName { get; set; } = string.Empty; /// /// When true the uploaded file's length was confirmed within /// the expected tolerance and below the maximum supported /// file size. /// public bool Validated { get; set; } = true; }