[#30] Client: Add object model for Rules

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-02-12 04:20:01 +03:00
parent 43e300c773
commit 195854a45b
27 changed files with 677 additions and 155 deletions

View file

@ -0,0 +1,36 @@
namespace FrostFS.SDK.Client;
public struct Resource(bool inverted, string[] names) : System.IEquatable<Resource>
{
public bool Inverted { get; set; } = inverted;
public string[] Names { get; set; } = names;
public override bool Equals(object obj)
{
if (obj == null || obj is not Resource)
return false;
return Equals((Resource)obj);
}
public override readonly int GetHashCode()
{
return Inverted.GetHashCode() ^ string.Join(string.Empty, Names).GetHashCode();
}
public static bool operator ==(Resource left, Resource right)
{
return left.Equals(right);
}
public static bool operator !=(Resource left, Resource right)
{
return !(left == right);
}
public readonly bool Equals(Resource other)
{
return this.GetHashCode().Equals(other.GetHashCode());
}
}