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

namespace MyTelegram.Schema;

///<summary>
/// Secure value error
/// See <a href="https://corefork.telegram.org/constructor/secureValueError" />
///</summary>
[TlObject(0x869d758f)]
public sealed class TSecureValueError : ISecureValueError
{
    public uint ConstructorId => 0x869d758f;
    ///<summary>
    /// Type of element which has the issue
    /// 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; }

    ///<summary>
    /// Error message
    ///</summary>
    public string Text { get; set; }

    public void ComputeFlag()
    {

    }

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

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