frostfs-sdk-csharp/src/FrostFS.SDK.Client/Parameters/PrmContainerDelete.cs
Pavel Gross 9bb7b5eff8
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
[#28] Clients: Make immutable parameters
Signed-off-by: Pavel Gross <p.gross@yadro.com>
2024-12-02 19:33:45 +03:00

52 lines
1.5 KiB
C#

namespace FrostFS.SDK.Client;
public readonly struct PrmContainerDelete(
FrostFsContainerId containerId,
PrmWait waitParams,
FrostFsSessionToken? sessionToken = null,
string[]? xheaders = null) : ISessionToken, System.IEquatable<PrmContainerDelete>
{
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; } = waitParams;
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);
}
}