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

namespace MyTelegram.Schema;

///<summary>
/// Creates an encrypted chat.
/// See <a href="https://corefork.telegram.org/constructor/inputEncryptedChat" />
///</summary>
[TlObject(0xf141b5e1)]
public sealed class TInputEncryptedChat : IInputEncryptedChat
{
    public uint ConstructorId => 0xf141b5e1;
    ///<summary>
    /// Chat ID
    ///</summary>
    public int ChatId { get; set; }

    ///<summary>
    /// Checking sum from constructor <a href="https://corefork.telegram.org/constructor/encryptedChat">encryptedChat</a>, <a href="https://corefork.telegram.org/constructor/encryptedChatWaiting">encryptedChatWaiting</a> or <a href="https://corefork.telegram.org/constructor/encryptedChatRequested">encryptedChatRequested</a>
    ///</summary>
    public long AccessHash { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        ChatId = buffer.ReadInt32();
        AccessHash = buffer.ReadInt64();
    }
}