implement main alert query

This commit is contained in:
2014-01-12 22:06:48 +01:00
parent 7c922fc53b
commit 8363a78ef4
3 changed files with 22 additions and 1 deletions
+6
View File
@@ -86,8 +86,14 @@ namespace UptimeSharp
/// <param name="alertID">The alert ID.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns></returns>
/// <exception cref="UptimeSharpException">Can't delete main alert</exception>
public async Task<bool> DeleteAlert(string alertID, CancellationToken cancellationToken = default(CancellationToken))
{
if (alertID.StartsWith("0"))
{
throw new UptimeSharpException("Can't delete main alert");
}
DefaultResponse response = await Request<DefaultResponse>("deleteAlertContact", cancellationToken, new Dictionary<string, string>()
{
{ "alertContactID", alertID }
+15
View File
@@ -47,6 +47,21 @@ namespace UptimeSharp.Models
/// </value>
[JsonProperty("value")]
public string Value { get; set; }
/// <summary>
/// Gets a value indicating whether [is main alert].
/// </summary>
/// <value>
/// <c>true</c> if [is main alert]; otherwise, <c>false</c>.
/// </value>
[JsonIgnore]
public bool IsMainAlert
{
get
{
return ID.StartsWith("0");
}
}
}
+1 -1
View File
@@ -68,7 +68,7 @@
<HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\portable-net40+sl4+wp7+win8\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="PropertyChanged">
<HintPath>..\packages\PropertyChanged.Fody.1.43.0.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
<HintPath>..\packages\PropertyChanged.Fody.1.43.1.0\Lib\portable-net4+sl4+wp7+win8+MonoAndroid16+MonoTouch40\PropertyChanged.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.IO">