using System; namespace Kreta.Client.FileService.Response { public class FileUploadResponse : IResponse { public FileUploadResponse() { } public FileUploadResponse(bool tryAgain) { TryAgain = tryAgain; } public FileUploadResponse(string error) { if (string.IsNullOrWhiteSpace(error)) { throw new ArgumentNullException(nameof(error)); } Error = error; } public FileUploadResponse(Guid fajlAzonosito, string utvonal, int fajlMeretByteLength) { if (fajlAzonosito == Guid.Empty) { throw new ArgumentException(nameof(fajlAzonosito)); } if (string.IsNullOrWhiteSpace(utvonal)) { throw new ArgumentNullException(nameof(utvonal)); } if (fajlMeretByteLength < 1) { throw new ArgumentOutOfRangeException(nameof(fajlMeretByteLength)); } IsSuccess = true; FajlAzonosito = fajlAzonosito; Utvonal = utvonal; FajlMeretByteLength = fajlMeretByteLength; } public bool IsSuccess { get; } public Guid FajlAzonosito { get; } public string Utvonal { get; } public int FajlMeretByteLength; public string Error { get; } public bool TryAgain { get; } } }