diff --git a/UptimeSharp/Components/Monitor.cs b/UptimeSharp/Components/Monitor.cs index 98e80b0..db30dcf 100644 --- a/UptimeSharp/Components/Monitor.cs +++ b/UptimeSharp/Components/Monitor.cs @@ -16,8 +16,9 @@ namespace UptimeSharp /// Retrieves specified monitors from UptimeRobot /// /// The monitor IDs. - /// The custom uptime ratio. /// if set to true [include details (log, alerts and response times)]. + /// The custom uptime ratio. + /// The response times average in minutes, which is used as the calculation base for the response times. /// The cancellation token. /// /// Monitor List @@ -25,8 +26,9 @@ namespace UptimeSharp /// public async Task> GetMonitors( string[] monitorIDs = null, - float[] customUptimeRatio = null, bool includeDetails = true, + float[] customUptimeRatio = null, + int responseTimesAverage = 0, CancellationToken cancellationToken = default(CancellationToken)) { RetrieveParameters parameters = new RetrieveParameters() @@ -35,7 +37,8 @@ namespace UptimeSharp CustomUptimeRatio = customUptimeRatio, ShowAlerts = includeDetails, ShowLog = includeDetails, - ShowResponseTimes = includeDetails + ShowResponseTimes = includeDetails, + ResponseTimeAverage = responseTimesAverage }; RetrieveResponse response = await Request("getMonitors", cancellationToken, parameters.Convert()); @@ -48,8 +51,9 @@ namespace UptimeSharp /// Retrieves a monitor from UptimeRobot /// /// a specific monitor ID - /// The custom uptime ratio. /// if set to true [include details (log, alerts and response times)]. + /// The custom uptime ratio. + /// The response times average in minutes, which is used as the calculation base for the response times. /// The cancellation token. /// /// The Monitor @@ -57,11 +61,12 @@ namespace UptimeSharp /// public async Task GetMonitor( string monitorId, - float[] customUptimeRatio = null, bool includeDetails = true, + float[] customUptimeRatio = null, + int responseTimesAverage = 0, CancellationToken cancellationToken = default(CancellationToken)) { - List monitors = await GetMonitors(new string[] { monitorId }, customUptimeRatio, includeDetails, cancellationToken); + List monitors = await GetMonitors(new string[] { monitorId }, includeDetails, customUptimeRatio, responseTimesAverage, cancellationToken); return monitors != null && monitors.Count > 0 ? monitors[0] : null; } diff --git a/UptimeSharp/IUptimeClient.cs b/UptimeSharp/IUptimeClient.cs index ade8146..814a54c 100644 --- a/UptimeSharp/IUptimeClient.cs +++ b/UptimeSharp/IUptimeClient.cs @@ -31,8 +31,9 @@ namespace UptimeSharp /// Retrieves specified monitors from UptimeRobot /// /// The monitor IDs. - /// The custom uptime ratio. /// if set to true [include details (log, alerts and response times)]. + /// The custom uptime ratio. + /// The response times average in minutes, which is used as the calculation base for the response times. /// The cancellation token. /// /// Monitor List @@ -40,16 +41,18 @@ namespace UptimeSharp /// Task> GetMonitors( string[] monitorIDs = null, - float[] customUptimeRatio = null, bool includeDetails = true, + float[] customUptimeRatio = null, + int responseTimesAverage = 0, CancellationToken cancellationToken = default(CancellationToken)); /// /// Retrieves a monitor from UptimeRobot /// /// a specific monitor ID - /// The custom uptime ratio. /// if set to true [include details (log, alerts and response times)]. + /// The custom uptime ratio. + /// The response times average in minutes, which is used as the calculation base for the response times. /// The cancellation token. /// /// The Monitor @@ -57,8 +60,9 @@ namespace UptimeSharp /// Task GetMonitor( string monitorId, - float[] customUptimeRatio = null, bool includeDetails = true, + float[] customUptimeRatio = null, + int responseTimesAverage = 0, CancellationToken cancellationToken = default(CancellationToken)); /// diff --git a/UptimeSharp/Models/Parameters/RetrieveParameters.cs b/UptimeSharp/Models/Parameters/RetrieveParameters.cs index ca6f1e0..8a85429 100644 --- a/UptimeSharp/Models/Parameters/RetrieveParameters.cs +++ b/UptimeSharp/Models/Parameters/RetrieveParameters.cs @@ -61,7 +61,7 @@ namespace UptimeSharp.Models /// The response time interval. /// [DataMember(Name = "responseTimesAverage")] - public int? ResponseTimeInterval { get; set; } + public int? ResponseTimeAverage { get; set; } /// /// Converts an object to a list of HTTP Get parameters.