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 MessagesAffectedMessages struct {
Pts int
PtsCount int
}
const MessagesAffectedMessagesTypeID = 0x84d19185
var (
_ bin .Encoder = &MessagesAffectedMessages {}
_ bin .Decoder = &MessagesAffectedMessages {}
_ bin .BareEncoder = &MessagesAffectedMessages {}
_ bin .BareDecoder = &MessagesAffectedMessages {}
)
func (a *MessagesAffectedMessages ) Zero () bool {
if a == nil {
return true
}
if !(a .Pts == 0 ) {
return false
}
if !(a .PtsCount == 0 ) {
return false
}
return true
}
func (a *MessagesAffectedMessages ) String () string {
if a == nil {
return "MessagesAffectedMessages(nil)"
}
type Alias MessagesAffectedMessages
return fmt .Sprintf ("MessagesAffectedMessages%+v" , Alias (*a ))
}
func (a *MessagesAffectedMessages ) FillFrom (from interface {
GetPts () (value int )
GetPtsCount () (value int )
}) {
a .Pts = from .GetPts ()
a .PtsCount = from .GetPtsCount ()
}
func (*MessagesAffectedMessages ) TypeID () uint32 {
return MessagesAffectedMessagesTypeID
}
func (*MessagesAffectedMessages ) TypeName () string {
return "messages.affectedMessages"
}
func (a *MessagesAffectedMessages ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.affectedMessages" ,
ID : MessagesAffectedMessagesTypeID ,
}
if a == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Pts" ,
SchemaName : "pts" ,
},
{
Name : "PtsCount" ,
SchemaName : "pts_count" ,
},
}
return typ
}
func (a *MessagesAffectedMessages ) Encode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode messages.affectedMessages#84d19185 as nil" )
}
b .PutID (MessagesAffectedMessagesTypeID )
return a .EncodeBare (b )
}
func (a *MessagesAffectedMessages ) EncodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't encode messages.affectedMessages#84d19185 as nil" )
}
b .PutInt (a .Pts )
b .PutInt (a .PtsCount )
return nil
}
func (a *MessagesAffectedMessages ) Decode (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode messages.affectedMessages#84d19185 to nil" )
}
if err := b .ConsumeID (MessagesAffectedMessagesTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.affectedMessages#84d19185: %w" , err )
}
return a .DecodeBare (b )
}
func (a *MessagesAffectedMessages ) DecodeBare (b *bin .Buffer ) error {
if a == nil {
return fmt .Errorf ("can't decode messages.affectedMessages#84d19185 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.affectedMessages#84d19185: field pts: %w" , err )
}
a .Pts = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.affectedMessages#84d19185: field pts_count: %w" , err )
}
a .PtsCount = value
}
return nil
}
func (a *MessagesAffectedMessages ) GetPts () (value int ) {
if a == nil {
return
}
return a .Pts
}
func (a *MessagesAffectedMessages ) GetPtsCount () (value int ) {
if a == nil {
return
}
return a .PtsCount
}
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 .