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

namespace MyTelegram.Schema;

///<summary>
/// Saved contact
/// See <a href="https://corefork.telegram.org/constructor/savedPhoneContact" />
///</summary>
[TlObject(0x1142bd56)]
public sealed class TSavedPhoneContact : ISavedContact
{
    public uint ConstructorId => 0x1142bd56;
    ///<summary>
    /// Phone number
    ///</summary>
    public string Phone { get; set; }

    ///<summary>
    /// First name
    ///</summary>
    public string FirstName { get; set; }

    ///<summary>
    /// Last name
    ///</summary>
    public string LastName { get; set; }

    ///<summary>
    /// Date added
    ///</summary>
    public int Date { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Phone);
        writer.Write(FirstName);
        writer.Write(LastName);
        writer.Write(Date);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Phone = buffer.ReadString();
        FirstName = buffer.ReadString();
        LastName = buffer.ReadString();
        Date = buffer.ReadInt32();
    }
}