46 lines
1 KiB
C#
46 lines
1 KiB
C#
using System;
|
|
|
|
namespace Kreta.Client.FileService.Response
|
|
{
|
|
public class GetUrlResponse : IResponse
|
|
{
|
|
public GetUrlResponse() { }
|
|
|
|
public GetUrlResponse(bool tryAgain)
|
|
{
|
|
TryAgain = tryAgain;
|
|
}
|
|
|
|
public GetUrlResponse(string error)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(error))
|
|
{
|
|
throw new ArgumentNullException(nameof(error));
|
|
}
|
|
|
|
Error = error;
|
|
}
|
|
|
|
internal static GetUrlResponse GetUrlResponseWithUrl(string url)
|
|
{
|
|
if (string.IsNullOrWhiteSpace(url))
|
|
{
|
|
throw new ArgumentNullException(nameof(url));
|
|
}
|
|
|
|
return new GetUrlResponse
|
|
{
|
|
IsSuccess = true,
|
|
Url = url,
|
|
};
|
|
}
|
|
|
|
public bool IsSuccess { get; private set; }
|
|
|
|
public string Url { get; private set; }
|
|
|
|
public string Error { get; }
|
|
|
|
public bool TryAgain { get; }
|
|
}
|
|
}
|