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

// MessagesEditQuickReplyShortcutRequest represents TL type `messages.editQuickReplyShortcut#5c003cef`.
// Rename a quick reply shortcut¹.
// This will emit an updateQuickReplies² update to other logged-in sessions.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//  2. https://core.telegram.org/constructor/updateQuickReplies
//
// See https://core.telegram.org/method/messages.editQuickReplyShortcut for reference.
type MessagesEditQuickReplyShortcutRequest struct {
	// Shortcut ID¹.
	//
	// Links:
	//  1) https://core.telegram.org/api/business#quick-reply-shortcuts
	ShortcutID int
	// New shortcut name.
	Shortcut string
}

// MessagesEditQuickReplyShortcutRequestTypeID is TL type id of MessagesEditQuickReplyShortcutRequest.
const MessagesEditQuickReplyShortcutRequestTypeID = 0x5c003cef

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

func ( *MessagesEditQuickReplyShortcutRequest) () bool {
	if  == nil {
		return true
	}
	if !(.ShortcutID == 0) {
		return false
	}
	if !(.Shortcut == "") {
		return false
	}

	return true
}

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

// FillFrom fills MessagesEditQuickReplyShortcutRequest from given interface.
func ( *MessagesEditQuickReplyShortcutRequest) ( interface {
	() ( int)
	() ( string)
}) {
	.ShortcutID = .()
	.Shortcut = .()
}

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

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

// TypeInfo returns info about TL type.
func ( *MessagesEditQuickReplyShortcutRequest) () tdp.Type {
	 := tdp.Type{
		Name: "messages.editQuickReplyShortcut",
		ID:   MessagesEditQuickReplyShortcutRequestTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
		{
			Name:       "Shortcut",
			SchemaName: "shortcut",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *MessagesEditQuickReplyShortcutRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.editQuickReplyShortcut#5c003cef as nil")
	}
	.PutID(MessagesEditQuickReplyShortcutRequestTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *MessagesEditQuickReplyShortcutRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode messages.editQuickReplyShortcut#5c003cef as nil")
	}
	.PutInt(.ShortcutID)
	.PutString(.Shortcut)
	return nil
}

// Decode implements bin.Decoder.
func ( *MessagesEditQuickReplyShortcutRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.editQuickReplyShortcut#5c003cef to nil")
	}
	if  := .ConsumeID(MessagesEditQuickReplyShortcutRequestTypeID);  != nil {
		return fmt.Errorf("unable to decode messages.editQuickReplyShortcut#5c003cef: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *MessagesEditQuickReplyShortcutRequest) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode messages.editQuickReplyShortcut#5c003cef to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode messages.editQuickReplyShortcut#5c003cef: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode messages.editQuickReplyShortcut#5c003cef: field shortcut: %w", )
		}
		.Shortcut = 
	}
	return nil
}

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

// GetShortcut returns value of Shortcut field.
func ( *MessagesEditQuickReplyShortcutRequest) () ( string) {
	if  == nil {
		return
	}
	return .Shortcut
}

// MessagesEditQuickReplyShortcut invokes method messages.editQuickReplyShortcut#5c003cef returning error if any.
// Rename a quick reply shortcut¹.
// This will emit an updateQuickReplies² update to other logged-in sessions.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//  2. https://core.telegram.org/constructor/updateQuickReplies
//
// Possible errors:
//
//	403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action.
//	400 SHORTCUT_INVALID: The specified shortcut is invalid.
//
// See https://core.telegram.org/method/messages.editQuickReplyShortcut for reference.
func ( *Client) ( context.Context,  *MessagesEditQuickReplyShortcutRequest) (bool, error) {
	var  BoolBox

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