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

// InputBotInlineResultClassArray is adapter for slice of InputBotInlineResultClass.
type InputBotInlineResultClassArray []InputBotInlineResultClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputBotInlineResult returns copy with only InputBotInlineResult constructors.
func ( InputBotInlineResultClassArray) () ( InputBotInlineResultArray) {
	for ,  := range  {
		,  := .(*InputBotInlineResult)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineResultPhoto returns copy with only InputBotInlineResultPhoto constructors.
func ( InputBotInlineResultClassArray) () ( InputBotInlineResultPhotoArray) {
	for ,  := range  {
		,  := .(*InputBotInlineResultPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineResultDocument returns copy with only InputBotInlineResultDocument constructors.
func ( InputBotInlineResultClassArray) () ( InputBotInlineResultDocumentArray) {
	for ,  := range  {
		,  := .(*InputBotInlineResultDocument)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputBotInlineResultGame returns copy with only InputBotInlineResultGame constructors.
func ( InputBotInlineResultClassArray) () ( InputBotInlineResultGameArray) {
	for ,  := range  {
		,  := .(*InputBotInlineResultGame)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputBotInlineResultArray is adapter for slice of InputBotInlineResult.
type InputBotInlineResultArray []InputBotInlineResult

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputBotInlineResultPhotoArray is adapter for slice of InputBotInlineResultPhoto.
type InputBotInlineResultPhotoArray []InputBotInlineResultPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputBotInlineResultDocumentArray is adapter for slice of InputBotInlineResultDocument.
type InputBotInlineResultDocumentArray []InputBotInlineResultDocument

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputBotInlineResultGameArray is adapter for slice of InputBotInlineResultGame.
type InputBotInlineResultGameArray []InputBotInlineResultGame

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}