2013-08-15 11:13:15 +02:00
|
|
|
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; }
|
|
|
|
|
|
2013-08-15 11:13:15 +02:00
|
|
|
/// <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"
|
2013-08-15 11:13:15 +02:00
|
|
|
/// </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";
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-08-15 11:13:15 +02:00
|
|
|
}
|
|
|
|
|
}
|