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

namespace MyTelegram.Schema;

///<summary>
/// Privacy rules were changed
/// See <a href="https://corefork.telegram.org/constructor/updatePrivacy" />
///</summary>
[TlObject(0xee3b272a)]
public sealed class TUpdatePrivacy : IUpdate
{
    public uint ConstructorId => 0xee3b272a;
    ///<summary>
    /// Peers to which the privacy rules apply
    /// See <a href="https://corefork.telegram.org/type/PrivacyKey" />
    ///</summary>
    public MyTelegram.Schema.IPrivacyKey Key { get; set; }

    ///<summary>
    /// New privacy rules
    ///</summary>
    public TVector<MyTelegram.Schema.IPrivacyRule> Rules { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Key);
        writer.Write(Rules);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Key = buffer.Read<MyTelegram.Schema.IPrivacyKey>();
        Rules = buffer.Read<TVector<MyTelegram.Schema.IPrivacyRule>>();
    }
}