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

namespace MyTelegram.Schema;

///<summary>
/// Error.
/// See <a href="https://corefork.telegram.org/constructor/error" />
///</summary>
[TlObject(0xc4b9f9bb)]
public sealed class TError : IError
{
    public uint ConstructorId => 0xc4b9f9bb;
    ///<summary>
    /// Error code
    ///</summary>
    public int Code { get; set; }

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

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Code = buffer.ReadInt32();
        Text = buffer.ReadString();
    }
}