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

namespace MyTelegram.Schema;

///<summary>
/// Restriction reason.Contains the reason why access to a certain object must be restricted. Clients are supposed to deny access to the channel if the <code>platform</code> field is equal to <code>all</code> or to the current platform (<code>ios</code>, <code>android</code>, <code>wp</code>, etc.). Platforms can be concatenated (<code>ios-android</code>, <code>ios-wp</code>), unknown platforms are to be ignored. The <code>text</code> is the error message that should be shown to the user.
/// See <a href="https://corefork.telegram.org/constructor/restrictionReason" />
///</summary>
[TlObject(0xd072acb4)]
public sealed class TRestrictionReason : IRestrictionReason
{
    public uint ConstructorId => 0xd072acb4;
    ///<summary>
    /// Platform identifier (ios, android, wp, all, etc.), can be concatenated with a dash as separator (<code>android-ios</code>, <code>ios-wp</code>, etc)
    ///</summary>
    public string Platform { get; set; }

    ///<summary>
    /// Restriction reason (<code>porno</code>, <code>terms</code>, etc.)
    ///</summary>
    public string Reason { get; set; }

    ///<summary>
    /// Error message to be shown to the user
    ///</summary>
    public string Text { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Platform);
        writer.Write(Reason);
        writer.Write(Text);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Platform = buffer.ReadString();
        Reason = buffer.ReadString();
        Text = buffer.ReadString();
    }
}