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

namespace MyTelegram.Schema.Account;

///<summary>
/// Upload notification sound, use <a href="https://corefork.telegram.org/method/account.saveRingtone">account.saveRingtone</a> to convert it and add it to the list of saved notification sounds.
/// <para>Possible errors</para>
/// Code Type Description
/// 400 RINGTONE_MIME_INVALID The MIME type for the ringtone is invalid.
/// See <a href="https://corefork.telegram.org/method/account.uploadRingtone" />
///</summary>
[TlObject(0x831a83a2)]
public sealed class RequestUploadRingtone : IRequest<MyTelegram.Schema.IDocument>
{
    public uint ConstructorId => 0x831a83a2;
    ///<summary>
    /// Notification sound
    /// See <a href="https://corefork.telegram.org/type/InputFile" />
    ///</summary>
    public MyTelegram.Schema.IInputFile File { get; set; }

    ///<summary>
    /// File name
    ///</summary>
    public string FileName { get; set; }

    ///<summary>
    /// MIME type of file
    ///</summary>
    public string MimeType { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        File = buffer.Read<MyTelegram.Schema.IInputFile>();
        FileName = buffer.ReadString();
        MimeType = buffer.ReadString();
    }
}
