diff --git a/UptimeSharp/Components/Monitor.cs b/UptimeSharp/Components/Monitor.cs index db30dcf..bccd1f9 100644 --- a/UptimeSharp/Components/Monitor.cs +++ b/UptimeSharp/Components/Monitor.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -124,7 +125,7 @@ namespace UptimeSharp public async Task AddMonitor( string name, string target, - Type type = Type.HTTP, + Models.Type type = Models.Type.HTTP, Subtype subtype = Subtype.Unknown, int? port = null, string keywordValue = null, @@ -211,5 +212,69 @@ namespace UptimeSharp return (await Request("editMonitor", cancellationToken, paramList)).Success; } + + + /// + /// Pause a monitor + /// + /// a specific monitor ID + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + public async Task PauseMonitor(string monitorId, CancellationToken cancellationToken = default(CancellationToken)) + { + throw new NotImplementedException("not available yet"); + } + + + /// + /// Pause a monitor + /// + /// The monitor. + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + public async Task PauseMonitor(Models.Monitor monitor, CancellationToken cancellationToken = default(CancellationToken)) + { + return await PauseMonitor(monitor.ID, cancellationToken); + } + + + /// + /// Resume a monitor + /// + /// a specific monitor ID + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + public async Task ResumeMonitor(string monitorId, CancellationToken cancellationToken = default(CancellationToken)) + { + throw new NotImplementedException("not available yet"); + } + + + /// + /// Resume a monitor + /// + /// The monitor. + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + public async Task ResumeMonitor(Models.Monitor monitor, CancellationToken cancellationToken = default(CancellationToken)) + { + return await ResumeMonitor(monitor.ID, cancellationToken); + } } } \ No newline at end of file diff --git a/UptimeSharp/IUptimeClient.cs b/UptimeSharp/IUptimeClient.cs index 814a54c..04fcd2c 100644 --- a/UptimeSharp/IUptimeClient.cs +++ b/UptimeSharp/IUptimeClient.cs @@ -126,6 +126,54 @@ namespace UptimeSharp /// /// Task ModifyMonitor(Models.Monitor monitor, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Pause a monitor + /// + /// a specific monitor ID + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + Task PauseMonitor(string monitorId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Pause a monitor + /// + /// The monitor. + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + Task PauseMonitor(Models.Monitor monitor, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Resume a monitor + /// + /// a specific monitor ID + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + Task ResumeMonitor(string monitorId, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Resume a monitor + /// + /// The monitor. + /// The cancellation token. + /// + /// Success state + /// + /// not available yet + /// + Task ResumeMonitor(Models.Monitor monitor, CancellationToken cancellationToken = default(CancellationToken)); #endregion