piwigodotnet/PiwigoDotnet/Piwigo.Client/Contract/PiwigoResponse.cs

24 lines
519 B
C#

using Newtonsoft.Json;
namespace Piwigo.Client.Contract;
public class PiwigoResponse
{
[JsonIgnore]
public bool IsOk => Status is not null && Status.ToLower().Equals("ok");
[JsonProperty("stat")]
public string? Status { get; init; }
[JsonProperty("err")]
public int? Error { get; init; }
[JsonProperty("message")]
public string? Message { get; init; }
}
public class PiwigoResponse<T> : PiwigoResponse
{
[JsonProperty("result")]
public T Result { get; init; } = default!;
}