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

// InputQuickReplyShortcut represents TL type `inputQuickReplyShortcut#24596d41`.
// Selects a quick reply shortcut¹ by name.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/inputQuickReplyShortcut for reference.
type InputQuickReplyShortcut struct {
	// Shortcut name.
	Shortcut string
}

// InputQuickReplyShortcutTypeID is TL type id of InputQuickReplyShortcut.
const InputQuickReplyShortcutTypeID = 0x24596d41

// construct implements constructor of InputQuickReplyShortcutClass.
func ( InputQuickReplyShortcut) () InputQuickReplyShortcutClass { return & }

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

	_ InputQuickReplyShortcutClass = &InputQuickReplyShortcut{}
)

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

	return true
}

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

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

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

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

// TypeInfo returns info about TL type.
func ( *InputQuickReplyShortcut) () tdp.Type {
	 := tdp.Type{
		Name: "inputQuickReplyShortcut",
		ID:   InputQuickReplyShortcutTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Shortcut",
			SchemaName: "shortcut",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputQuickReplyShortcut) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputQuickReplyShortcut#24596d41 as nil")
	}
	.PutID(InputQuickReplyShortcutTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputQuickReplyShortcut) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputQuickReplyShortcut#24596d41 as nil")
	}
	.PutString(.Shortcut)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputQuickReplyShortcut) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputQuickReplyShortcut#24596d41 to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputQuickReplyShortcut#24596d41: field shortcut: %w", )
		}
		.Shortcut = 
	}
	return nil
}

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

// InputQuickReplyShortcutID represents TL type `inputQuickReplyShortcutId#1190cf1`.
// Selects a quick reply shortcut¹ by its numeric ID.
//
// Links:
//  1. https://core.telegram.org/api/business#quick-reply-shortcuts
//
// See https://core.telegram.org/constructor/inputQuickReplyShortcutId for reference.
type InputQuickReplyShortcutID struct {
	// Shortcut ID.
	ShortcutID int
}

// InputQuickReplyShortcutIDTypeID is TL type id of InputQuickReplyShortcutID.
const InputQuickReplyShortcutIDTypeID = 0x1190cf1

// construct implements constructor of InputQuickReplyShortcutClass.
func ( InputQuickReplyShortcutID) () InputQuickReplyShortcutClass { return & }

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

	_ InputQuickReplyShortcutClass = &InputQuickReplyShortcutID{}
)

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

	return true
}

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

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

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

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

// TypeInfo returns info about TL type.
func ( *InputQuickReplyShortcutID) () tdp.Type {
	 := tdp.Type{
		Name: "inputQuickReplyShortcutId",
		ID:   InputQuickReplyShortcutIDTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "ShortcutID",
			SchemaName: "shortcut_id",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputQuickReplyShortcutID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputQuickReplyShortcutId#1190cf1 as nil")
	}
	.PutID(InputQuickReplyShortcutIDTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputQuickReplyShortcutID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputQuickReplyShortcutId#1190cf1 as nil")
	}
	.PutInt(.ShortcutID)
	return nil
}

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

// DecodeBare implements bin.BareDecoder.
func ( *InputQuickReplyShortcutID) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputQuickReplyShortcutId#1190cf1 to nil")
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputQuickReplyShortcutId#1190cf1: field shortcut_id: %w", )
		}
		.ShortcutID = 
	}
	return nil
}

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

// InputQuickReplyShortcutClassName is schema name of InputQuickReplyShortcutClass.
const InputQuickReplyShortcutClassName = "InputQuickReplyShortcut"

// InputQuickReplyShortcutClass represents InputQuickReplyShortcut generic type.
//
// See https://core.telegram.org/type/InputQuickReplyShortcut for reference.
//
// Constructors:
//   - [InputQuickReplyShortcut]
//   - [InputQuickReplyShortcutID]
//
// Example:
//
//	g, err := tg.DecodeInputQuickReplyShortcut(buf)
//	if err != nil {
//	    panic(err)
//	}
//	switch v := g.(type) {
//	case *tg.InputQuickReplyShortcut: // inputQuickReplyShortcut#24596d41
//	case *tg.InputQuickReplyShortcutID: // inputQuickReplyShortcutId#1190cf1
//	default: panic(v)
//	}
type InputQuickReplyShortcutClass interface {
	bin.Encoder
	bin.Decoder
	bin.BareEncoder
	bin.BareDecoder
	construct() InputQuickReplyShortcutClass

	// TypeID returns type id in TL schema.
	//
	// See https://core.telegram.org/mtproto/TL-tl#remarks.
	TypeID() uint32
	// TypeName returns name of type in TL schema.
	TypeName() string
	// String implements fmt.Stringer.
	String() string
	// Zero returns true if current object has a zero value.
	Zero() bool
}

// DecodeInputQuickReplyShortcut implements binary de-serialization for InputQuickReplyShortcutClass.
func ( *bin.Buffer) (InputQuickReplyShortcutClass, error) {
	,  := .PeekID()
	if  != nil {
		return nil, 
	}
	switch  {
	case InputQuickReplyShortcutTypeID:
		// Decoding inputQuickReplyShortcut#24596d41.
		 := InputQuickReplyShortcut{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputQuickReplyShortcutClass: %w", )
		}
		return &, nil
	case InputQuickReplyShortcutIDTypeID:
		// Decoding inputQuickReplyShortcutId#1190cf1.
		 := InputQuickReplyShortcutID{}
		if  := .Decode();  != nil {
			return nil, fmt.Errorf("unable to decode InputQuickReplyShortcutClass: %w", )
		}
		return &, nil
	default:
		return nil, fmt.Errorf("unable to decode InputQuickReplyShortcutClass: %w", bin.NewUnexpectedID())
	}
}

// InputQuickReplyShortcut boxes the InputQuickReplyShortcutClass providing a helper.
type InputQuickReplyShortcutBox struct {
	InputQuickReplyShortcut InputQuickReplyShortcutClass
}

// Decode implements bin.Decoder for InputQuickReplyShortcutBox.
func ( *InputQuickReplyShortcutBox) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("unable to decode InputQuickReplyShortcutBox to nil")
	}
	,  := DecodeInputQuickReplyShortcut()
	if  != nil {
		return fmt.Errorf("unable to decode boxed value: %w", )
	}
	.InputQuickReplyShortcut = 
	return nil
}

// Encode implements bin.Encode for InputQuickReplyShortcutBox.
func ( *InputQuickReplyShortcutBox) ( *bin.Buffer) error {
	if  == nil || .InputQuickReplyShortcut == nil {
		return fmt.Errorf("unable to encode InputQuickReplyShortcutClass as nil")
	}
	return .InputQuickReplyShortcut.Encode()
}