Skip to content

Commit

Permalink
More method names now include Async
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnmbond committed Jun 27, 2023
1 parent 299fbb8 commit 730d2a0
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 66 deletions.
2 changes: 1 addition & 1 deletion LogicMonitor.Api.Test/Alerts/AlertTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public async Task GetAlerts_SdtsMatchRequest()
public async Task GetAlertsAndCheckUnique()
{
var startEpoch = DateTime.UtcNow.AddDays(-1).SecondsSinceTheEpoch();
var alertList = await LogicMonitorClient.GetRestAlertsWithV84Bug(new AlertFilter { StartEpochIsAfter = startEpoch }, TimeSpan.FromHours(8)).ConfigureAwait(false);
var alertList = await LogicMonitorClient.GetRestAlertsWithV84BugAsync(new AlertFilter { StartEpochIsAfter = startEpoch }, TimeSpan.FromHours(8)).ConfigureAwait(false);

var unique = true;
foreach (var alert in alertList)
Expand Down
4 changes: 2 additions & 2 deletions LogicMonitor.Api.Test/LogicModules/ConfigSourceTests2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public async Task UpdateAuditVersion()
var defaultVersion = original.AuditVersion;

await LogicMonitorClient
.AddConfigsourceAuditVersionAsync(original.Id, new Audit() { Version = 1 }, default)
.AddConfigSourceAuditVersionAsync(original.Id, new Audit() { Version = 1 }, default)
.ConfigureAwait(false);

var configSource = await LogicMonitorClient.GetAsync<ConfigSource>(original.Id, default).ConfigureAwait(false);

configSource.AuditVersion.Should().Be(1);

await LogicMonitorClient
.AddConfigsourceAuditVersionAsync(original.Id, new Audit() { Version = defaultVersion }, default)
.AddConfigSourceAuditVersionAsync(original.Id, new Audit() { Version = defaultVersion }, default)
.ConfigureAwait(false);
}
}
8 changes: 3 additions & 5 deletions LogicMonitor.Api.Test/LogicModules/DataSourceTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using LogicMonitor.Api.LogicModules;
using LogicMonitor.Api.Test.Extensions;
using System.Security.Cryptography;

namespace LogicMonitor.Api.Test.LogicModules;

Expand Down Expand Up @@ -98,7 +96,7 @@ public async Task GetWinService()
var device = await GetWindowsDeviceAsync(default)
.ConfigureAwait(false);
var windowsServices = await LogicMonitorClient
.GetDeviceProcesses(device.Id, DeviceProcessServiceTaskType.WindowsService, default)
.GetDeviceProcessesAsync(device.Id, DeviceProcessServiceTaskType.WindowsService, default)
.ConfigureAwait(false);
windowsServices.Should().NotBeNull();
windowsServices.Items.Should().NotBeNull();
Expand All @@ -108,7 +106,7 @@ public async Task GetWinService()
[Fact]
public async Task GetMonitoredWinService()
{
var windowsServices = await LogicMonitorClient.GetMonitoredDeviceProcesses(29, DeviceProcessServiceTaskType.WindowsService, default).ConfigureAwait(false);
var windowsServices = await LogicMonitorClient.GetMonitoredDeviceProcessesAsync(29, DeviceProcessServiceTaskType.WindowsService, default).ConfigureAwait(false);
windowsServices.Should().NotBeNullOrEmpty();
}

Expand Down Expand Up @@ -508,7 +506,7 @@ public async Task GetDataSourceGraph()
.GetByNameAsync<DataSource>("Ping", default)
.ConfigureAwait(false);

