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 RPCAnswerUnknown struct {
}
const RPCAnswerUnknownTypeID = 0x5e2ad36e
func (r RPCAnswerUnknown ) construct () RPCDropAnswerClass { return &r }
var (
_ bin .Encoder = &RPCAnswerUnknown {}
_ bin .Decoder = &RPCAnswerUnknown {}
_ bin .BareEncoder = &RPCAnswerUnknown {}
_ bin .BareDecoder = &RPCAnswerUnknown {}
_ RPCDropAnswerClass = &RPCAnswerUnknown {}
)
func (r *RPCAnswerUnknown ) Zero () bool {
if r == nil {
return true
}
return true
}
func (r *RPCAnswerUnknown ) String () string {
if r == nil {
return "RPCAnswerUnknown(nil)"
}
type Alias RPCAnswerUnknown
return fmt .Sprintf ("RPCAnswerUnknown%+v" , Alias (*r ))
}
func (*RPCAnswerUnknown ) TypeID () uint32 {
return RPCAnswerUnknownTypeID
}
func (*RPCAnswerUnknown ) TypeName () string {
return "rpc_answer_unknown"
}
func (r *RPCAnswerUnknown ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "rpc_answer_unknown" ,
ID : RPCAnswerUnknownTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (r *RPCAnswerUnknown ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_unknown#5e2ad36e as nil" )
}
b .PutID (RPCAnswerUnknownTypeID )
return r .EncodeBare (b )
}
func (r *RPCAnswerUnknown ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_unknown#5e2ad36e as nil" )
}
return nil
}
func (r *RPCAnswerUnknown ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_unknown#5e2ad36e to nil" )
}
if err := b .ConsumeID (RPCAnswerUnknownTypeID ); err != nil {
return fmt .Errorf ("unable to decode rpc_answer_unknown#5e2ad36e: %w" , err )
}
return r .DecodeBare (b )
}
func (r *RPCAnswerUnknown ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_unknown#5e2ad36e to nil" )
}
return nil
}
type RPCAnswerDroppedRunning struct {
}
const RPCAnswerDroppedRunningTypeID = 0xcd78e586
func (r RPCAnswerDroppedRunning ) construct () RPCDropAnswerClass { return &r }
var (
_ bin .Encoder = &RPCAnswerDroppedRunning {}
_ bin .Decoder = &RPCAnswerDroppedRunning {}
_ bin .BareEncoder = &RPCAnswerDroppedRunning {}
_ bin .BareDecoder = &RPCAnswerDroppedRunning {}
_ RPCDropAnswerClass = &RPCAnswerDroppedRunning {}
)
func (r *RPCAnswerDroppedRunning ) Zero () bool {
if r == nil {
return true
}
return true
}
func (r *RPCAnswerDroppedRunning ) String () string {
if r == nil {
return "RPCAnswerDroppedRunning(nil)"
}
type Alias RPCAnswerDroppedRunning
return fmt .Sprintf ("RPCAnswerDroppedRunning%+v" , Alias (*r ))
}
func (*RPCAnswerDroppedRunning ) TypeID () uint32 {
return RPCAnswerDroppedRunningTypeID
}
func (*RPCAnswerDroppedRunning ) TypeName () string {
return "rpc_answer_dropped_running"
}
func (r *RPCAnswerDroppedRunning ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "rpc_answer_dropped_running" ,
ID : RPCAnswerDroppedRunningTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {}
return typ
}
func (r *RPCAnswerDroppedRunning ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_dropped_running#cd78e586 as nil" )
}
b .PutID (RPCAnswerDroppedRunningTypeID )
return r .EncodeBare (b )
}
func (r *RPCAnswerDroppedRunning ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_dropped_running#cd78e586 as nil" )
}
return nil
}
func (r *RPCAnswerDroppedRunning ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_dropped_running#cd78e586 to nil" )
}
if err := b .ConsumeID (RPCAnswerDroppedRunningTypeID ); err != nil {
return fmt .Errorf ("unable to decode rpc_answer_dropped_running#cd78e586: %w" , err )
}
return r .DecodeBare (b )
}
func (r *RPCAnswerDroppedRunning ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_dropped_running#cd78e586 to nil" )
}
return nil
}
type RPCAnswerDropped struct {
MsgID int64
SeqNo int
Bytes int
}
const RPCAnswerDroppedTypeID = 0xa43ad8b7
func (r RPCAnswerDropped ) construct () RPCDropAnswerClass { return &r }
var (
_ bin .Encoder = &RPCAnswerDropped {}
_ bin .Decoder = &RPCAnswerDropped {}
_ bin .BareEncoder = &RPCAnswerDropped {}
_ bin .BareDecoder = &RPCAnswerDropped {}
_ RPCDropAnswerClass = &RPCAnswerDropped {}
)
func (r *RPCAnswerDropped ) Zero () bool {
if r == nil {
return true
}
if !(r .MsgID == 0 ) {
return false
}
if !(r .SeqNo == 0 ) {
return false
}
if !(r .Bytes == 0 ) {
return false
}
return true
}
func (r *RPCAnswerDropped ) String () string {
if r == nil {
return "RPCAnswerDropped(nil)"
}
type Alias RPCAnswerDropped
return fmt .Sprintf ("RPCAnswerDropped%+v" , Alias (*r ))
}
func (*RPCAnswerDropped ) TypeID () uint32 {
return RPCAnswerDroppedTypeID
}
func (*RPCAnswerDropped ) TypeName () string {
return "rpc_answer_dropped"
}
func (r *RPCAnswerDropped ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "rpc_answer_dropped" ,
ID : RPCAnswerDroppedTypeID ,
}
if r == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "SeqNo" ,
SchemaName : "seq_no" ,
},
{
Name : "Bytes" ,
SchemaName : "bytes" ,
},
}
return typ
}
func (r *RPCAnswerDropped ) Encode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_dropped#a43ad8b7 as nil" )
}
b .PutID (RPCAnswerDroppedTypeID )
return r .EncodeBare (b )
}
func (r *RPCAnswerDropped ) EncodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't encode rpc_answer_dropped#a43ad8b7 as nil" )
}
b .PutLong (r .MsgID )
b .PutInt (r .SeqNo )
b .PutInt (r .Bytes )
return nil
}
func (r *RPCAnswerDropped ) Decode (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_dropped#a43ad8b7 to nil" )
}
if err := b .ConsumeID (RPCAnswerDroppedTypeID ); err != nil {
return fmt .Errorf ("unable to decode rpc_answer_dropped#a43ad8b7: %w" , err )
}
return r .DecodeBare (b )
}
func (r *RPCAnswerDropped ) DecodeBare (b *bin .Buffer ) error {
if r == nil {
return fmt .Errorf ("can't decode rpc_answer_dropped#a43ad8b7 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode rpc_answer_dropped#a43ad8b7: field msg_id: %w" , err )
}
r .MsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode rpc_answer_dropped#a43ad8b7: field seq_no: %w" , err )
}
r .SeqNo = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode rpc_answer_dropped#a43ad8b7: field bytes: %w" , err )
}
r .Bytes = value
}
return nil
}
func (r *RPCAnswerDropped ) GetMsgID () (value int64 ) {
if r == nil {
return
}
return r .MsgID
}
func (r *RPCAnswerDropped ) GetSeqNo () (value int ) {
if r == nil {
return
}
return r .SeqNo
}
func (r *RPCAnswerDropped ) GetBytes () (value int ) {
if r == nil {
return
}
return r .Bytes
}
const RPCDropAnswerClassName = "RpcDropAnswer"
type RPCDropAnswerClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () RPCDropAnswerClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
}
func DecodeRPCDropAnswer (buf *bin .Buffer ) (RPCDropAnswerClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case RPCAnswerUnknownTypeID :
v := RPCAnswerUnknown {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RPCDropAnswerClass: %w" , err )
}
return &v , nil
case RPCAnswerDroppedRunningTypeID :
v := RPCAnswerDroppedRunning {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RPCDropAnswerClass: %w" , err )
}
return &v , nil
case RPCAnswerDroppedTypeID :
v := RPCAnswerDropped {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode RPCDropAnswerClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode RPCDropAnswerClass: %w" , bin .NewUnexpectedID (id ))
}
}
type RPCDropAnswerBox struct {
RpcDropAnswer RPCDropAnswerClass
}
func (b *RPCDropAnswerBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode RPCDropAnswerBox to nil" )
}
v , err := DecodeRPCDropAnswer (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .RpcDropAnswer = v
return nil
}
func (b *RPCDropAnswerBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .RpcDropAnswer == nil {
return fmt .Errorf ("unable to encode RPCDropAnswerClass as nil" )
}
return b .RpcDropAnswer .Encode (buf )
}
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 .