Source File
tl_account_paid_messages_revenue_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// No-op definition for keeping imports.var (_ = bin.Buffer{}_ = context.Background()_ = fmt.Stringer(nil)_ = strings.Builder{}_ = errors.Is_ = multierr.AppendInto_ = sort.Ints_ = tdp.Format_ = tgerr.Error{}_ = tdjson.Encoder{})// AccountPaidMessagesRevenue represents TL type `account.paidMessagesRevenue#1e109708`.// Total number of non-refunded Telegram Stars¹ a user has spent on sending us messages// either directly or through a channel, see here »² for more info on paid messages.//// Links:// 1. https://core.telegram.org/api/stars// 2. https://core.telegram.org/api/paid-messages//// See https://core.telegram.org/constructor/account.paidMessagesRevenue for reference.type AccountPaidMessagesRevenue struct {// Amount in Stars¹.//// Links:// 1) https://core.telegram.org/api/starsStarsAmount int64}// AccountPaidMessagesRevenueTypeID is TL type id of AccountPaidMessagesRevenue.const AccountPaidMessagesRevenueTypeID = 0x1e109708// Ensuring interfaces in compile-time for AccountPaidMessagesRevenue.var (_ bin.Encoder = &AccountPaidMessagesRevenue{}_ bin.Decoder = &AccountPaidMessagesRevenue{}_ bin.BareEncoder = &AccountPaidMessagesRevenue{}_ bin.BareDecoder = &AccountPaidMessagesRevenue{})func ( *AccountPaidMessagesRevenue) () bool {if == nil {return true}if !(.StarsAmount == 0) {return false}return true}// String implements fmt.Stringer.func ( *AccountPaidMessagesRevenue) () string {if == nil {return "AccountPaidMessagesRevenue(nil)"}type AccountPaidMessagesRevenuereturn fmt.Sprintf("AccountPaidMessagesRevenue%+v", (*))}// FillFrom fills AccountPaidMessagesRevenue from given interface.func ( *AccountPaidMessagesRevenue) ( interface {() ( int64)}) {.StarsAmount = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*AccountPaidMessagesRevenue) () uint32 {return AccountPaidMessagesRevenueTypeID}// TypeName returns name of type in TL schema.func (*AccountPaidMessagesRevenue) () string {return "account.paidMessagesRevenue"}// TypeInfo returns info about TL type.func ( *AccountPaidMessagesRevenue) () tdp.Type {:= tdp.Type{Name: "account.paidMessagesRevenue",ID: AccountPaidMessagesRevenueTypeID,}if == nil {.Null = truereturn}.Fields = []tdp.Field{{Name: "StarsAmount",SchemaName: "stars_amount",},}return}// Encode implements bin.Encoder.func ( *AccountPaidMessagesRevenue) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode account.paidMessagesRevenue#1e109708 as nil")}.PutID(AccountPaidMessagesRevenueTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *AccountPaidMessagesRevenue) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode account.paidMessagesRevenue#1e109708 as nil")}.PutLong(.StarsAmount)return nil}// Decode implements bin.Decoder.func ( *AccountPaidMessagesRevenue) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode account.paidMessagesRevenue#1e109708 to nil")}if := .ConsumeID(AccountPaidMessagesRevenueTypeID); != nil {return fmt.Errorf("unable to decode account.paidMessagesRevenue#1e109708: %w", )}return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *AccountPaidMessagesRevenue) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode account.paidMessagesRevenue#1e109708 to nil")}{, := .Long()if != nil {return fmt.Errorf("unable to decode account.paidMessagesRevenue#1e109708: field stars_amount: %w", )}.StarsAmount =}return nil}// GetStarsAmount returns value of StarsAmount field.func ( *AccountPaidMessagesRevenue) () ( int64) {if == nil {return}return .StarsAmount}
![]() |
The pages are generated with Golds v0.8.4. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |