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 MsgDetailedInfo struct {
MsgID int64
AnswerMsgID int64
Bytes int
Status int
}
const MsgDetailedInfoTypeID = 0x276d3ec6
func (m MsgDetailedInfo ) construct () MsgDetailedInfoClass { return &m }
var (
_ bin .Encoder = &MsgDetailedInfo {}
_ bin .Decoder = &MsgDetailedInfo {}
_ bin .BareEncoder = &MsgDetailedInfo {}
_ bin .BareDecoder = &MsgDetailedInfo {}
_ MsgDetailedInfoClass = &MsgDetailedInfo {}
)
func (m *MsgDetailedInfo ) Zero () bool {
if m == nil {
return true
}
if !(m .MsgID == 0 ) {
return false
}
if !(m .AnswerMsgID == 0 ) {
return false
}
if !(m .Bytes == 0 ) {
return false
}
if !(m .Status == 0 ) {
return false
}
return true
}
func (m *MsgDetailedInfo ) String () string {
if m == nil {
return "MsgDetailedInfo(nil)"
}
type Alias MsgDetailedInfo
return fmt .Sprintf ("MsgDetailedInfo%+v" , Alias (*m ))
}
func (*MsgDetailedInfo ) TypeID () uint32 {
return MsgDetailedInfoTypeID
}
func (*MsgDetailedInfo ) TypeName () string {
return "msg_detailed_info"
}
func (m *MsgDetailedInfo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "msg_detailed_info" ,
ID : MsgDetailedInfoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "AnswerMsgID" ,
SchemaName : "answer_msg_id" ,
},
{
Name : "Bytes" ,
SchemaName : "bytes" ,
},
{
Name : "Status" ,
SchemaName : "status" ,
},
}
return typ
}
func (m *MsgDetailedInfo ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msg_detailed_info#276d3ec6 as nil" )
}
b .PutID (MsgDetailedInfoTypeID )
return m .EncodeBare (b )
}
func (m *MsgDetailedInfo ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msg_detailed_info#276d3ec6 as nil" )
}
b .PutLong (m .MsgID )
b .PutLong (m .AnswerMsgID )
b .PutInt (m .Bytes )
b .PutInt (m .Status )
return nil
}
func (m *MsgDetailedInfo ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msg_detailed_info#276d3ec6 to nil" )
}
if err := b .ConsumeID (MsgDetailedInfoTypeID ); err != nil {
return fmt .Errorf ("unable to decode msg_detailed_info#276d3ec6: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MsgDetailedInfo ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msg_detailed_info#276d3ec6 to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode msg_detailed_info#276d3ec6: field msg_id: %w" , err )
}
m .MsgID = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode msg_detailed_info#276d3ec6: field answer_msg_id: %w" , err )
}
m .AnswerMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode msg_detailed_info#276d3ec6: field bytes: %w" , err )
}
m .Bytes = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode msg_detailed_info#276d3ec6: field status: %w" , err )
}
m .Status = value
}
return nil
}
func (m *MsgDetailedInfo ) GetMsgID () (value int64 ) {
if m == nil {
return
}
return m .MsgID
}
func (m *MsgDetailedInfo ) GetAnswerMsgID () (value int64 ) {
if m == nil {
return
}
return m .AnswerMsgID
}
func (m *MsgDetailedInfo ) GetBytes () (value int ) {
if m == nil {
return
}
return m .Bytes
}
func (m *MsgDetailedInfo ) GetStatus () (value int ) {
if m == nil {
return
}
return m .Status
}
type MsgNewDetailedInfo struct {
AnswerMsgID int64
Bytes int
Status int
}
const MsgNewDetailedInfoTypeID = 0x809db6df
func (m MsgNewDetailedInfo ) construct () MsgDetailedInfoClass { return &m }
var (
_ bin .Encoder = &MsgNewDetailedInfo {}
_ bin .Decoder = &MsgNewDetailedInfo {}
_ bin .BareEncoder = &MsgNewDetailedInfo {}
_ bin .BareDecoder = &MsgNewDetailedInfo {}
_ MsgDetailedInfoClass = &MsgNewDetailedInfo {}
)
func (m *MsgNewDetailedInfo ) Zero () bool {
if m == nil {
return true
}
if !(m .AnswerMsgID == 0 ) {
return false
}
if !(m .Bytes == 0 ) {
return false
}
if !(m .Status == 0 ) {
return false
}
return true
}
func (m *MsgNewDetailedInfo ) String () string {
if m == nil {
return "MsgNewDetailedInfo(nil)"
}
type Alias MsgNewDetailedInfo
return fmt .Sprintf ("MsgNewDetailedInfo%+v" , Alias (*m ))
}
func (*MsgNewDetailedInfo ) TypeID () uint32 {
return MsgNewDetailedInfoTypeID
}
func (*MsgNewDetailedInfo ) TypeName () string {
return "msg_new_detailed_info"
}
func (m *MsgNewDetailedInfo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "msg_new_detailed_info" ,
ID : MsgNewDetailedInfoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "AnswerMsgID" ,
SchemaName : "answer_msg_id" ,
},
{
Name : "Bytes" ,
SchemaName : "bytes" ,
},
{
Name : "Status" ,
SchemaName : "status" ,
},
}
return typ
}
func (m *MsgNewDetailedInfo ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msg_new_detailed_info#809db6df as nil" )
}
b .PutID (MsgNewDetailedInfoTypeID )
return m .EncodeBare (b )
}
func (m *MsgNewDetailedInfo ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msg_new_detailed_info#809db6df as nil" )
}
b .PutLong (m .AnswerMsgID )
b .PutInt (m .Bytes )
b .PutInt (m .Status )
return nil
}
func (m *MsgNewDetailedInfo ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msg_new_detailed_info#809db6df to nil" )
}
if err := b .ConsumeID (MsgNewDetailedInfoTypeID ); err != nil {
return fmt .Errorf ("unable to decode msg_new_detailed_info#809db6df: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MsgNewDetailedInfo ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msg_new_detailed_info#809db6df to nil" )
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode msg_new_detailed_info#809db6df: field answer_msg_id: %w" , err )
}
m .AnswerMsgID = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode msg_new_detailed_info#809db6df: field bytes: %w" , err )
}
m .Bytes = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode msg_new_detailed_info#809db6df: field status: %w" , err )
}
m .Status = value
}
return nil
}
func (m *MsgNewDetailedInfo ) GetAnswerMsgID () (value int64 ) {
if m == nil {
return
}
return m .AnswerMsgID
}
func (m *MsgNewDetailedInfo ) GetBytes () (value int ) {
if m == nil {
return
}
return m .Bytes
}
func (m *MsgNewDetailedInfo ) GetStatus () (value int ) {
if m == nil {
return
}
return m .Status
}
const MsgDetailedInfoClassName = "MsgDetailedInfo"
type MsgDetailedInfoClass interface {
bin .Encoder
bin .Decoder
bin .BareEncoder
bin .BareDecoder
construct () MsgDetailedInfoClass
TypeID () uint32
TypeName () string
String () string
Zero () bool
GetAnswerMsgID () (value int64 )
GetBytes () (value int )
GetStatus () (value int )
}
func DecodeMsgDetailedInfo (buf *bin .Buffer ) (MsgDetailedInfoClass , error ) {
id , err := buf .PeekID ()
if err != nil {
return nil , err
}
switch id {
case MsgDetailedInfoTypeID :
v := MsgDetailedInfo {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MsgDetailedInfoClass: %w" , err )
}
return &v , nil
case MsgNewDetailedInfoTypeID :
v := MsgNewDetailedInfo {}
if err := v .Decode (buf ); err != nil {
return nil , fmt .Errorf ("unable to decode MsgDetailedInfoClass: %w" , err )
}
return &v , nil
default :
return nil , fmt .Errorf ("unable to decode MsgDetailedInfoClass: %w" , bin .NewUnexpectedID (id ))
}
}
type MsgDetailedInfoBox struct {
MsgDetailedInfo MsgDetailedInfoClass
}
func (b *MsgDetailedInfoBox ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("unable to decode MsgDetailedInfoBox to nil" )
}
v , err := DecodeMsgDetailedInfo (buf )
if err != nil {
return fmt .Errorf ("unable to decode boxed value: %w" , err )
}
b .MsgDetailedInfo = v
return nil
}
func (b *MsgDetailedInfoBox ) Encode (buf *bin .Buffer ) error {
if b == nil || b .MsgDetailedInfo == nil {
return fmt .Errorf ("unable to encode MsgDetailedInfoClass as nil" )
}
return b .MsgDetailedInfo .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 .