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

namespace MyTelegram.Schema;

///<summary>
/// Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.
/// See <a href="https://corefork.telegram.org/constructor/secureValueErrorReverseSide" />
///</summary>
[TlObject(0x868a2aa5)]
public sealed class TSecureValueErrorReverseSide : ISecureValueError
{
    public uint ConstructorId => 0x868a2aa5;
    ///<summary>
    /// One of <a href="https://corefork.telegram.org/constructor/secureValueTypeDriverLicense">secureValueTypeDriverLicense</a>, <a href="https://corefork.telegram.org/constructor/secureValueTypeIdentityCard">secureValueTypeIdentityCard</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();
    }
}