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

namespace MyTelegram.Schema;

///<summary>
/// See <a href="https://corefork.telegram.org/constructor/starGiftAttributeBackdrop" />
///</summary>
[TlObject(0xd93d859c)]
public sealed class TStarGiftAttributeBackdrop : IStarGiftAttribute
{
    public uint ConstructorId => 0xd93d859c;
    public string Name { get; set; }
    public int BackdropId { get; set; }
    public int CenterColor { get; set; }
    public int EdgeColor { get; set; }
    public int PatternColor { get; set; }
    public int TextColor { 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(BackdropId);
        writer.Write(CenterColor);
        writer.Write(EdgeColor);
        writer.Write(PatternColor);
        writer.Write(TextColor);
        writer.Write(RarityPermille);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Name = buffer.ReadString();
        BackdropId = buffer.ReadInt32();
        CenterColor = buffer.ReadInt32();
        EdgeColor = buffer.ReadInt32();
        PatternColor = buffer.ReadInt32();
        TextColor = buffer.ReadInt32();
        RarityPermille = buffer.ReadInt32();
    }
}