[#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
|
@ -1,14 +1,52 @@
|
|||
namespace FrostFS.SDK.Client;
|
||||
|
||||
public sealed class PrmContainerDelete(FrostFsContainerId containerId, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
|
||||
public readonly struct PrmContainerDelete(
|
||||
FrostFsContainerId containerId,
|
||||
PrmWait waitParams,
|
||||
FrostFsSessionToken? sessionToken = null,
|
||||
string[]? xheaders = null) : ISessionToken, System.IEquatable<PrmContainerDelete>
|
||||
{
|
||||
public FrostFsContainerId ContainerId { get; set; } = containerId;
|
||||
public FrostFsContainerId ContainerId { get; } = containerId;
|
||||
|
||||
/// <summary>
|
||||
/// Since the container is removed with some delay, it needs to poll the container status
|
||||
/// </summary>
|
||||
/// <value>Rules for polling the result</value>
|
||||
public PrmWait? WaitParams { get; set; }
|
||||
public PrmWait WaitParams { get; } = waitParams;
|
||||
|
||||
public FrostFsSessionToken? SessionToken { get; set; }
|
||||
public FrostFsSessionToken? SessionToken { get; } = sessionToken;
|
||||
|
||||
/// <summary>
|
||||
/// FrostFS request X-Headers
|
||||
/// </summary>
|
||||
public string[] XHeaders { get; } = xheaders ?? [];
|
||||
|
||||
public override readonly bool Equals(object obj)
|
||||
{
|
||||
if (obj == null || obj is not PrmContainerDelete)
|
||||
return false;
|
||||
|
||||
return Equals((PrmContainerDelete)obj);
|
||||
}
|
||||
|
||||
public readonly bool Equals(PrmContainerDelete other)
|
||||
{
|
||||
return ContainerId == other.ContainerId
|
||||
&& WaitParams.Equals(other.WaitParams);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ContainerId.GetHashCode() ^ WaitParams.GetHashCode();
|
||||
}
|
||||
|
||||
public static bool operator ==(PrmContainerDelete left, PrmContainerDelete right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
public static bool operator !=(PrmContainerDelete left, PrmContainerDelete right)
|
||||
{
|
||||
return !(left == right);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue