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

namespace MyTelegram.Schema;

///<summary>
/// A contact of the current user that is registered in the system.
/// See <a href="https://corefork.telegram.org/constructor/contact" />
///</summary>
[TlObject(0x145ade0b)]
public sealed class TContact : IContact
{
    public uint ConstructorId => 0x145ade0b;
    ///<summary>
    /// User identifier
    ///</summary>
    public long UserId { get; set; }

    ///<summary>
    /// Current user is in the user's contact list
    /// See <a href="https://corefork.telegram.org/type/Bool" />
    ///</summary>
    public bool Mutual { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        UserId = buffer.ReadInt64();
        Mutual = buffer.Read();
    }
}