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