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

namespace MyTelegram.Schema;

///<summary>
/// See <a href="https://corefork.telegram.org/constructor/starGiftAttributeModel" />
///</summary>
[TlObject(0x39d99013)]
public sealed class TStarGiftAttributeModel : IStarGiftAttribute
{
    public uint ConstructorId => 0x39d99013;
    public string Name { get; set; }
    public MyTelegram.Schema.IDocument Document { get; set; }
    public int RarityPermille { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Name);
        writer.Write(Document);
        writer.Write(RarityPermille);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Name = buffer.ReadString();
        Document = buffer.Read<MyTelegram.Schema.IDocument>();
        RarityPermille = buffer.ReadInt32();
    }
}