implement main alert query
This commit is contained in:
@@ -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 }
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user