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

namespace MyTelegram.Schema;

///<summary>
/// A chat invitation that also allows peeking into the group to read messages without joining it.
/// See <a href="https://corefork.telegram.org/constructor/chatInvitePeek" />
///</summary>
[TlObject(0x61695cb0)]
public sealed class TChatInvitePeek : IChatInvite
{
    public uint ConstructorId => 0x61695cb0;
    ///<summary>
    /// Chat information
    /// See <a href="https://corefork.telegram.org/type/Chat" />
    ///</summary>
    public MyTelegram.Schema.IChat Chat { get; set; }

    ///<summary>
    /// Read-only anonymous access to this group will be revoked at this date
    ///</summary>
    public int Expires { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Chat = buffer.Read<MyTelegram.Schema.IChat>();
        Expires = buffer.ReadInt32();
    }
}