[#13] Client: Use code analyzers

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-09-23 18:53:21 +03:00
parent d7dbbf8da8
commit d1271df207
102 changed files with 2168 additions and 733 deletions

View file

@ -1,11 +1,18 @@
using System;
using FrostFS.Object;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
public static class ObjectAttributeMapper
{
public static Header.Types.Attribute ToMessage(this FrostFsAttribute attribute)
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,
@ -13,8 +20,13 @@ public static class ObjectAttributeMapper
};
}
public static FrostFsAttribute ToModel(this Header.Types.Attribute attribute)
public static FrostFsAttributePair ToModel(this Header.Types.Attribute attribute)
{
return new FrostFsAttribute(attribute.Key, attribute.Value);
if (attribute is null)
{
throw new ArgumentNullException(nameof(attribute));
}
return new FrostFsAttributePair(attribute.Key, attribute.Value);
}
}