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

namespace MyTelegram.Schema;

///<summary>
/// How a peer voted in a poll
/// See <a href="https://corefork.telegram.org/constructor/messagePeerVote" />
///</summary>
[TlObject(0xb6cc2d5c)]
public sealed class TMessagePeerVote : IMessagePeerVote
{
    public uint ConstructorId => 0xb6cc2d5c;
    ///<summary>
    /// Peer ID
    /// See <a href="https://corefork.telegram.org/type/Peer" />
    ///</summary>
    public MyTelegram.Schema.IPeer Peer { get; set; }

    ///<summary>
    /// The option chosen by the peer
    ///</summary>
    public ReadOnlyMemory<byte> Option { get; set; }

    ///<summary>
    /// When did the peer cast the vote
    ///</summary>
    public int Date { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Peer);
        writer.Write(Option);
        writer.Write(Date);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IPeer>();
        Option = buffer.ReadBytes();
        Date = buffer.ReadInt32();
    }
}