using ZB.MOM.WW.MxGateway.Contracts.Proto;

namespace ZB.MOM.WW.MxGateway.Worker.Conversion;

/// <summary>Result of converting an HResult to a protocol status and diagnostic message.</summary>
public sealed class HResultConversion
{
    /// <summary>Initializes the conversion result.</summary>
    /// <param name="hresult">The original HResult value.</param>
    /// <param name="protocolStatus">The converted protocol status.</param>
    /// <param name="diagnosticMessage">Diagnostic message describing the HResult.</param>
    public HResultConversion(
        int hresult,
        ProtocolStatus protocolStatus,
        string diagnosticMessage)
    {
        HResult = hresult;
        ProtocolStatus = protocolStatus;
        DiagnosticMessage = diagnosticMessage;
    }

    /// <summary>The original HResult value.</summary>
    public int HResult { get; }

    /// <summary>The converted protocol status.</summary>
    public ProtocolStatus ProtocolStatus { get; }

    /// <summary>Diagnostic message describing the HResult.</summary>
    public string DiagnosticMessage { get; }
}
