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 StatsDateRangeDays struct {
MinDate int
MaxDate int
}
const StatsDateRangeDaysTypeID = 0xb637edaf
var (
_ bin .Encoder = &StatsDateRangeDays {}
_ bin .Decoder = &StatsDateRangeDays {}
_ bin .BareEncoder = &StatsDateRangeDays {}
_ bin .BareDecoder = &StatsDateRangeDays {}
)
func (s *StatsDateRangeDays ) Zero () bool {
if s == nil {
return true
}
if !(s .MinDate == 0 ) {
return false
}
if !(s .MaxDate == 0 ) {
return false
}
return true
}
func (s *StatsDateRangeDays ) String () string {
if s == nil {
return "StatsDateRangeDays(nil)"
}
type Alias StatsDateRangeDays
return fmt .Sprintf ("StatsDateRangeDays%+v" , Alias (*s ))
}
func (s *StatsDateRangeDays ) FillFrom (from interface {
GetMinDate () (value int )
GetMaxDate () (value int )
}) {
s .MinDate = from .GetMinDate ()
s .MaxDate = from .GetMaxDate ()
}
func (*StatsDateRangeDays ) TypeID () uint32 {
return StatsDateRangeDaysTypeID
}
func (*StatsDateRangeDays ) TypeName () string {
return "statsDateRangeDays"
}
func (s *StatsDateRangeDays ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "statsDateRangeDays" ,
ID : StatsDateRangeDaysTypeID ,
}
if s == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MinDate" ,
SchemaName : "min_date" ,
},
{
Name : "MaxDate" ,
SchemaName : "max_date" ,
},
}
return typ
}
func (s *StatsDateRangeDays ) Encode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode statsDateRangeDays#b637edaf as nil" )
}
b .PutID (StatsDateRangeDaysTypeID )
return s .EncodeBare (b )
}
func (s *StatsDateRangeDays ) EncodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't encode statsDateRangeDays#b637edaf as nil" )
}
b .PutInt (s .MinDate )
b .PutInt (s .MaxDate )
return nil
}
func (s *StatsDateRangeDays ) Decode (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode statsDateRangeDays#b637edaf to nil" )
}
if err := b .ConsumeID (StatsDateRangeDaysTypeID ); err != nil {
return fmt .Errorf ("unable to decode statsDateRangeDays#b637edaf: %w" , err )
}
return s .DecodeBare (b )
}
func (s *StatsDateRangeDays ) DecodeBare (b *bin .Buffer ) error {
if s == nil {
return fmt .Errorf ("can't decode statsDateRangeDays#b637edaf to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode statsDateRangeDays#b637edaf: field min_date: %w" , err )
}
s .MinDate = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode statsDateRangeDays#b637edaf: field max_date: %w" , err )
}
s .MaxDate = value
}
return nil
}
func (s *StatsDateRangeDays ) GetMinDate () (value int ) {
if s == nil {
return
}
return s .MinDate
}
func (s *StatsDateRangeDays ) GetMaxDate () (value int ) {
if s == nil {
return
}
return s .MaxDate
}
The pages are generated with Golds v0.6.7 . (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .