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

namespace MyTelegram.Schema;

///<summary>
/// Remote document that can be downloaded without <a href="https://corefork.telegram.org/api/files">proxying through telegram</a>
/// See <a href="https://corefork.telegram.org/constructor/webDocumentNoProxy" />
///</summary>
[TlObject(0xf9c8bcc6)]
public sealed class TWebDocumentNoProxy : IWebDocument
{
    public uint ConstructorId => 0xf9c8bcc6;
    ///<summary>
    /// Document URL
    ///</summary>
    public string Url { get; set; }

    ///<summary>
    /// 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>>();
    }
}