Files
UptimeSharp/UptimeSharp.OldClassLib/Models/Response/ResponseBase.cs
T

55 lines
1.2 KiB
C#
Raw Normal View History

using System.Runtime.Serialization;
namespace UptimeSharp.Models
{
/// <summary>
/// Base for Responses
/// </summary>
[DataContract]
internal class ResponseBase
{
2013-08-28 00:09:55 +02:00
/// <summary>
/// Gets or sets the error code.
/// </summary>
/// <value>
/// The error code.
/// </value>
[DataMember(Name = "id")]
public string ErrorCode { get; set; }
/// <summary>
/// Gets or sets the error message.
/// </summary>
/// <value>
/// The error message.
/// </value>
[DataMember(Name = "message")]
public string ErrorMessage { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="ResponseBase"/> is status.
/// </summary>
/// <value>
2013-08-18 12:08:08 +02:00
/// "ok" or "fail"
/// </value>
[DataMember(Name = "stat")]
2013-08-18 12:08:08 +02:00
public string RawStatus { get; set; }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="ResponseBase"/> is status.
/// </summary>
/// <value>
/// <c>true</c> if status is OK; otherwise, <c>false</c>.
/// </value>
[IgnoreDataMember]
public bool Status
{
get
{
return RawStatus == "ok";
}
}
}
}