// Code generated by gotdgen, DO NOT EDIT.

package mt

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// RPCAnswerUnknown represents TL type `rpc_answer_unknown#5e2ad36e`.
type RPCAnswerUnknown struct {
}

// RPCAnswerUnknownTypeID is TL type id of RPCAnswerUnknown.
const RPCAnswerUnknownTypeID = 0x5e2ad36e

// construct implements constructor of RPCDropAnswerClass.
func ( RPCAnswerUnknown) () RPCDropAnswerClass { return & }

// Ensuring interfaces in compile-time for RPCAnswerUnknown.
var (
	_ bin.Encoder     = &RPCAnswerUnknown{}
	_ bin.Decoder     = &RPCAnswerUnknown{}
	_ bin.BareEncoder = &RPCAnswerUnknown{}
	_ bin.BareDecoder = &RPCAnswerUnknown{}

	_ RPCDropAnswerClass = &RPCAnswerUnknown{}
)

func ( *RPCAnswerUnknown) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *RPCAnswerUnknown) () string {
	if  == nil {
		return "RPCAnswerUnknown(nil)"
	}
	type  RPCAnswerUnknown
	return fmt.Sprintf("RPCAnswerUnknown%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*RPCAnswerUnknown) () uint32 {
	return RPCAnswerUnknownTypeID
}

// TypeName returns name of type in TL schema.
func (*RPCAnswerUnknown) () string {
	return "rpc_answer_unknown"
}

// TypeInfo returns info about TL type.
func ( *RPCAnswerUnknown) () tdp.Type {
	 := tdp.Type{
		Name: "rpc_answer_unknown",
		ID:   RPCAnswerUnknownTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *RPCAnswerUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_unknown#5e2ad36e as nil")
	}
	.PutID(RPCAnswerUnknownTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *RPCAnswerUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_unknown#5e2ad36e as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *RPCAnswerUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_unknown#5e2ad36e to nil")
	}
	if  := .ConsumeID(RPCAnswerUnknownTypeID);  != nil {
		return fmt.Errorf("unable to decode rpc_answer_unknown#5e2ad36e: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *RPCAnswerUnknown) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_unknown#5e2ad36e to nil")
	}
	return nil
}

// RPCAnswerDroppedRunning represents TL type `rpc_answer_dropped_running#cd78e586`.
type RPCAnswerDroppedRunning struct {
}

// RPCAnswerDroppedRunningTypeID is TL type id of RPCAnswerDroppedRunning.
const RPCAnswerDroppedRunningTypeID = 0xcd78e586

// construct implements constructor of RPCDropAnswerClass.
func ( RPCAnswerDroppedRunning) () RPCDropAnswerClass { return & }

// Ensuring interfaces in compile-time for RPCAnswerDroppedRunning.
var (
	_ bin.Encoder     = &RPCAnswerDroppedRunning{}
	_ bin.Decoder     = &RPCAnswerDroppedRunning{}
	_ bin.BareEncoder = &RPCAnswerDroppedRunning{}
	_ bin.BareDecoder = &RPCAnswerDroppedRunning{}

	_ RPCDropAnswerClass = &RPCAnswerDroppedRunning{}
)

func ( *RPCAnswerDroppedRunning) () bool {
	if  == nil {
		return true
	}

	return true
}

// String implements fmt.Stringer.
func ( *RPCAnswerDroppedRunning) () string {
	if  == nil {
		return "RPCAnswerDroppedRunning(nil)"
	}
	type  RPCAnswerDroppedRunning
	return fmt.Sprintf("RPCAnswerDroppedRunning%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*RPCAnswerDroppedRunning) () uint32 {
	return RPCAnswerDroppedRunningTypeID
}

// TypeName returns name of type in TL schema.
func (*RPCAnswerDroppedRunning) () string {
	return "rpc_answer_dropped_running"
}

// TypeInfo returns info about TL type.
func ( *RPCAnswerDroppedRunning) () tdp.Type {
	 := tdp.Type{
		Name: "rpc_answer_dropped_running",
		ID:   RPCAnswerDroppedRunningTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{}
	return 
}

// Encode implements bin.Encoder.
func ( *RPCAnswerDroppedRunning) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_dropped_running#cd78e586 as nil")
	}
	.PutID(RPCAnswerDroppedRunningTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *RPCAnswerDroppedRunning) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_dropped_running#cd78e586 as nil")
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *RPCAnswerDroppedRunning) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_dropped_running#cd78e586 to nil")
	}
	if  := .ConsumeID(RPCAnswerDroppedRunningTypeID);  != nil {
		return fmt.Errorf("unable to decode rpc_answer_dropped_running#cd78e586: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *RPCAnswerDroppedRunning) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_dropped_running#cd78e586 to nil")
	}
	return nil
}

// RPCAnswerDropped represents TL type `rpc_answer_dropped#a43ad8b7`.
type RPCAnswerDropped struct {
	// MsgID field of RPCAnswerDropped.
	MsgID int64
	// SeqNo field of RPCAnswerDropped.
	SeqNo int
	// Bytes field of RPCAnswerDropped.
	Bytes int
}

// RPCAnswerDroppedTypeID is TL type id of RPCAnswerDropped.
const RPCAnswerDroppedTypeID = 0xa43ad8b7

// construct implements constructor of RPCDropAnswerClass.
func ( RPCAnswerDropped) () RPCDropAnswerClass { return & }

