frostfs-sdk-csharp/src/FrostFS.SDK.Client/Mappers/Object/ObjectAttributeMapper.cs
Pavel Gross bd8eb7cc60 [#33] Client: Add extended life tests
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2025-02-26 12:35:27 +03:00

27 lines
648 B
C#

using System;
using FrostFS.Object;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ObjectAttributeMapper
{
public static Header.Types.Attribute ToMessage(this FrostFsAttributePair attribute)
{
return new Header.Types.Attribute
{
Key = attribute.Key,
Value = attribute.Value
};
}
public static FrostFsAttributePair ToModel(this Header.Types.Attribute attribute)
{
if (attribute is null)
{
throw new ArgumentNullException(nameof(attribute));
}
return new FrostFsAttributePair(attribute.Key, attribute.Value);
}
}