if (dataSource != null )
if (dataSource != null)
{
var testGraphs = await LogicMonitorClient
.GetDataSourceGraphsAsync(dataSource.Id, default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async Task GetDataSourceMetadata()
dataSource ??= new();
dataSource.Id.Should().NotBe(0);
var logicModuleMetadata = await LogicMonitorClient
.GetLogicModuleMetadata(LogicModuleType.DataSource, dataSource.Id, default)
.GetLogicModuleMetadataAsync(LogicModuleType.DataSource, dataSource.Id, default)
.ConfigureAwait(false);
CheckMetadata(logicModuleMetadata);
}
Expand All @@ -39,7 +39,7 @@ public async Task GetConfigSourceMetadata()
if (configSource != null)
{
configSource.Id.Should().NotBe(0);
var logicModuleMetadata = await LogicMonitorClient.GetLogicModuleMetadata(LogicModuleType.ConfigSource, configSource.Id, default).ConfigureAwait(false);
var logicModuleMetadata = await LogicMonitorClient.GetLogicModuleMetadataAsync(LogicModuleType.ConfigSource, configSource.Id, default).ConfigureAwait(false);
CheckMetadata(logicModuleMetadata);
}
}
Expand All @@ -52,7 +52,7 @@ public async Task GetPropertySourceMetadata()
if (propertySource != null)
{
propertySource.Id.Should().NotBe(0);
var logicModuleMetadata = await LogicMonitorClient.GetLogicModuleMetadata(LogicModuleType.PropertySource, propertySource.Id, default).ConfigureAwait(false);
var logicModuleMetadata = await LogicMonitorClient.GetLogicModuleMetadataAsync(LogicModuleType.PropertySource, propertySource.Id, default).ConfigureAwait(false);
CheckMetadata(logicModuleMetadata);
}
}
Expand Down
66 changes: 33 additions & 33 deletions LogicMonitor.Api.Test/LogicModules/LogicModuleUpdateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task GetLogicModuleDataSourceUpdates()

var dataSourceUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.DataSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.DataSource, version.Version.Major, default)
.ConfigureAwait(false);

dataSourceUpdates.Items.Should().NotBeNullOrEmpty();
Expand All @@ -38,7 +38,7 @@ public async Task GetLogicModuleEventSourceUpdates()

var eventSourceUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.EventSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.EventSource, version.Version.Major, default)
.ConfigureAwait(false);

eventSourceUpdates.Items.Should().NotBeNull();
Expand All @@ -57,7 +57,7 @@ public async Task GetLogicModuleConfigSourceUpdates()

var configSourceUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.ConfigSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.ConfigSource, version.Version.Major, default)
.ConfigureAwait(false);

configSourceUpdates.Items.Should().NotBeNullOrEmpty();
Expand All @@ -76,7 +76,7 @@ public async Task GetLogicModulePropertySourceUpdates()

var propertySourceUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.PropertySource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.PropertySource, version.Version.Major, default)
.ConfigureAwait(false);

propertySourceUpdates.Items.Should().NotBeNullOrEmpty();
Expand All @@ -95,7 +95,7 @@ public async Task GetLogicModuleTopologySourceUpdates()

var topologySourceUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.TopologySource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.TopologySource, version.Version.Major, default)
.ConfigureAwait(false);

topologySourceUpdates.Items.Should().NotBeNullOrEmpty();
Expand All @@ -113,7 +113,7 @@ public async Task GetLogicModuleJobMonitorUpdates()
.ConfigureAwait(false);

_ = await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.PropertySource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.PropertySource, version.Version.Major, default)
.ConfigureAwait(false);

//jobMonitorUpdates.Items.Should().NotBeNullOrEmpty(); // Usually none
Expand All @@ -131,7 +131,7 @@ public async Task GetLogicModuleAppliesToUpdates()
.ConfigureAwait(false);

_ = await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.AppliesToFunction, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.AppliesToFunction, version.Version.Major, default)
.ConfigureAwait(false);

//appliesToUpdates.Items.Should().NotBeNullOrEmpty(); // Usually none
Expand All @@ -150,7 +150,7 @@ public async Task GetLogicModuleSnmpSysOidUpdates()

var snmpSysOidUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.SnmpSysOIDMap, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.SnmpSysOIDMap, version.Version.Major, default)
.ConfigureAwait(false);

snmpSysOidUpdates.Items.Should().NotBeNullOrEmpty();
Expand All @@ -169,7 +169,7 @@ public async Task GetAllLogicModuleUpdates()

var allUpdates =
await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.All, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.All, version.Version.Major, default)
.ConfigureAwait(false);

allUpdates.Total.Should().BePositive();
Expand All @@ -188,7 +188,7 @@ public async Task AuditDataSource()

var dataSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.DataSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.DataSource, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -198,7 +198,7 @@ public async Task AuditDataSource()
if (dataSourceUpdates.Count > 0)
{
var dataSourceToAudit = dataSourceUpdates[0];
_ = await LogicMonitorClient.AuditDataSource(
_ = await LogicMonitorClient.AuditDataSourceAsync(
dataSourceToAudit.LocalId,
dataSourceToAudit.Version,
default)
Expand All @@ -219,7 +219,7 @@ public async Task AuditEventSource()

var eventSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.EventSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.EventSource, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -229,7 +229,7 @@ public async Task AuditEventSource()
if (eventSourceUpdates.Count > 0)
{
var eventSourceToAudit = eventSourceUpdates[0];
_ = await LogicMonitorClient.AuditEventSource(
_ = await LogicMonitorClient.AuditEventSourceAsync(
eventSourceToAudit.LocalId,
eventSourceToAudit.Version,
default)
Expand All @@ -250,7 +250,7 @@ public async Task AuditConfigSource()

var configSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.ConfigSource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.ConfigSource, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -261,7 +261,7 @@ public async Task AuditConfigSource()
{
var configSourceToAudit = configSourceUpdates[0];
_ =
await LogicMonitorClient.AuditConfigSource(
await LogicMonitorClient.AuditConfigSourceAsync(
configSourceToAudit.LocalId,
configSourceToAudit.Version,
default)
Expand All @@ -282,7 +282,7 @@ public async Task AuditPropertySource()

var propertySourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(LogicModuleType.PropertySource, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(LogicModuleType.PropertySource, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -292,7 +292,7 @@ public async Task AuditPropertySource()
if (propertySourceUpdates.Count > 0)
{
var propertySourceToAudit = propertySourceUpdates[0];
_ = await LogicMonitorClient.AuditPropertySource(
_ = await LogicMonitorClient.AuditPropertySourceAsync(
propertySourceToAudit.LocalId,
propertySourceToAudit.Version,
default)
Expand All @@ -315,7 +315,7 @@ public async Task ImportDataSource()

var dataSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -325,7 +325,7 @@ public async Task ImportDataSource()
if (dataSourceUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -352,7 +352,7 @@ public async Task ImportEventSource()

var eventSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -362,7 +362,7 @@ public async Task ImportEventSource()
if (eventSourceUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -389,7 +389,7 @@ public async Task ImportConfigSource()

var configSourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -399,7 +399,7 @@ public async Task ImportConfigSource()
if (configSourceUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -426,7 +426,7 @@ public async Task ImportPropertySource()

var propertySourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -436,7 +436,7 @@ public async Task ImportPropertySource()
if (propertySourceUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -463,7 +463,7 @@ public async Task ImportTopologySource()

var topologySourceUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -473,7 +473,7 @@ public async Task ImportTopologySource()
if (topologySourceUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -500,7 +500,7 @@ public async Task ImportJobMonitor()

var jobMonitorUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -510,7 +510,7 @@ public async Task ImportJobMonitor()
if (jobMonitorUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -537,7 +537,7 @@ public async Task ImportAppliesToFunction()

var appliesToFunctionUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -547,7 +547,7 @@ public async Task ImportAppliesToFunction()
if (appliesToFunctionUpdates.Count > 0)
{
await LogicMonitorClient
.ImportLogicModules(
.ImportLogicModulesAsync(
logicModuleType,
new List<string>
{
Expand All @@ -574,7 +574,7 @@ public async Task ImportSnmpSysOidMap()

var snmpSysOidMapUpdates =
(await LogicMonitorClient
.GetLogicModuleUpdates(logicModuleType, version.Version.Major, default)
.GetLogicModuleUpdatesAsync(logicModuleType, version.Version.Major, default)
.ConfigureAwait(false))
.Items
.Where(ds =>
Expand All @@ -584,7 +584,7 @@ public async Task ImportSnmpSysOidMap()
if (snmpSysOidMapUpdates.Count > 0)
{
await LogicMonitorClient
.ImportSnmpSysOidMap(
.ImportSnmpSysOidMapAsync(
new List<SnmpSysOidMapImportItem>
{
new SnmpSysOidMapImportItem
Expand Down
2 changes: 1 addition & 1 deletion LogicMonitor.Api/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"SCS0005:Weak random generator",
Justification = "Not used for cryptography",
Scope = "member",
Target = "~M:LogicMonitor.Api.LogicMonitorClient.GetRestAlertsWithV84Bug(LogicMonitor.Api.Alerts.AlertFilter,System.TimeSpan)~System.Threading.Tasks.Task{System.Collections.Generic.List{LogicMonitor.Api.Alerts.Alert}}")]
Target = "~M:LogicMonitor.Api.LogicMonitorClient.GetRestAlertsWithV84BugAsync(LogicMonitor.Api.Alerts.AlertFilter,System.TimeSpan)~System.Threading.Tasks.Task{System.Collections.Generic.List{LogicMonitor.Api.Alerts.Alert}}")]

[assembly: SuppressMessage(
"Performance",
Expand Down
Loading

0 comments on commit 730d2a0

Please sign in to comment.