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

namespace MyTelegram.Schema.Phone;

///<summary>
/// Send VoIP signaling data
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CALL_PEER_INVALID The provided call peer object is invalid.
/// See <a href="https://corefork.telegram.org/method/phone.sendSignalingData" />
///</summary>
[TlObject(0xff7a9383)]
public sealed class RequestSendSignalingData : IRequest<IBool>
{
    public uint ConstructorId => 0xff7a9383;
    ///<summary>
    /// Phone call
    /// See <a href="https://corefork.telegram.org/type/InputPhoneCall" />
    ///</summary>
    public MyTelegram.Schema.IInputPhoneCall Peer { get; set; }

    ///<summary>
    /// Signaling payload
    ///</summary>
    public ReadOnlyMemory<byte> Data { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Peer = buffer.Read<MyTelegram.Schema.IInputPhoneCall>();
        Data = buffer.ReadBytes();
    }
}
