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

namespace MyTelegram.Schema;

///<summary>
/// Secure settings
/// See <a href="https://corefork.telegram.org/constructor/secureSecretSettings" />
///</summary>
[TlObject(0x1527bcac)]
public sealed class TSecureSecretSettings : ISecureSecretSettings
{
    public uint ConstructorId => 0x1527bcac;
    ///<summary>
    /// Secure KDF algo
    /// See <a href="https://corefork.telegram.org/type/SecurePasswordKdfAlgo" />
    ///</summary>
    public MyTelegram.Schema.ISecurePasswordKdfAlgo SecureAlgo { get; set; }

    ///<summary>
    /// Secure secret
    ///</summary>
    public ReadOnlyMemory<byte> SecureSecret { get; set; }

    ///<summary>
    /// Secret ID
    ///</summary>
    public long SecureSecretId { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(SecureAlgo);
        writer.Write(SecureSecret);
        writer.Write(SecureSecretId);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        SecureAlgo = buffer.Read<MyTelegram.Schema.ISecurePasswordKdfAlgo>();
        SecureSecret = buffer.ReadBytes();
        SecureSecretId = buffer.ReadInt64();
    }
}