fca978de07
Sweep of 203 source files resolving CommentChecker findings: add <summary>/<param>/<returns>/<inheritdoc> where missing, and remove resolved task/issue tracking markers (Tests-NNN, Worker-NNN, Server-NNN, Task N) from code comments. Comment/doc-only — no logic changes. Server+Tests build clean under TreatWarningsAsErrors.
31 lines
1.3 KiB
C#
31 lines
1.3 KiB
C#
namespace ZB.MOM.WW.MxGateway.Server.Security.Authentication;
|
|
|
|
public sealed record ApiKeyAdminParseResult(
|
|
bool IsApiKeyCommand,
|
|
ApiKeyAdminCommand? Command,
|
|
string? Error)
|
|
{
|
|
/// <summary>Returns a result indicating the input was not an API key command.</summary>
|
|
/// <returns>A result with <see cref="IsApiKeyCommand"/> set to <see langword="false"/>.</returns>
|
|
public static ApiKeyAdminParseResult NotApiKeyCommand()
|
|
{
|
|
return new ApiKeyAdminParseResult(false, null, null);
|
|
}
|
|
|
|
/// <summary>Returns a successful parse result with the parsed API key command.</summary>
|
|
/// <param name="command">Parsed API key administration command.</param>
|
|
/// <returns>A successful <see cref="ApiKeyAdminParseResult"/> wrapping <paramref name="command"/>.</returns>
|
|
public static ApiKeyAdminParseResult Success(ApiKeyAdminCommand command)
|
|
{
|
|
return new ApiKeyAdminParseResult(true, command, null);
|
|
}
|
|
|
|
/// <summary>Returns a parse result with the specified error message.</summary>
|
|
/// <param name="error">Error message describing the parse failure.</param>
|
|
/// <returns>A failed <see cref="ApiKeyAdminParseResult"/> carrying <paramref name="error"/>.</returns>
|
|
public static ApiKeyAdminParseResult Fail(string error)
|
|
{
|
|
return new ApiKeyAdminParseResult(true, null, error);
|
|
}
|
|
}
|