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

namespace MyTelegram.Schema;

///<summary>
/// Describes a <a href="https://corefork.telegram.org/api/revenue#withdrawing-revenue">refund for failed withdrawal of ad earnings »</a>
/// See <a href="https://corefork.telegram.org/constructor/broadcastRevenueTransactionRefund" />
///</summary>
[TlObject(0x42d30d2e)]
public sealed class TBroadcastRevenueTransactionRefund : IBroadcastRevenueTransaction
{
    public uint ConstructorId => 0x42d30d2e;
    ///<summary>
    /// Amount refunded.
    ///</summary>
    public long Amount { get; set; }

    ///<summary>
    /// Date of refund.
    ///</summary>
    public int Date { get; set; }

    ///<summary>
    /// Payment provider name.
    ///</summary>
    public string Provider { get; set; }

    public void ComputeFlag()
    {

    }

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

    public void Deserialize(ref ReadOnlyMemory<byte> buffer)
    {
        Amount = buffer.ReadInt64();
        Date = buffer.ReadInt32();
        Provider = buffer.ReadString();
    }
}