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

namespace MyTelegram.Schema;

///<summary>
/// The document
/// See <a href="https://corefork.telegram.org/constructor/inputWebDocument" />
///</summary>
[TlObject(0x9bed434d)]
public sealed class TInputWebDocument : IInputWebDocument
{
    public uint ConstructorId => 0x9bed434d;
    ///<summary>
    /// Remote document URL to be downloaded using the appropriate <a href="https://corefork.telegram.org/api/files">method</a>
    ///</summary>
    public string Url { get; set; }

    ///<summary>
    /// Remote file size
    ///</summary>
    public int Size { get; set; }

    ///<summary>
    /// Mime type
    ///</summary>
    public string MimeType { get; set; }

    ///<summary>
    /// Attributes for media types
    ///</summary>
    public TVector<MyTelegram.Schema.IDocumentAttribute> Attributes { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Url);
        writer.Write(Size);
        writer.Write(MimeType);
        writer.Write(Attributes);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Url = buffer.ReadString();
        Size = buffer.ReadInt32();
        MimeType = buffer.ReadString();
        Attributes = buffer.Read<TVector<MyTelegram.Schema.IDocumentAttribute>>();
    }
}