[#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
749000a090
commit
9bb7b5eff8
62 changed files with 2742 additions and 963 deletions
43
src/FrostFS.SDK.Client/Parameters/PrmApeChainAdd.cs
Normal file
43
src/FrostFS.SDK.Client/Parameters/PrmApeChainAdd.cs
Normal file
|
@ -0,0 +1,43 @@
|
|||
namespace FrostFS.SDK.Client;
|
||||
|
||||
public readonly struct PrmApeChainAdd(FrostFsChainTarget target, FrostFsChain chain, string[]? xheaders = null) : System.IEquatable<PrmApeChainAdd>
|
||||
{
|
||||
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 PrmApeChainAdd)
|
||||
return false;
|
||||
|
||||
return Equals((PrmApeChainAdd)obj);
|
||||
}
|
||||
|
||||
public readonly bool Equals(PrmApeChainAdd 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 ==(PrmApeChainAdd left, PrmApeChainAdd right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(PrmApeChainAdd left, PrmApeChainAdd right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue