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

namespace MyTelegram.Schema.Phone;

///<summary>
/// Set the default peer that will be used to join a group call in a specific dialog.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 JOIN_AS_PEER_INVALID The specified peer cannot be used to join a group call.
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// See <a href="https://corefork.telegram.org/method/phone.saveDefaultGroupCallJoinAs" />
///</summary>
[TlObject(0x575e1f8c)]
public sealed class RequestSaveDefaultGroupCallJoinAs : IRequest<IBool>
{
    public uint ConstructorId => 0x575e1f8c;
    ///<summary>
    /// The dialog
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// The default peer that will be used to join group calls in this dialog, presenting yourself as a specific user/channel.
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer JoinAs { get; set; }

    public void ComputeFlag()
    {

    }

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

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