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

// MsgResendReq represents TL type `msg_resend_req#7d861a08`.
type MsgResendReq struct {
	// MsgIDs field of MsgResendReq.
	MsgIDs []int64
}

// MsgResendReqTypeID is TL type id of MsgResendReq.
const MsgResendReqTypeID = 0x7d861a08

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

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MsgResendReq) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msg_resend_req#7d861a08 as nil")
	}
	.PutID(MsgResendReqTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MsgResendReq) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msg_resend_req#7d861a08 as nil")
	}
	.PutVectorHeader(len(.MsgIDs))
	for ,  := range .MsgIDs {
		.PutLong()
	}
	return nil
}

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

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

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

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