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

namespace MyTelegram.Schema.Phone;

///<summary>
/// See <a href="https://corefork.telegram.org/method/phone.inviteConferenceCallParticipant" />
///</summary>
[TlObject(0xbcf22685)]
public sealed class RequestInviteConferenceCallParticipant : IRequest<MyTelegram.Schema.IUpdates>
{
    public uint ConstructorId => 0xbcf22685;
    public int Flags { get; set; }
    public bool Video { get; set; }
    public MyTelegram.Schema.IInputGroupCall Call { get; set; }
    public MyTelegram.Schema.IInputUser UserId { get; set; }

    public void ComputeFlag()
    {
        if (Video) { Flags = Flags.SetBit(0); }

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Flags);
        writer.Write(Call);
        writer.Write(UserId);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Flags = buffer.ReadInt32();
        if (Flags.IsBitSet(0)) { Video = true; }
        Call = buffer.Read<MyTelegram.Schema.IInputGroupCall>();
        UserId = buffer.Read<MyTelegram.Schema.IInputUser>();
    }
}
