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

namespace MyTelegram.Schema;

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

    ///<summary>
    /// Options chosen by the peer
    ///</summary>
    public TVector<ReadOnlyMemory<byte>> Options { get; set; }

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

    public void ComputeFlag()
    {

    }

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

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