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

namespace MyTelegram.Schema.Auth;

///<summary>
/// The code was delivered via <a href="https://fragment.com/">fragment.com</a>.
/// See <a href="https://corefork.telegram.org/constructor/auth.sentCodeTypeFragmentSms" />
///</summary>
[TlObject(0xd9565c39)]
public sealed class TSentCodeTypeFragmentSms : ISentCodeType
{
    public uint ConstructorId => 0xd9565c39;
    ///<summary>
    /// Open the specified URL to log into <a href="https://fragment.com/">fragment.com</a> with the wallet that owns the specified phone number and view the code.
    ///</summary>
    public string Url { get; set; }

    ///<summary>
    /// Length of the delivered code.
    ///</summary>
    public int Length { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Url = buffer.ReadString();
        Length = buffer.ReadInt32();
    }
}