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

// MessagesSendQuickReplyMessagesRequest represents TL type `messages.sendQuickReplyMessages#6c750de1`.
// Send a quick reply shortcut »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/method/messages.sendQuickReplyMessages for reference.
type MessagesSendQuickReplyMessagesRequest struct {
	// The peer where to send the shortcut (users only, for now).
	Peer InputPeerClass
	// The ID of the quick reply shortcut to send.
	ShortcutID int
	// Specify a subset of messages from the shortcut to send; if empty, defaults to all of
	// them.
	ID []int
	// Unique client IDs required to prevent message resending, one for each message we're
	// sending, may be empty (but not recommended).
	RandomID []int64
}

// MessagesSendQuickReplyMessagesRequestTypeID is TL type id of MessagesSendQuickReplyMessagesRequest.
const MessagesSendQuickReplyMessagesRequestTypeID = 0x6c750de1

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

func ( *MessagesSendQuickReplyMessagesRequest) () bool {
	if  == nil {
		return true
	}
	if !(.Peer == nil) {
		return false
	}
	if !(.ShortcutID == 0) {
		return false
	}
	if !(.ID == nil) {
		return false
	}
	if !(.RandomID == nil) {
		return false
	}

	return true
}

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

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

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

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

// TypeInfo returns info about TL type.
func ( *MessagesSendQuickReplyMessagesRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.sendQuickReplyMessages",
		ID:   MessagesSendQuickReplyMessagesRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Peer",
			SchemaName: "peer",
		},
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
		{
			Name:       "ID",
			SchemaName: "id",
		},
		{
			Name:       "RandomID",
			SchemaName: "random_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesSendQuickReplyMessagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.sendQuickReplyMessages#6c750de1 as nil")
	}
	.PutID(MessagesSendQuickReplyMessagesRequestTypeID)
	return .EncodeBare()
}

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

// Decode implements bin.Decoder.
func ( *MessagesSendQuickReplyMessagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.sendQuickReplyMessages#6c750de1 to nil")
	}
	if  := .ConsumeID(MessagesSendQuickReplyMessagesRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.sendQuickReplyMessages#6c750de1: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesSendQuickReplyMessagesRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.sendQuickReplyMessages#6c750de1 to nil")
	}
	{
		,  := DecodeInputPeer()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendQuickReplyMessages#6c750de1: field peer: %w", )
		}
		.Peer = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendQuickReplyMessages#6c750de1: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	{
		,  := .VectorHeader()
		if  != nil {
			return fmt.Errorf("unable to decode messages.sendQuickReplyMessages#6c750de1: field id: %w", )
		}

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

		if  > 0 {
			.RandomID = make([]int64, 0, %bin.PreallocateLimit)
		}
		for  := 0;  < ; ++ {
			,  := .Long()
			if  != nil {
				return fmt.Errorf("unable to decode messages.sendQuickReplyMessages#6c750de1: field random_id: %w", )
			}
			.RandomID = append(.RandomID, )
		}
	}
	return nil
}

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

// GetShortcutID returns value of ShortcutID field.
func ( *MessagesSendQuickReplyMessagesRequest) () ( int) {
	if  == nil {
		return
	}
	return .ShortcutID
}

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

// GetRandomID returns value of RandomID field.
func ( *MessagesSendQuickReplyMessagesRequest) () ( []int64) {
	if  == nil {
		return
	}
	return .RandomID
}

// MessagesSendQuickReplyMessages invokes method messages.sendQuickReplyMessages#6c750de1 returning error if any.
// Send a quick reply shortcut »¹.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// Possible errors:
//
//	400 PEER_ID_INVALID: The provided peer id is invalid.
//	403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action.
//
// See https://core.telegram.org/method/messages.sendQuickReplyMessages for reference.
func ( *Client) ( context.Context,  *MessagesSendQuickReplyMessagesRequest) (UpdatesClass, error) {
	var  UpdatesBox

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