frostfs-sdk-csharp/sdk/src/FrostFS.SDK.ClientV2/Mappers/GRPC/Object.cs
Ivan Pchelintsev 013d8a8436 [#1] Add Object Head/Put/Delete operations
Signed-off-by: Ivan Pchelintsev <i.pchelintsev@yadro.com>
2024-05-22 14:29:20 +03:00

18 lines
No EOL
527 B
C#

using FrostFS.SDK.ModelsV2;
using FrostFS.SDK.ModelsV2.Enums;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
public static class ObjectHeadMapper
{
public static ObjectHead ToModel(this Object.Header head)
{
// var obtype = Enum.Parse<ObjectType>(head.ObjectType.ToString());
return new ObjectHead
{
ContainerId = ContainerId.FromHash(head.ContainerId.Value.ToByteArray()),
Size = (long)head.PayloadLength,
Version = head.Version.ToModel()
};
}
}