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

namespace MyTelegram.Schema;

///<summary>
/// Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
/// See <a href="https://corefork.telegram.org/constructor/secureValueErrorFile" />
///</summary>
[TlObject(0x7a700873)]
public sealed class TSecureValueErrorFile : ISecureValueError
{
    public uint ConstructorId => 0x7a700873;
    ///<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 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.ReadBytes();
        Text = buffer.ReadString();
    }
}