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

namespace MyTelegram.Schema.E2e;


[TlObject(0x8A847E7F)]
public sealed class TSharedKey : ISharedKey
{
    public uint ConstructorId => 0x8A847E7F;
    public ReadOnlyMemory<byte> Ek { get; set; }
    public string EncryptedSharedKey { get; set; }
    public TVector<long> DestUserId { get; set; }
    public TVector<ReadOnlyMemory<byte>> DestHeader { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.WriteRawBytes(Ek);
        writer.Write(EncryptedSharedKey);
        writer.WriteVector(DestUserId);
        writer.WriteVector(DestHeader);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Ek = buffer.ReadInt256();
        EncryptedSharedKey = buffer.ReadString();
        DestUserId = buffer.ReadVector<long>();
        DestHeader = buffer.ReadVector<ReadOnlyMemory<byte>>();
    }
}