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

// BotInlineMessageClassArray is adapter for slice of BotInlineMessageClass.
type BotInlineMessageClassArray []BotInlineMessageClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsBotInlineMessageMediaAuto returns copy with only BotInlineMessageMediaAuto constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaAutoArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaAuto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageText returns copy with only BotInlineMessageText constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageTextArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageText)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageMediaGeo returns copy with only BotInlineMessageMediaGeo constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaGeoArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaGeo)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageMediaVenue returns copy with only BotInlineMessageMediaVenue constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaVenueArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageMediaContact returns copy with only BotInlineMessageMediaContact constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaContactArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaContact)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageMediaInvoice returns copy with only BotInlineMessageMediaInvoice constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaInvoiceArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaInvoice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsBotInlineMessageMediaWebPage returns copy with only BotInlineMessageMediaWebPage constructors.
func ( BotInlineMessageClassArray) () ( BotInlineMessageMediaWebPageArray) {
	for ,  := range  {
		,  := .(*BotInlineMessageMediaWebPage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// BotInlineMessageMediaAutoArray is adapter for slice of BotInlineMessageMediaAuto.
type BotInlineMessageMediaAutoArray []BotInlineMessageMediaAuto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageTextArray is adapter for slice of BotInlineMessageText.
type BotInlineMessageTextArray []BotInlineMessageText

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageMediaGeoArray is adapter for slice of BotInlineMessageMediaGeo.
type BotInlineMessageMediaGeoArray []BotInlineMessageMediaGeo

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageMediaVenueArray is adapter for slice of BotInlineMessageMediaVenue.
type BotInlineMessageMediaVenueArray []BotInlineMessageMediaVenue

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageMediaContactArray is adapter for slice of BotInlineMessageMediaContact.
type BotInlineMessageMediaContactArray []BotInlineMessageMediaContact

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageMediaInvoiceArray is adapter for slice of BotInlineMessageMediaInvoice.
type BotInlineMessageMediaInvoiceArray []BotInlineMessageMediaInvoice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// BotInlineMessageMediaWebPageArray is adapter for slice of BotInlineMessageMediaWebPage.
type BotInlineMessageMediaWebPageArray []BotInlineMessageMediaWebPage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}