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

namespace MyTelegram.Schema;

///<summary>
/// Phone book contact
/// See <a href="https://corefork.telegram.org/constructor/inputMediaContact" />
///</summary>
[TlObject(0xf8ab7dfb)]
public sealed class TInputMediaContact : IInputMedia
{
    public uint ConstructorId => 0xf8ab7dfb;
    ///<summary>
    /// Phone number
    ///</summary>
    public string PhoneNumber { get; set; }

    ///<summary>
    /// Contact's first name
    ///</summary>
    public string FirstName { get; set; }

    ///<summary>
    /// Contact's last name
    ///</summary>
    public string LastName { get; set; }

    ///<summary>
    /// Contact vcard
    ///</summary>
    public string Vcard { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        PhoneNumber = buffer.ReadString();
        FirstName = buffer.ReadString();
        LastName = buffer.ReadString();
        Vcard = buffer.ReadString();
    }
}