// <auto-generated/>
// ReSharper disable All

namespace MyTelegram.Schema;

///<summary>
/// Secure value hash
/// See <a href="https://corefork.telegram.org/constructor/secureValueHash" />
///</summary>
[TlObject(0xed1ecdb0)]
public sealed class TSecureValueHash : ISecureValueHash
{
    public uint ConstructorId => 0xed1ecdb0;
    ///<summary>
    /// Secure value type
    /// See <a href="https://corefork.telegram.org/type/SecureValueType" />
    ///</summary>
    public MyTelegram.Schema.ISecureValueType Type { get; set; }

    ///<summary>
    /// Hash
    ///</summary>
    public ReadOnlyMemory<byte> Hash { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Type);
        writer.Write(Hash);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Type = buffer.Read<MyTelegram.Schema.ISecureValueType>();
        Hash = buffer.ReadBytes();
    }
}