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

namespace MyTelegram.Schema.Auth;

///<summary>
/// Data for copying of authorization between data centers.
/// See <a href="https://corefork.telegram.org/constructor/auth.exportedAuthorization" />
///</summary>
[TlObject(0xb434e2b8)]
public sealed class TExportedAuthorization : IExportedAuthorization
{
    public uint ConstructorId => 0xb434e2b8;
    ///<summary>
    /// current user identifier
    ///</summary>
    public long Id { get; set; }

    ///<summary>
    /// authorizes key
    ///</summary>
    public ReadOnlyMemory<byte> Bytes { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Id);
        writer.Write(Bytes);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Id = buffer.ReadInt64();
        Bytes = buffer.ReadBytes();
    }
}