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 InvokeAfterMsgRequest struct {
MsgID int64
Query bin .Object
}
const InvokeAfterMsgRequestTypeID = 0xcb9f372d
var (
_ bin .Encoder = &InvokeAfterMsgRequest {}
_ bin .Decoder = &InvokeAfterMsgRequest {}
_ bin .BareEncoder = &InvokeAfterMsgRequest {}
_ bin .BareDecoder = &InvokeAfterMsgRequest {}
)
func (i *InvokeAfterMsgRequest ) Zero () bool {
if i == nil {
return true
}
if !(i .MsgID == 0 ) {
return false
}
if !(i .Query == nil ) {
return false
}
return true
}
func (i *InvokeAfterMsgRequest ) String () string {
if i == nil {
return "InvokeAfterMsgRequest(nil)"
}
type Alias InvokeAfterMsgRequest
return fmt .Sprintf ("InvokeAfterMsgRequest%+v" , Alias (*i ))
}
func (i *InvokeAfterMsgRequest ) FillFrom (from interface {
GetMsgID () (value int64 )
GetQuery () (value bin .Object )
}) {
i .MsgID = from .GetMsgID ()
i .Query = from .GetQuery ()
}
func (*InvokeAfterMsgRequest ) TypeID () uint32 {
return InvokeAfterMsgRequestTypeID
}
func (*InvokeAfterMsgRequest ) TypeName () string {
return "invokeAfterMsg"
}
func (i *InvokeAfterMsgRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "invokeAfterMsg" ,
ID : InvokeAfterMsgRequestTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "Query" ,
SchemaName : "query" ,
},
}
return typ
}
func (i *InvokeAfterMsgRequest ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeAfterMsg#cb9f372d as nil" )
}
b .PutID (InvokeAfterMsgRequestTypeID )
return i .EncodeBare (b )
}
func (i *InvokeAfterMsgRequest ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode invokeAfterMsg#cb9f372d as nil" )
}
b .PutLong (i .MsgID )
if err := i .Query .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode invokeAfterMsg#cb9f372d: field query: %w" , err )
}
return nil
}
func (i *InvokeAfterMsgRequest ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeAfterMsg#cb9f372d to nil" )
}
if err := b .ConsumeID (InvokeAfterMsgRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode invokeAfterMsg#cb9f372d: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InvokeAfterMsgRequest ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode invokeAfterMsg#cb9f372d to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode invokeAfterMsg#cb9f372d: field msg_id: %w" , err )
}
i .MsgID = value
}
{
if err := i .Query .Decode (b ); err != nil {
return fmt .Errorf ("unable to decode invokeAfterMsg#cb9f372d: field query: %w" , err )
}
}
return nil
}
func (i *InvokeAfterMsgRequest ) GetMsgID () (value int64 ) {
if i == nil {
return
}
return i .MsgID
}
func (i *InvokeAfterMsgRequest ) 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 .