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

namespace MyTelegram.Schema;

///<summary>
/// Poll
/// See <a href="https://corefork.telegram.org/constructor/messageMediaPoll" />
///</summary>
[TlObject(0x4bd6e798)]
public sealed class TMessageMediaPoll : IMessageMedia
{
    public uint ConstructorId => 0x4bd6e798;
    ///<summary>
    /// The poll
    /// See <a href="https://corefork.telegram.org/type/Poll" />
    ///</summary>
    public MyTelegram.Schema.IPoll Poll { get; set; }

    ///<summary>
    /// The results of the poll
    /// See <a href="https://corefork.telegram.org/type/PollResults" />
    ///</summary>
    public MyTelegram.Schema.IPollResults Results { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Poll = buffer.Read<MyTelegram.Schema.IPoll>();
        Results = buffer.Read<MyTelegram.Schema.IPollResults>();
    }
}