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

// AttachMenuBotsClassArray is adapter for slice of AttachMenuBotsClass.
type AttachMenuBotsClassArray []AttachMenuBotsClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsAttachMenuBots returns copy with only AttachMenuBots constructors.
func ( AttachMenuBotsClassArray) () ( AttachMenuBotsArray) {
	for ,  := range  {
		,  := .(*AttachMenuBots)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AppendOnlyModified appends only Modified constructors to
// given slice.
func ( AttachMenuBotsClassArray) ( []*AttachMenuBots) []*AttachMenuBots {
	for ,  := range  {
		,  := .AsModified()
		if ! {
			continue
		}
		 = append(, )
	}

	return 
}

// AsModified returns copy with only Modified constructors.
func ( AttachMenuBotsClassArray) () ( []*AttachMenuBots) {
	return .AppendOnlyModified()
}

// FirstAsModified returns first element of slice (if exists).
func ( AttachMenuBotsClassArray) () ( *AttachMenuBots,  bool) {
	,  := .First()
	if ! {
		return
	}
	return .AsModified()
}

// LastAsModified returns last element of slice (if exists).
func ( AttachMenuBotsClassArray) () ( *AttachMenuBots,  bool) {
	,  := .Last()
	if ! {
		return
	}
	return .AsModified()
}

// PopFirstAsModified returns element of slice (if exists).
func ( *AttachMenuBotsClassArray) () ( *AttachMenuBots,  bool) {
	,  := .PopFirst()
	if ! {
		return
	}
	return .AsModified()
}

// PopAsModified returns element of slice (if exists).
func ( *AttachMenuBotsClassArray) () ( *AttachMenuBots,  bool) {
	,  := .Pop()
	if ! {
		return
	}
	return .AsModified()
}

// AttachMenuBotsArray is adapter for slice of AttachMenuBots.
type AttachMenuBotsArray []AttachMenuBots

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}