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

namespace MyTelegram.Schema.Messages;

///<summary>
/// Upload encrypted file and associate it to a secret chat
/// <para>Possible errors</para>
/// Code Type Description
/// 400 CHAT_ID_INVALID The provided chat id is invalid.
/// See <a href="https://corefork.telegram.org/method/messages.uploadEncryptedFile" />
///</summary>
[TlObject(0x5057c497)]
public sealed class RequestUploadEncryptedFile : IRequest<MyTelegram.Schema.IEncryptedFile>
{
    public uint ConstructorId => 0x5057c497;
    ///<summary>
    /// The secret chat to associate the file to
    /// See <a href="https://corefork.telegram.org/type/InputEncryptedChat" />
    ///</summary>
    public MyTelegram.Schema.IInputEncryptedChat Peer { get; set; }

    ///<summary>
    /// The file
    /// See <a href="https://corefork.telegram.org/type/InputEncryptedFile" />
    ///</summary>
    public MyTelegram.Schema.IInputEncryptedFile File { get; set; }

    public void ComputeFlag()
    {

    }

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

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