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

// MsgsStateReq represents TL type `msgs_state_req#da69fb52`.
type MsgsStateReq struct {
	// MsgIDs field of MsgsStateReq.
	MsgIDs []int64
}

// MsgsStateReqTypeID is TL type id of MsgsStateReq.
const MsgsStateReqTypeID = 0xda69fb52

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

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

	return true
}

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

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

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

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

// Encode implements bin.Encoder.
func ( *MsgsStateReq) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode msgs_state_req#da69fb52 as nil")
	}
	.PutID(MsgsStateReqTypeID)
	return .EncodeBare()
}

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

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

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

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

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