18 lines
No EOL
575 B
C#
18 lines
No EOL
575 B
C#
using System;
|
|
|
|
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
|
|
|
|
public static class StatusMapper
|
|
{
|
|
public static FrostFsResponseStatus ToModel(this Status.Status status)
|
|
{
|
|
if (status is null)
|
|
return new FrostFsResponseStatus(FrostFsStatusCode.Success);
|
|
|
|
var codeName = Enum.GetName(typeof(FrostFsStatusCode), status.Code);
|
|
|
|
return codeName is null
|
|
? throw new ArgumentException($"Unknown StatusCode. Value: '{status.Code}'.")
|
|
: new FrostFsResponseStatus((FrostFsStatusCode)status.Code, status.Message);
|
|
}
|
|
} |