package mt
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 MsgsAck struct {
MsgIDs []int64
}
const MsgsAckTypeID = 0x62d6b459
var (
_ bin .Encoder = &MsgsAck {}
_ bin .Decoder = &MsgsAck {}
_ bin .BareEncoder = &MsgsAck {}
_ bin .BareDecoder = &MsgsAck {}
)
func (m *MsgsAck ) Zero () bool {
if m == nil {
return true
}
if !(m .MsgIDs == nil ) {
return false
}
return true
}
func (m *MsgsAck ) String () string {
if m == nil {
return "MsgsAck(nil)"
}
type Alias MsgsAck
return fmt .Sprintf ("MsgsAck%+v" , Alias (*m ))
}
func (*MsgsAck ) TypeID () uint32 {
return MsgsAckTypeID
}
func (*MsgsAck ) TypeName () string {
return "msgs_ack"
}
func (m *MsgsAck ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "msgs_ack" ,
ID : MsgsAckTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MsgIDs" ,
SchemaName : "msg_ids" ,
},
}
return typ
}
func (m *MsgsAck ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msgs_ack#62d6b459 as nil" )
}
b .PutID (MsgsAckTypeID )
return m .EncodeBare (b )
}
func (m *MsgsAck ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msgs_ack#62d6b459 as nil" )
}
b .PutVectorHeader (len (m .MsgIDs ))
for _ , v := range m .MsgIDs {
b .PutLong (v )
}
return nil
}
func (m *MsgsAck ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msgs_ack#62d6b459 to nil" )
}
if err := b .ConsumeID (MsgsAckTypeID ); err != nil {
return fmt .Errorf ("unable to decode msgs_ack#62d6b459: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MsgsAck ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msgs_ack#62d6b459 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode msgs_ack#62d6b459: field msg_ids: %w" , err )
}
if headerLen > 0 {
m .MsgIDs = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode msgs_ack#62d6b459: field msg_ids: %w" , err )
}
m .MsgIDs = append (m .MsgIDs , value )
}
}
return nil
}
func (m *MsgsAck ) GetMsgIDs () (value []int64 ) {
if m == nil {
return
}
return m .MsgIDs
}
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 .