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 ReceivedNotifyMessage struct {
ID int
Flags int
}
const ReceivedNotifyMessageTypeID = 0xa384b779
var (
_ bin .Encoder = &ReceivedNotifyMessage {}
_ bin .Decoder = &ReceivedNotifyMessage {}
_ bin .BareEncoder = &ReceivedNotifyMessage {}
_ bin .BareDecoder = &ReceivedNotifyMessage {}
)
func (r *ReceivedNotifyMessage ) Zero () bool {
if r == nil {
return true
}
if !(r .ID == 0 ) {
return false
}
if !(r .Flags == 0 ) {
return false
}
return true
}
func (r *ReceivedNotifyMessage ) String () string {
if r == nil {
return "ReceivedNotifyMessage(nil)"
}
type Alias ReceivedNotifyMessage
return fmt .Sprintf ("ReceivedNotifyMessage%+v" , Alias (*r ))
}
func (r *ReceivedNotifyMessage ) FillFrom (from interface {
GetID () (value int )
GetFlags () (value int )
}) {
r .ID = from .GetID ()
r .Flags = from .GetFlags ()
}
func (*ReceivedNotifyMessage ) TypeID () uint32 {
return ReceivedNotifyMessageTypeID
}
func (*ReceivedNotifyMessage ) TypeName () string {
return "receivedNotifyMessage"
}
func (r *ReceivedNotifyMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "receivedNotifyMessage" ,
ID : ReceivedNotifyMessageTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "Flags" ,
SchemaName : "flags" ,
},
}
return typ
}
func (r *ReceivedNotifyMessage ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode receivedNotifyMessage#a384b779 as nil" )
}
b .PutID (ReceivedNotifyMessageTypeID )
return r .EncodeBare (b )
}
func (r *ReceivedNotifyMessage ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode receivedNotifyMessage#a384b779 as nil" )
}
b .PutInt (r .ID )
b .PutInt (r .Flags )
return nil
}
func (r *ReceivedNotifyMessage ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode receivedNotifyMessage#a384b779 to nil" )
}
if err := b .ConsumeID (ReceivedNotifyMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode receivedNotifyMessage#a384b779: %w" , err )
}
return r .DecodeBare (b )
}
func (r *ReceivedNotifyMessage ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode receivedNotifyMessage#a384b779 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode receivedNotifyMessage#a384b779: field id: %w" , err )
}
r .ID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode receivedNotifyMessage#a384b779: field flags: %w" , err )
}
r .Flags = value
}
return nil
}
func (r *ReceivedNotifyMessage ) GetID () (value int ) {
if r == nil {
return
}
return r .ID
}
func (r *ReceivedNotifyMessage ) GetFlags () (value int ) {
if r == nil {
return
}
return r .Flags
}
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 .