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

namespace MyTelegram.Schema;

///<summary>
/// Secure <a href="https://corefork.telegram.org/passport">passport</a> data, for more info <a href="https://corefork.telegram.org/passport/encryption#securedata">see the passport docs »</a>
/// See <a href="https://corefork.telegram.org/constructor/secureData" />
///</summary>
[TlObject(0x8aeabec3)]
public sealed class TSecureData : ISecureData
{
    public uint ConstructorId => 0x8aeabec3;
    ///<summary>
    /// Data
    ///</summary>
    public ReadOnlyMemory<byte> Data { get; set; }

    ///<summary>
    /// Data hash
    ///</summary>
    public ReadOnlyMemory<byte> DataHash { get; set; }

    ///<summary>
    /// Secret
    ///</summary>
    public ReadOnlyMemory<byte> Secret { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Data);
        writer.Write(DataHash);
        writer.Write(Secret);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Data = buffer.ReadBytes();
        DataHash = buffer.ReadBytes();
        Secret = buffer.ReadBytes();
    }
}