package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type StatsPollStats struct {
VotesGraph StatsGraphClass
}
const StatsPollStatsTypeID = 0x2999beed
var (
_ bin .Encoder = &StatsPollStats {}
_ bin .Decoder = &StatsPollStats {}
_ bin .BareEncoder = &StatsPollStats {}
_ bin .BareDecoder = &StatsPollStats {}
)
func (p *StatsPollStats ) Zero () bool {
if p == nil {
return true
}
if !(p .VotesGraph == nil ) {
return false
}
return true
}
func (p *StatsPollStats ) String () string {
if p == nil {
return "StatsPollStats(nil)"
}
type Alias StatsPollStats
return fmt .Sprintf ("StatsPollStats%+v" , Alias (*p ))
}
func (p *StatsPollStats ) FillFrom (from interface {
GetVotesGraph () (value StatsGraphClass )
}) {
p .VotesGraph = from .GetVotesGraph ()
}
func (*StatsPollStats ) TypeID () uint32 {
return StatsPollStatsTypeID
}
func (*StatsPollStats ) TypeName () string {
return "stats.pollStats"
}
func (p *StatsPollStats ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "stats.pollStats" ,
ID : StatsPollStatsTypeID ,
}
if p == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "VotesGraph" ,
SchemaName : "votes_graph" ,
},
}
return typ
}
func (p *StatsPollStats ) Encode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode stats.pollStats#2999beed as nil" )
}
b .PutID (StatsPollStatsTypeID )
return p .EncodeBare (b )
}
func (p *StatsPollStats ) EncodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't encode stats.pollStats#2999beed as nil" )
}
if p .VotesGraph == nil {
return fmt .Errorf ("unable to encode stats.pollStats#2999beed: field votes_graph is nil" )
}
if err := p .VotesGraph .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode stats.pollStats#2999beed: field votes_graph: %w" , err )
}
return nil
}
func (p *StatsPollStats ) Decode (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode stats.pollStats#2999beed to nil" )
}
if err := b .ConsumeID (StatsPollStatsTypeID ); err != nil {
return fmt .Errorf ("unable to decode stats.pollStats#2999beed: %w" , err )
}
return p .DecodeBare (b )
}
func (p *StatsPollStats ) DecodeBare (b *bin .Buffer ) error {
if p == nil {
return fmt .Errorf ("can't decode stats.pollStats#2999beed to nil" )
}
{
value , err := DecodeStatsGraph (b )
if err != nil {
return fmt .Errorf ("unable to decode stats.pollStats#2999beed: field votes_graph: %w" , err )
}
p .VotesGraph = value
}
return nil
}
func (p *StatsPollStats ) GetVotesGraph () (value StatsGraphClass ) {
if p == nil {
return
}
return p .VotesGraph
}
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 .