[#28] Clients: Make immutable parameters

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-12-02 19:33:45 +03:00
parent 749000a090
commit 9bb7b5eff8
62 changed files with 2742 additions and 963 deletions

View file

@ -1,8 +1,46 @@
namespace FrostFS.SDK.Client;
public sealed class PrmApeChainRemove(FrostFsChainTarget target, FrostFsChain chain, CallContext? ctx = null) : PrmBase(ctx)
public readonly struct PrmApeChainRemove(
FrostFsChainTarget target,
FrostFsChain chain,
string[]? xheaders = null) : System.IEquatable<PrmApeChainRemove>
{
public FrostFsChainTarget Target { get; } = target;
public FrostFsChain Chain { get; } = chain;
/// <summary>
/// FrostFS request X-Headers
/// </summary>
public string[] XHeaders { get; } = xheaders ?? [];
public override readonly bool Equals(object obj)
{
if (obj == null || obj is not PrmApeChainRemove)
return false;
return Equals((PrmApeChainRemove)obj);
}
public readonly bool Equals(PrmApeChainRemove other)
{
return Target == other.Target
&& Chain == other.Chain
&& XHeaders == other.XHeaders;
}
public override readonly int GetHashCode()
{
return Chain.GetHashCode() ^ Target.GetHashCode() ^ XHeaders.GetHashCode();
}
public static bool operator ==(PrmApeChainRemove left, PrmApeChainRemove right)
{
return left.Equals(right);
}
public static bool operator !=(PrmApeChainRemove left, PrmApeChainRemove right)
{
return !(left == right);
}
}