// Code generated by gotdgen, DO NOT EDIT.

package tg

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

// MessagesGetMessagesReactionsRequest represents TL type `messages.getMessagesReactions#8bba90e6`.
// Get message reactions »¹
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/method/messages.getMessagesReactions for reference.
type MessagesGetMessagesReactionsRequest struct {
	// Peer
	Peer InputPeerClass
	// Message IDs
	ID []int
}

// MessagesGetMessagesReactionsRequestTypeID is TL type id of MessagesGetMessagesReactionsRequest.
const MessagesGetMessagesReactionsRequestTypeID = 0x8bba90e6

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

func ( *MessagesGetMessagesReactionsRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.ID == nil) {
		return false
	}

	return true
}

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

// FillFrom fills MessagesGetMessagesReactionsRequest from given interface.
func ( *MessagesGetMessagesReactionsRequest) ( interface {
	() ( InputPeerClass)
	() ( []int)
}) {
	.Peer = .()
	.ID = .()
}

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

// TypeName returns name of type in TL schema.
func (*MessagesGetMessagesReactionsRequest) () string {
	return "messages.getMessagesReactions"
}

// TypeInfo returns info about TL type.
func ( *MessagesGetMessagesReactionsRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.getMessagesReactions",
		ID:   MessagesGetMessagesReactionsRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesGetMessagesReactionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getMessagesReactions#8bba90e6 as nil")
	}
	.PutID(MessagesGetMessagesReactionsRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesGetMessagesReactionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.getMessagesReactions#8bba90e6 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.getMessagesReactions#8bba90e6: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.getMessagesReactions#8bba90e6: field peer: %w", )
	}
	.PutVectorHeader(len(.ID))
	for ,  := range .ID {
		.PutInt()
	}
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *MessagesGetMessagesReactionsRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.getMessagesReactions#8bba90e6 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getMessagesReactions#8bba90e6: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.getMessagesReactions#8bba90e6: field id: %w", )
		}

		if  > 0 {
			.ID = make([]int, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Int()
			if  != nil {
				return fmt.Errorf("unable to decode messages.getMessagesReactions#8bba90e6: field id: %w", )
			}
			.ID = append(.ID, )
		}
	}
	return nil
}

// GetPeer returns value of Peer field.
func ( *MessagesGetMessagesReactionsRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .Peer
}

// GetID returns value of ID field.
func ( *MessagesGetMessagesReactionsRequest) () ( []int) {
	if  == nil {
		return
	}
	return .ID
}

// MessagesGetMessagesReactions invokes method messages.getMessagesReactions#8bba90e6 returning error if any.
// Get message reactions »¹
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// Possible errors:
//
//	400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup.
//
// See https://core.telegram.org/method/messages.getMessagesReactions for reference.
func ( *Client) ( context.Context,  *MessagesGetMessagesReactionsRequest) (UpdatesClass, error) {
	var  UpdatesBox

	if  := .rpc.Invoke(, , &);  != nil {
		return nil, 
	}
	return .Updates, nil
}