//go:build !no_gotd_slices
// +build !no_gotd_slices

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

// ReplyMarkupClassArray is adapter for slice of ReplyMarkupClass.
type ReplyMarkupClassArray []ReplyMarkupClass

// Sort sorts slice of ReplyMarkupClass.
func ( ReplyMarkupClassArray) ( func(,  ReplyMarkupClass) bool) ReplyMarkupClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ReplyMarkupClass.
func ( ReplyMarkupClassArray) ( func(,  ReplyMarkupClass) bool) ReplyMarkupClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ReplyMarkupClass.
func ( ReplyMarkupClassArray) ( func( ReplyMarkupClass) bool) ReplyMarkupClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ReplyMarkupClassArray) () ( ReplyMarkupClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ReplyMarkupClassArray) () ( ReplyMarkupClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ReplyMarkupClassArray) () ( ReplyMarkupClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ReplyMarkupClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ReplyMarkupClassArray) () ( ReplyMarkupClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsReplyKeyboardHide returns copy with only ReplyKeyboardHide constructors.
func ( ReplyMarkupClassArray) () ( ReplyKeyboardHideArray) {
	for ,  := range  {
		,  := .(*ReplyKeyboardHide)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsReplyKeyboardForceReply returns copy with only ReplyKeyboardForceReply constructors.
func ( ReplyMarkupClassArray) () ( ReplyKeyboardForceReplyArray) {
	for ,  := range  {
		,  := .(*ReplyKeyboardForceReply)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsReplyKeyboardMarkup returns copy with only ReplyKeyboardMarkup constructors.
func ( ReplyMarkupClassArray) () ( ReplyKeyboardMarkupArray) {
	for ,  := range  {
		,  := .(*ReplyKeyboardMarkup)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsReplyInlineMarkup returns copy with only ReplyInlineMarkup constructors.
func ( ReplyMarkupClassArray) () ( ReplyInlineMarkupArray) {
	for ,  := range  {
		,  := .(*ReplyInlineMarkup)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// ReplyKeyboardHideArray is adapter for slice of ReplyKeyboardHide.
type ReplyKeyboardHideArray []ReplyKeyboardHide

// Sort sorts slice of ReplyKeyboardHide.
func ( ReplyKeyboardHideArray) ( func(,  ReplyKeyboardHide) bool) ReplyKeyboardHideArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ReplyKeyboardHide.
func ( ReplyKeyboardHideArray) ( func(,  ReplyKeyboardHide) bool) ReplyKeyboardHideArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ReplyKeyboardHide.
func ( ReplyKeyboardHideArray) ( func( ReplyKeyboardHide) bool) ReplyKeyboardHideArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ReplyKeyboardHideArray) () ( ReplyKeyboardHide,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ReplyKeyboardHideArray) () ( ReplyKeyboardHide,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ReplyKeyboardHideArray) () ( ReplyKeyboardHide,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ReplyKeyboardHide
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ReplyKeyboardHideArray) () ( ReplyKeyboardHide,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// ReplyKeyboardForceReplyArray is adapter for slice of ReplyKeyboardForceReply.
type ReplyKeyboardForceReplyArray []ReplyKeyboardForceReply

// Sort sorts slice of ReplyKeyboardForceReply.
func ( ReplyKeyboardForceReplyArray) ( func(,  ReplyKeyboardForceReply) bool) ReplyKeyboardForceReplyArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ReplyKeyboardForceReply.
func ( ReplyKeyboardForceReplyArray) ( func(,  ReplyKeyboardForceReply) bool) ReplyKeyboardForceReplyArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ReplyKeyboardForceReply.
func ( ReplyKeyboardForceReplyArray) ( func( ReplyKeyboardForceReply) bool) ReplyKeyboardForceReplyArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ReplyKeyboardForceReplyArray) () ( ReplyKeyboardForceReply,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ReplyKeyboardForceReplyArray) () ( ReplyKeyboardForceReply,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ReplyKeyboardForceReplyArray) () ( ReplyKeyboardForceReply,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ReplyKeyboardForceReply
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ReplyKeyboardForceReplyArray) () ( ReplyKeyboardForceReply,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// ReplyKeyboardMarkupArray is adapter for slice of ReplyKeyboardMarkup.
type ReplyKeyboardMarkupArray []ReplyKeyboardMarkup

// Sort sorts slice of ReplyKeyboardMarkup.
func ( ReplyKeyboardMarkupArray) ( func(,  ReplyKeyboardMarkup) bool) ReplyKeyboardMarkupArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ReplyKeyboardMarkup.
func ( ReplyKeyboardMarkupArray) ( func(,  ReplyKeyboardMarkup) bool) ReplyKeyboardMarkupArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ReplyKeyboardMarkup.
func ( ReplyKeyboardMarkupArray) ( func( ReplyKeyboardMarkup) bool) ReplyKeyboardMarkupArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ReplyKeyboardMarkupArray) () ( ReplyKeyboardMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ReplyKeyboardMarkupArray) () ( ReplyKeyboardMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ReplyKeyboardMarkupArray) () ( ReplyKeyboardMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ReplyKeyboardMarkup
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ReplyKeyboardMarkupArray) () ( ReplyKeyboardMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// ReplyInlineMarkupArray is adapter for slice of ReplyInlineMarkup.
type ReplyInlineMarkupArray []ReplyInlineMarkup

// Sort sorts slice of ReplyInlineMarkup.
func ( ReplyInlineMarkupArray) ( func(,  ReplyInlineMarkup) bool) ReplyInlineMarkupArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of ReplyInlineMarkup.
func ( ReplyInlineMarkupArray) ( func(,  ReplyInlineMarkup) bool) ReplyInlineMarkupArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of ReplyInlineMarkup.
func ( ReplyInlineMarkupArray) ( func( ReplyInlineMarkup) bool) ReplyInlineMarkupArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( ReplyInlineMarkupArray) () ( ReplyInlineMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( ReplyInlineMarkupArray) () ( ReplyInlineMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *ReplyInlineMarkupArray) () ( ReplyInlineMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  ReplyInlineMarkup
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *ReplyInlineMarkupArray) () ( ReplyInlineMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}