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

namespace MyTelegram.Schema;

///<summary>
/// See <a href="https://corefork.telegram.org/constructor/starGiftAttributePattern" />
///</summary>
[TlObject(0x13acff19)]
public sealed class TStarGiftAttributePattern : IStarGiftAttribute
{
    public uint ConstructorId => 0x13acff19;
    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();
    }
}