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

namespace MyTelegram.Schema.Langpack;

///<summary>
/// Get new strings in language pack
/// <para>Possible errors</para>
/// Code Type Description
/// 400 LANG_PACK_INVALID The provided language pack is invalid.
/// See <a href="https://corefork.telegram.org/method/langpack.getDifference" />
///</summary>
[TlObject(0xcd984aa5)]
public sealed class RequestGetDifference : IRequest<MyTelegram.Schema.ILangPackDifference>
{
    public uint ConstructorId => 0xcd984aa5;
    ///<summary>
    /// Platform identifier (i.e. <code>android</code>, <code>tdesktop</code>, etc).
    ///</summary>
    public string LangPack { get; set; }

    ///<summary>
    /// Either an ISO 639-1 language code or a language pack name obtained from a <a href="https://corefork.telegram.org/api/links#language-pack-links">language pack link</a>.
    ///</summary>
    public string LangCode { get; set; }

    ///<summary>
    /// Previous localization pack version
    ///</summary>
    public int FromVersion { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(LangPack);
        writer.Write(LangCode);
        writer.Write(FromVersion);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        LangPack = buffer.ReadString();
        LangCode = buffer.ReadString();
        FromVersion = buffer.ReadInt32();
    }
}
