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

// BotInlineResultClassArray is adapter for slice of BotInlineResultClass.
type BotInlineResultClassArray []BotInlineResultClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsBotInlineResult returns copy with only BotInlineResult constructors.
func ( BotInlineResultClassArray) () ( BotInlineResultArray) {
	for ,  := range  {
		,  := .(*BotInlineResult)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMediaResult returns copy with only BotInlineMediaResult constructors.
func ( BotInlineResultClassArray) () ( BotInlineMediaResultArray) {
	for ,  := range  {
		,  := .(*BotInlineMediaResult)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// BotInlineResultArray is adapter for slice of BotInlineResult.
type BotInlineResultArray []BotInlineResult

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMediaResultArray is adapter for slice of BotInlineMediaResult.
type BotInlineMediaResultArray []BotInlineMediaResult

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}