// 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{}
)

// MsgsAllInfo represents TL type `msgs_all_info#8cc0d131`.
type MsgsAllInfo struct {
	// MsgIDs field of MsgsAllInfo.
	MsgIDs []int64
	// Info field of MsgsAllInfo.
	Info []byte
}

// MsgsAllInfoTypeID is TL type id of MsgsAllInfo.
const MsgsAllInfoTypeID = 0x8cc0d131

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

func ( *MsgsAllInfo) () bool {
	if  == nil {
		return true
	}
	if !(.MsgIDs == nil) {
		return false
	}
	if !(.Info == nil) {
		return false
	}

	return true
}

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

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

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

// TypeInfo returns info about TL type.
func ( *MsgsAllInfo) () tdp.Type {
	 := tdp.Type{
		Name: "msgs_all_info",
		ID:   MsgsAllInfoTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "MsgIDs",
			SchemaName: "msg_ids",
		},
		{
			Name:       "Info",
			SchemaName: "info",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MsgsAllInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msgs_all_info#8cc0d131 as nil")
	}
	.PutID(MsgsAllInfoTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MsgsAllInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msgs_all_info#8cc0d131 as nil")
	}
	.PutVectorHeader(len(.MsgIDs))
	for ,  := range .MsgIDs {
		.PutLong()
	}
	.PutBytes(.Info)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MsgsAllInfo) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode msgs_all_info#8cc0d131 to nil")
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode msgs_all_info#8cc0d131: field msg_ids: %w", )
		}

		if  > 0 {
			.MsgIDs = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode msgs_all_info#8cc0d131: field msg_ids: %w", )
			}
			.MsgIDs = append(.MsgIDs, )
		}
	}
	{
		,  := .Bytes()
		if  != nil {
			return fmt.Errorf("unable to decode msgs_all_info#8cc0d131: field info: %w", )
		}
		.Info = 
	}
	return nil
}

// GetMsgIDs returns value of MsgIDs field.
func ( *MsgsAllInfo) () ( []int64) {
	if  == nil {
		return
	}
	return .MsgIDs
}

// GetInfo returns value of Info field.
func ( *MsgsAllInfo) () ( []byte) {
	if  == nil {
		return
	}
	return .Info
}