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

namespace MyTelegram.Schema;

///<summary>
/// Describes earnings from sponsored messages in a channel in some time frame, see <a href="https://corefork.telegram.org/api/revenue">here »</a> for more info.
/// See <a href="https://corefork.telegram.org/constructor/broadcastRevenueTransactionProceeds" />
///</summary>
[TlObject(0x557e2cc4)]
public sealed class TBroadcastRevenueTransactionProceeds : IBroadcastRevenueTransaction
{
    public uint ConstructorId => 0x557e2cc4;
    ///<summary>
    /// Amount in the smallest unit of the cryptocurrency.
    ///</summary>
    public long Amount { get; set; }

    ///<summary>
    /// Start unixtime for the timeframe.
    ///</summary>
    public int FromDate { get; set; }

    ///<summary>
    /// End unixtime for the timeframe.
    ///</summary>
    public int ToDate { get; set; }

    public void ComputeFlag()
    {

    }

    public void Serialize(IBufferWriter<byte> writer)
    {
        ComputeFlag();
        writer.Write(ConstructorId);
        writer.Write(Amount);
        writer.Write(FromDate);
        writer.Write(ToDate);
    }

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Amount = buffer.ReadInt64();
        FromDate = buffer.ReadInt32();
        ToDate = buffer.ReadInt32();
    }
}