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 ReadParticipantDate struct {
UserID int64
Date int
}
const ReadParticipantDateTypeID = 0x4a4ff172
var (
_ bin .Encoder = &ReadParticipantDate {}
_ bin .Decoder = &ReadParticipantDate {}
_ bin .BareEncoder = &ReadParticipantDate {}
_ bin .BareDecoder = &ReadParticipantDate {}
)
func (r *ReadParticipantDate ) Zero () bool {
if r == nil {
return true
}
if !(r .UserID == 0 ) {
return false
}
if !(r .Date == 0 ) {
return false
}
return true
}
func (r *ReadParticipantDate ) String () string {
if r == nil {
return "ReadParticipantDate(nil)"
}
type Alias ReadParticipantDate
return fmt .Sprintf ("ReadParticipantDate%+v" , Alias (*r ))
}
func (r *ReadParticipantDate ) FillFrom (from interface {
GetUserID () (value int64 )
GetDate () (value int )
}) {
r .UserID = from .GetUserID ()
r .Date = from .GetDate ()
}
func (*ReadParticipantDate ) TypeID () uint32 {
return ReadParticipantDateTypeID
}
func (*ReadParticipantDate ) TypeName () string {
return "readParticipantDate"
}
func (r *ReadParticipantDate ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "readParticipantDate" ,
ID : ReadParticipantDateTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "UserID" ,
SchemaName : "user_id" ,
},
{
Name : "Date" ,
SchemaName : "date" ,
},
}
return typ
}
func (r *ReadParticipantDate ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode readParticipantDate#4a4ff172 as nil" )
}
b .PutID (ReadParticipantDateTypeID )
return r .EncodeBare (b )
}
func (r *ReadParticipantDate ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode readParticipantDate#4a4ff172 as nil" )
}
b .PutLong (r .UserID )
b .PutInt (r .Date )
return nil
}
func (r *ReadParticipantDate ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode readParticipantDate#4a4ff172 to nil" )
}
if err := b .ConsumeID (ReadParticipantDateTypeID ); err != nil {
return fmt .Errorf ("unable to decode readParticipantDate#4a4ff172: %w" , err )
}
return r .DecodeBare (b )
}
func (r *ReadParticipantDate ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode readParticipantDate#4a4ff172 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode readParticipantDate#4a4ff172: field user_id: %w" , err )
}
r .UserID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode readParticipantDate#4a4ff172: field date: %w" , err )
}
r .Date = value
}
return nil
}
func (r *ReadParticipantDate ) GetUserID () (value int64 ) {
if r == nil {
return
}
return r .UserID
}
func (r *ReadParticipantDate ) GetDate () (value int ) {
if r == nil {
return
}
return r .Date
}
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 .