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

namespace MyTelegram.Schema;

///<summary>
/// Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
/// See <a href="https://corefork.telegram.org/constructor/secureValueErrorFiles" />
///</summary>
[TlObject(0x666220e9)]
public sealed class TSecureValueErrorFiles : ISecureValueError
{
    public uint ConstructorId => 0x666220e9;
    ///<summary>
    /// One of <a href="https://corefork.telegram.org/constructor/secureValueTypeUtilityBill">secureValueTypeUtilityBill</a>, <a href="https://corefork.telegram.org/constructor/secureValueTypeBankStatement">secureValueTypeBankStatement</a>, <a href="https://corefork.telegram.org/constructor/secureValueTypeRentalAgreement">secureValueTypeRentalAgreement</a>, <a href="https://corefork.telegram.org/constructor/secureValueTypePassportRegistration">secureValueTypePassportRegistration</a>, <a href="https://corefork.telegram.org/constructor/secureValueTypeTemporaryRegistration">secureValueTypeTemporaryRegistration</a>
    /// See <a href="https://corefork.telegram.org/type/SecureValueType" />
    ///</summary>
    public MyTelegram.Schema.ISecureValueType Type { get; set; }

    ///<summary>
    /// File hash
    ///</summary>
    public TVector<ReadOnlyMemory<byte>> FileHash { get; set; }

    ///<summary>
    /// Error message
    ///</summary>
    public string Text { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Type);
        writer.Write(FileHash);
        writer.Write(Text);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Type = buffer.Read<MyTelegram.Schema.ISecureValueType>();
        FileHash = buffer.Read<TVector<ReadOnlyMemory<byte>>>();
        Text = buffer.ReadString();
    }
}