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