// Ensuring interfaces in compile-time for RPCAnswerDropped.
var (
	_ bin.Encoder     = &RPCAnswerDropped{}
	_ bin.Decoder     = &RPCAnswerDropped{}
	_ bin.BareEncoder = &RPCAnswerDropped{}
	_ bin.BareDecoder = &RPCAnswerDropped{}

	_ RPCDropAnswerClass = &RPCAnswerDropped{}
)

func ( *RPCAnswerDropped) () bool {
	if  == nil {
		return true
	}
	if !(.MsgID == 0) {
		return false
	}
	if !(.SeqNo == 0) {
		return false
	}
	if !(.Bytes == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *RPCAnswerDropped) () string {
	if  == nil {
		return "RPCAnswerDropped(nil)"
	}
	type  RPCAnswerDropped
	return fmt.Sprintf("RPCAnswerDropped%+v", (*))
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*RPCAnswerDropped) () uint32 {
	return RPCAnswerDroppedTypeID
}

// TypeName returns name of type in TL schema.
func (*RPCAnswerDropped) () string {
	return "rpc_answer_dropped"
}

// TypeInfo returns info about TL type.
func ( *RPCAnswerDropped) () tdp.Type {
	 := tdp.Type{
		Name: "rpc_answer_dropped",
		ID:   RPCAnswerDroppedTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "MsgID",
			SchemaName: "msg_id",
		},
		{
			Name:       "SeqNo",
			SchemaName: "seq_no",
		},
		{
			Name:       "Bytes",
			SchemaName: "bytes",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *RPCAnswerDropped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_dropped#a43ad8b7 as nil")
	}
	.PutID(RPCAnswerDroppedTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *RPCAnswerDropped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode rpc_answer_dropped#a43ad8b7 as nil")
	}
	.PutLong(.MsgID)
	.PutInt(.SeqNo)
	.PutInt(.Bytes)
	return nil
}

// Decode implements bin.Decoder.
func ( *RPCAnswerDropped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_dropped#a43ad8b7 to nil")
	}
	if  := .ConsumeID(RPCAnswerDroppedTypeID);  != nil {
		return fmt.Errorf("unable to decode rpc_answer_dropped#a43ad8b7: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *RPCAnswerDropped) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode rpc_answer_dropped#a43ad8b7 to nil")
	}
	{
		,  := .Long()
		if  != nil {
			return fmt.Errorf("unable to decode rpc_answer_dropped#a43ad8b7: field msg_id: %w", )
		}
		.MsgID = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode rpc_answer_dropped#a43ad8b7: field seq_no: %w", )
		}
		.SeqNo = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode rpc_answer_dropped#a43ad8b7: field bytes: %w", )
		}
		.Bytes = 
	}
	return nil
}

// GetMsgID returns value of MsgID field.
func ( *RPCAnswerDropped) () ( int64) {
	if  == nil {
		return
	}
	return .MsgID
}

// GetSeqNo returns value of SeqNo field.
func ( *RPCAnswerDropped) () ( int) {
	if  == nil {
		return
	}
	return .SeqNo
}

// GetBytes returns value of Bytes field.
func ( *RPCAnswerDropped) () ( int) {
	if  == nil {
		return
	}
	return .Bytes
}

// RPCDropAnswerClassName is schema name of RPCDropAnswerClass.
const RPCDropAnswerClassName = "RpcDropAnswer"

// RPCDropAnswerClass represents RpcDropAnswer generic type.
//
// Example:
//
//	g, err := mt.DecodeRPCDropAnswer(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *mt.RPCAnswerUnknown: // rpc_answer_unknown#5e2ad36e
//	case *mt.RPCAnswerDroppedRunning: // rpc_answer_dropped_running#cd78e586
//	case *mt.RPCAnswerDropped: // rpc_answer_dropped#a43ad8b7
//	default: panic(v)
//	}
type RPCDropAnswerClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() RPCDropAnswerClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool
}

// DecodeRPCDropAnswer implements binary de-serialization for RPCDropAnswerClass.
func ( *bin.Buffer) (RPCDropAnswerClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case RPCAnswerUnknownTypeID:
		// Decoding rpc_answer_unknown#5e2ad36e.
		 := RPCAnswerUnknown{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode RPCDropAnswerClass: %w", )
		}
		return &, nil
	case RPCAnswerDroppedRunningTypeID:
		// Decoding rpc_answer_dropped_running#cd78e586.
		 := RPCAnswerDroppedRunning{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode RPCDropAnswerClass: %w", )
		}
		return &, nil
	case RPCAnswerDroppedTypeID:
		// Decoding rpc_answer_dropped#a43ad8b7.
		 := RPCAnswerDropped{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode RPCDropAnswerClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode RPCDropAnswerClass: %w", bin.NewUnexpectedID())
	}
}

// RPCDropAnswer boxes the RPCDropAnswerClass providing a helper.
type RPCDropAnswerBox struct {
	RpcDropAnswer RPCDropAnswerClass
}

// Decode implements bin.Decoder for RPCDropAnswerBox.
func ( *RPCDropAnswerBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode RPCDropAnswerBox to nil")
	}
	,  := DecodeRPCDropAnswer()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.RpcDropAnswer = 
	return nil
}

// Encode implements bin.Encode for RPCDropAnswerBox.
func ( *RPCDropAnswerBox) ( *bin.Buffer) error {
	if  == nil || .RpcDropAnswer == nil {
		return fmt.Errorf("unable to encode RPCDropAnswerClass as nil")
	}
	return .RpcDropAnswer.Encode()
}