23 lines
603 B
C#
23 lines
603 B
C#
namespace MxGateway.Server.Security.Authentication;
|
|
|
|
public sealed record ApiKeyAdminParseResult(
|
|
bool IsApiKeyCommand,
|
|
ApiKeyAdminCommand? Command,
|
|
string? Error)
|
|
{
|
|
public static ApiKeyAdminParseResult NotApiKeyCommand()
|
|
{
|
|
return new ApiKeyAdminParseResult(false, null, null);
|
|
}
|
|
|
|
public static ApiKeyAdminParseResult Success(ApiKeyAdminCommand command)
|
|
{
|
|
return new ApiKeyAdminParseResult(true, command, null);
|
|
}
|
|
|
|
public static ApiKeyAdminParseResult Fail(string error)
|
|
{
|
|
return new ApiKeyAdminParseResult(true, null, error);
|
|
}
|
|
}
|