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 ReactionNotificationsFromContacts struct {
}
const ReactionNotificationsFromContactsTypeID = 0xbac3a61a
func (r ReactionNotificationsFromContacts ) construct () ReactionNotificationsFromClass { return &r }
var (
_ bin .Encoder = &ReactionNotificationsFromContacts {}
_ bin .Decoder = &ReactionNotificationsFromContacts {}
_ bin .BareEncoder = &ReactionNotificationsFromContacts {}
_ bin .BareDecoder = &ReactionNotificationsFromContacts {}
_ ReactionNotificationsFromClass = &ReactionNotificationsFromContacts {}
)
func (r *ReactionNotificationsFromContacts ) Zero () bool {
if r == nil {
return true
}
return true
}
func (r *ReactionNotificationsFromContacts ) String () string {
if r == nil {
return "ReactionNotificationsFromContacts(nil)"
}
type Alias ReactionNotificationsFromContacts
return fmt .Sprintf ("ReactionNotificationsFromContacts%+v" , Alias (*r ))
}
func (*ReactionNotificationsFromContacts ) TypeID () uint32 {
return ReactionNotificationsFromContactsTypeID
}
func (*ReactionNotificationsFromContacts ) TypeName () string {
return "reactionNotificationsFromContacts"
}
func (r *ReactionNotificationsFromContacts ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "reactionNotificationsFromContacts" ,
ID : ReactionNotificationsFromContactsTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (r *ReactionNotificationsFromContacts ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode reactionNotificationsFromContacts#bac3a61a as nil" )
}
b .PutID (ReactionNotificationsFromContactsTypeID )
return r .EncodeBare (b )
}
func (r *ReactionNotificationsFromContacts ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode reactionNotificationsFromContacts#bac3a61a as nil" )
}
return nil
}
func (r *ReactionNotificationsFromContacts ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode reactionNotificationsFromContacts#bac3a61a to nil" )
}
if err := b .ConsumeID (ReactionNotificationsFromContactsTypeID ); err != nil {
return fmt .Errorf ("unable to decode reactionNotificationsFromContacts#bac3a61a: %w" , err )
}
return r .DecodeBare (b )
}
func (r *ReactionNotificationsFromContacts ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode reactionNotificationsFromContacts#bac3a61a to nil" )
}
return nil
}
type ReactionNotificationsFromAll struct {
}
const ReactionNotificationsFromAllTypeID = 0x4b9e22a0
func (r ReactionNotificationsFromAll ) construct () ReactionNotificationsFromClass { return &r }
var (
_ bin .Encoder = &ReactionNotificationsFromAll {}
_ bin .Decoder = &ReactionNotificationsFromAll {}
_ bin .BareEncoder = &ReactionNotificationsFromAll {}
_ bin .BareDecoder = &ReactionNotificationsFromAll {}
_ ReactionNotificationsFromClass = &ReactionNotificationsFromAll {}
)
func (r *ReactionNotificationsFromAll ) Zero () bool {
if r == nil {
return true
}
return true
}
func (r *ReactionNotificationsFromAll ) String () string {
if r == nil {
return "ReactionNotificationsFromAll(nil)"
}
type Alias ReactionNotificationsFromAll
return fmt .Sprintf ("ReactionNotificationsFromAll%+v" , Alias (*r ))
}
func (*ReactionNotificationsFromAll ) TypeID () uint32 {
return ReactionNotificationsFromAllTypeID
}
func (*ReactionNotificationsFromAll ) TypeName () string {
return "reactionNotificationsFromAll"
}
func (r *ReactionNotificationsFromAll ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "reactionNotificationsFromAll" ,
ID : ReactionNotificationsFromAllTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (r *ReactionNotificationsFromAll ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode reactionNotificationsFromAll#4b9e22a0 as nil" )
}
b .PutID (ReactionNotificationsFromAllTypeID )
return r .EncodeBare (b )
}
func (r *ReactionNotificationsFromAll ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode reactionNotificationsFromAll#4b9e22a0 as nil" )
}
return nil
}
func (r *ReactionNotificationsFromAll ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode reactionNotificationsFromAll#4b9e22a0 to nil" )
}
if err := b .ConsumeID (ReactionNotificationsFromAllTypeID ); err != nil {
return fmt .Errorf ("unable to decode reactionNotificationsFromAll#4b9e22a0: %w" , err )
}
return r .DecodeBare (b )
}
func (r *ReactionNotificationsFromAll ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode reactionNotificationsFromAll#4b9e22a0 to nil" )
}
return nil
}
const ReactionNotificationsFromClassName = "ReactionNotificationsFrom"
type ReactionNotificationsFromClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () ReactionNotificationsFromClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeReactionNotificationsFrom (buf *bin .Buffer ) (ReactionNotificationsFromClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case ReactionNotificationsFromContactsTypeID :
v := ReactionNotificationsFromContacts {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReactionNotificationsFromClass: %w" , err )
}
return &v , nil
case ReactionNotificationsFromAllTypeID :
v := ReactionNotificationsFromAll {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode ReactionNotificationsFromClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode ReactionNotificationsFromClass: %w" , bin .NewUnexpectedID (id ))
}
}
type ReactionNotificationsFromBox struct {
ReactionNotificationsFrom ReactionNotificationsFromClass
}
func (b *ReactionNotificationsFromBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode ReactionNotificationsFromBox to nil" )
}
v , err := DecodeReactionNotificationsFrom (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .ReactionNotificationsFrom = v
return nil
}
func (b *ReactionNotificationsFromBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .ReactionNotificationsFrom == nil {
return fmt .Errorf ("unable to encode ReactionNotificationsFromClass as nil" )
}
return b .ReactionNotificationsFrom .Encode (buf )
}
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 .