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

// MessagesReportReactionRequest represents TL type `messages.reportReaction#3f64c076`.
// Report a message reaction¹
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// See https://core.telegram.org/method/messages.reportReaction for reference.
type MessagesReportReactionRequest struct {
	// Peer where the message was sent
	Peer InputPeerClass
	// Message ID
	ID int
	// Peer that sent the reaction
	ReactionPeer InputPeerClass
}

// MessagesReportReactionRequestTypeID is TL type id of MessagesReportReactionRequest.
const MessagesReportReactionRequestTypeID = 0x3f64c076

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

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

	return true
}

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

// FillFrom fills MessagesReportReactionRequest from given interface.
func ( *MessagesReportReactionRequest) ( interface {
	() ( InputPeerClass)
	() ( int)
	() ( InputPeerClass)
}) {
	.Peer = .()
	.ID = .()
	.ReactionPeer = .()
}

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

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

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

// Encode implements bin.Encoder.
func ( *MessagesReportReactionRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.reportReaction#3f64c076 as nil")
	}
	.PutID(MessagesReportReactionRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesReportReactionRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.reportReaction#3f64c076 as nil")
	}
	if .Peer == nil {
		return fmt.Errorf("unable to encode messages.reportReaction#3f64c076: field peer is nil")
	}
	if  := .Peer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.reportReaction#3f64c076: field peer: %w", )
	}
	.PutInt(.ID)
	if .ReactionPeer == nil {
		return fmt.Errorf("unable to encode messages.reportReaction#3f64c076: field reaction_peer is nil")
	}
	if  := .ReactionPeer.Encode();  != nil {
		return fmt.Errorf("unable to encode messages.reportReaction#3f64c076: field reaction_peer: %w", )
	}
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesReportReactionRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.reportReaction#3f64c076 to nil")
	}
	if  := .ConsumeID(MessagesReportReactionRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.reportReaction#3f64c076: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesReportReactionRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.reportReaction#3f64c076 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.reportReaction#3f64c076: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.reportReaction#3f64c076: field id: %w", )
		}
		.ID = 
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.reportReaction#3f64c076: field reaction_peer: %w", )
		}
		.ReactionPeer = 
	}
	return nil
}

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

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

// GetReactionPeer returns value of ReactionPeer field.
func ( *MessagesReportReactionRequest) () ( InputPeerClass) {
	if  == nil {
		return
	}
	return .ReactionPeer
}

// MessagesReportReaction invokes method messages.reportReaction#3f64c076 returning error if any.
// Report a message reaction¹
//
// Links:
//  1. https://core.telegram.org/api/reactions
//
// Possible errors:
//
//	400 MSG_ID_INVALID: Invalid message ID provided.
//	400 USER_ID_INVALID: The provided user ID is invalid.
//
// See https://core.telegram.org/method/messages.reportReaction for reference.
func ( *Client) ( context.Context,  *MessagesReportReactionRequest) (bool, error) {
	var  BoolBox

	if  := .rpc.Invoke(, , &);  != nil {
		return false, 
	}
	,  := .Bool.(*BoolTrue)
	return , nil
}