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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Change the default peer that should be used when sending messages, reactions, poll votes to a specific group
/// <para>Possible errors</para>
/// Code Type Description
/// 400 PEER_ID_INVALID The provided peer id is invalid.
/// 400 SEND_AS_PEER_INVALID You can't send messages as the specified peer.
/// See <a href="https://corefork.telegram.org/method/messages.saveDefaultSendAs" />
///</summary>
[TlObject(0xccfddf96)]
public sealed class RequestSaveDefaultSendAs : IRequest<IBool>
{
    public uint ConstructorId => 0xccfddf96;
    ///<summary>
    /// Group
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer Peer { get; set; }

    ///<summary>
    /// The default peer that should be used when sending messages to the group
    /// See <a href="https://corefork.telegram.org/type/InputPeer" />
    ///</summary>
    public MyTelegram.Schema.IInputPeer SendAs { get; set; }

    public void ComputeFlag()
    {

    }

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

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