27 lines
648 B
C#
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);
|
|
}
|
|
}
|