[#28] Clients: Make immutable parameters
All checks were successful
lint-build / dotnet8.0 (pull_request) Successful in 55s
DCO / DCO (pull_request) Successful in 1m4s
lint-build / dotnet8.0 (push) Successful in 1m13s

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,6 +1,40 @@
namespace FrostFS.SDK.Client;
public sealed class PrmContainerGet(FrostFsContainerId container, CallContext? ctx = null) : PrmBase(ctx)
public readonly struct PrmContainerGet(FrostFsContainerId container, string[]? xheaders = null) : System.IEquatable<PrmContainerGet>
{
public FrostFsContainerId Container { get; set; } = container;
public FrostFsContainerId Container { get; } = container;
/// <summary>
/// FrostFS request X-Headers
/// </summary>
public string[] XHeaders { get; } = xheaders ?? [];
public override readonly bool Equals(object obj)
{
if (obj == null || obj is not PrmContainerGet)
return false;
return Equals((PrmContainerGet)obj);
}
public readonly bool Equals(PrmContainerGet other)
{
return GetHashCode() == other.GetHashCode();
}
public override readonly int GetHashCode()
{
return Container.GetHashCode()
^ XHeaders.GetHashCode();
}
public static bool operator ==(PrmContainerGet left, PrmContainerGet right)
{
return left.Equals(right);
}
public static bool operator !=(PrmContainerGet left, PrmContainerGet right)
{
return !(left == right);
}
}