frostfs-sdk-csharp/src/FrostFS.SDK.ClientV2/Mappers/Object/ObjectAttributeMapper.cs
Pavel Gross d1271df207 [#13] Client: Use code analyzers
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-09-23 19:25:59 +03:00

32 lines
766 B
C#

using System;
using FrostFS.Object;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
public static class ObjectAttributeMapper
{
public static Header.Types.Attribute ToMessage(this FrostFsAttributePair attribute)
{
if (attribute is null)
{
throw new ArgumentNullException(nameof(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);
}
}