fix: resolve all C# compiler warnings (CS8604, CS8618, CS8603, CS1573, xUnit1012)

- CS8604: Use cmdlet's own Node property instead of nullable task.Node
  in WaitForTask calls across all VM cmdlets
- CS8618: Make PveSession.ServerVersion nullable (PveVersion?) since it
  is set post-construction by PveAuthenticator
- CS8603: Add null-forgiving operator where IsNullOrWhiteSpace guards
  guarantee non-null in PveHttpClient
- CS1573: Add XML param documentation to all public service methods
- xUnit1012: Make test parameters nullable (string?) for null test cases

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-18 18:11:49 -05:00
parent 0dc7f5f833
commit 0c70e11fe8
21 changed files with 157 additions and 18 deletions
@@ -23,6 +23,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Returns network interface configurations for a node.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="node">The cluster node name.</param>
/// <param name="type">
/// Optional interface type filter (e.g. "bridge", "bond", "eth", "vlan", "alias").
/// </param>
@@ -45,6 +47,9 @@ namespace PSProxmoxVE.Core.Services
/// Creates a network interface on a node. Changes are pending until
/// <see cref="ApplyNetworkConfig"/> is called. Returns the new interface config.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="node">The cluster node name.</param>
/// <param name="config">Network interface configuration parameters.</param>
public PveNetwork CreateNetwork(
PveSession session,
string node,
@@ -68,6 +73,10 @@ namespace PSProxmoxVE.Core.Services
/// Updates an existing network interface on a node. Changes are pending until
/// <see cref="ApplyNetworkConfig"/> is called.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="node">The cluster node name.</param>
/// <param name="iface">The network interface name.</param>
/// <param name="config">Network interface configuration parameters to update.</param>
public void SetNetwork(
PveSession session,
string node,
@@ -91,6 +100,9 @@ namespace PSProxmoxVE.Core.Services
/// Removes a network interface from a node. Changes are pending until
/// <see cref="ApplyNetworkConfig"/> is called.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="node">The cluster node name.</param>
/// <param name="iface">The network interface name to remove.</param>
public void RemoveNetwork(PveSession session, string node, string iface)
{
if (session == null) throw new ArgumentNullException(nameof(session));
@@ -104,6 +116,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Applies pending network configuration changes on a node. Returns the task UPID.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="node">The cluster node name.</param>
public PveTask ApplyNetworkConfig(PveSession session, string node)
{
if (session == null) throw new ArgumentNullException(nameof(session));
@@ -122,6 +136,7 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Returns all SDN zone definitions. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
public PveSdnZone[] GetSdnZones(PveSession session)
{
if (session == null) throw new ArgumentNullException(nameof(session));
@@ -136,6 +151,7 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Returns all SDN VNet definitions. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
public PveSdnVnet[] GetSdnVnets(PveSession session)
{
if (session == null) throw new ArgumentNullException(nameof(session));
@@ -150,6 +166,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Creates an SDN zone. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="config">SDN zone configuration parameters.</param>
public PveSdnZone CreateSdnZone(
PveSession session,
Dictionary<string, object> config)
@@ -171,6 +189,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Removes an SDN zone. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="zone">The SDN zone identifier to remove.</param>
public void RemoveSdnZone(PveSession session, string zone)
{
if (session == null) throw new ArgumentNullException(nameof(session));
@@ -184,6 +204,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Creates an SDN VNet. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="config">SDN VNet configuration parameters.</param>
public PveSdnVnet CreateSdnVnet(
PveSession session,
Dictionary<string, object> config)
@@ -205,6 +227,8 @@ namespace PSProxmoxVE.Core.Services
/// <summary>
/// Removes an SDN VNet. Requires PVE 8.0+.
/// </summary>
/// <param name="session">The authenticated PVE session.</param>
/// <param name="vnet">The SDN VNet identifier to remove.</param>
public void RemoveSdnVnet(PveSession session, string vnet)
{
if (session == null) throw new ArgumentNullException(nameof(session));