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

namespace MyTelegram.Schema;

///<summary>
/// Info about an RTMP stream in a group call or livestream
/// See <a href="https://corefork.telegram.org/constructor/groupCallStreamChannel" />
///</summary>
[TlObject(0x80eb48af)]
public sealed class TGroupCallStreamChannel : IGroupCallStreamChannel
{
    public uint ConstructorId => 0x80eb48af;
    ///<summary>
    /// Channel ID
    ///</summary>
    public int Channel { get; set; }

    ///<summary>
    /// Specifies the duration of the video segment to fetch in milliseconds, by bitshifting <code>1000</code> to the right <code>scale</code> times: <code>duration_ms := 1000 &gt;&gt; scale</code>.
    ///</summary>
    public int Scale { get; set; }

    ///<summary>
    /// Last seen timestamp to easily start fetching livestream chunks using <a href="https://corefork.telegram.org/constructor/inputGroupCallStream">inputGroupCallStream</a>
    ///</summary>
    public long LastTimestampMs { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Channel);
        writer.Write(Scale);
        writer.Write(LastTimestampMs);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Channel = buffer.ReadInt32();
        Scale = buffer.ReadInt32();
        LastTimestampMs = buffer.ReadInt64();
    }
}