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

// InputMediaClassArray is adapter for slice of InputMediaClass.
type InputMediaClassArray []InputMediaClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputMediaUploadedPhoto returns copy with only InputMediaUploadedPhoto constructors.
func ( InputMediaClassArray) () ( InputMediaUploadedPhotoArray) {
	for ,  := range  {
		,  := .(*InputMediaUploadedPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaPhoto returns copy with only InputMediaPhoto constructors.
func ( InputMediaClassArray) () ( InputMediaPhotoArray) {
	for ,  := range  {
		,  := .(*InputMediaPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaGeoPoint returns copy with only InputMediaGeoPoint constructors.
func ( InputMediaClassArray) () ( InputMediaGeoPointArray) {
	for ,  := range  {
		,  := .(*InputMediaGeoPoint)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaContact returns copy with only InputMediaContact constructors.
func ( InputMediaClassArray) () ( InputMediaContactArray) {
	for ,  := range  {
		,  := .(*InputMediaContact)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaUploadedDocument returns copy with only InputMediaUploadedDocument constructors.
func ( InputMediaClassArray) () ( InputMediaUploadedDocumentArray) {
	for ,  := range  {
		,  := .(*InputMediaUploadedDocument)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaDocument returns copy with only InputMediaDocument constructors.
func ( InputMediaClassArray) () ( InputMediaDocumentArray) {
	for ,  := range  {
		,  := .(*InputMediaDocument)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaVenue returns copy with only InputMediaVenue constructors.
func ( InputMediaClassArray) () ( InputMediaVenueArray) {
	for ,  := range  {
		,  := .(*InputMediaVenue)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaPhotoExternal returns copy with only InputMediaPhotoExternal constructors.
func ( InputMediaClassArray) () ( InputMediaPhotoExternalArray) {
	for ,  := range  {
		,  := .(*InputMediaPhotoExternal)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaDocumentExternal returns copy with only InputMediaDocumentExternal constructors.
func ( InputMediaClassArray) () ( InputMediaDocumentExternalArray) {
	for ,  := range  {
		,  := .(*InputMediaDocumentExternal)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaGame returns copy with only InputMediaGame constructors.
func ( InputMediaClassArray) () ( InputMediaGameArray) {
	for ,  := range  {
		,  := .(*InputMediaGame)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaInvoice returns copy with only InputMediaInvoice constructors.
func ( InputMediaClassArray) () ( InputMediaInvoiceArray) {
	for ,  := range  {
		,  := .(*InputMediaInvoice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaGeoLive returns copy with only InputMediaGeoLive constructors.
func ( InputMediaClassArray) () ( InputMediaGeoLiveArray) {
	for ,  := range  {
		,  := .(*InputMediaGeoLive)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaPoll returns copy with only InputMediaPoll constructors.
func ( InputMediaClassArray) () ( InputMediaPollArray) {
	for ,  := range  {
		,  := .(*InputMediaPoll)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaDice returns copy with only InputMediaDice constructors.
func ( InputMediaClassArray) () ( InputMediaDiceArray) {
	for ,  := range  {
		,  := .(*InputMediaDice)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaStory returns copy with only InputMediaStory constructors.
func ( InputMediaClassArray) () ( InputMediaStoryArray) {
	for ,  := range  {
		,  := .(*InputMediaStory)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputMediaWebPage returns copy with only InputMediaWebPage constructors.
func ( InputMediaClassArray) () ( InputMediaWebPageArray) {
	for ,  := range  {
		,  := .(*InputMediaWebPage)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputMediaUploadedPhotoArray is adapter for slice of InputMediaUploadedPhoto.
type InputMediaUploadedPhotoArray []InputMediaUploadedPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaPhotoArray is adapter for slice of InputMediaPhoto.
type InputMediaPhotoArray []InputMediaPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaGeoPointArray is adapter for slice of InputMediaGeoPoint.
type InputMediaGeoPointArray []InputMediaGeoPoint

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaContactArray is adapter for slice of InputMediaContact.
type InputMediaContactArray []InputMediaContact

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaUploadedDocumentArray is adapter for slice of InputMediaUploadedDocument.
type InputMediaUploadedDocumentArray []InputMediaUploadedDocument

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaDocumentArray is adapter for slice of InputMediaDocument.
type InputMediaDocumentArray []InputMediaDocument

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaVenueArray is adapter for slice of InputMediaVenue.
type InputMediaVenueArray []InputMediaVenue

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaPhotoExternalArray is adapter for slice of InputMediaPhotoExternal.
type InputMediaPhotoExternalArray []InputMediaPhotoExternal

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaDocumentExternalArray is adapter for slice of InputMediaDocumentExternal.
type InputMediaDocumentExternalArray []InputMediaDocumentExternal

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaGameArray is adapter for slice of InputMediaGame.
type InputMediaGameArray []InputMediaGame

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaInvoiceArray is adapter for slice of InputMediaInvoice.
type InputMediaInvoiceArray []InputMediaInvoice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaGeoLiveArray is adapter for slice of InputMediaGeoLive.
type InputMediaGeoLiveArray []InputMediaGeoLive

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaPollArray is adapter for slice of InputMediaPoll.
type InputMediaPollArray []InputMediaPoll

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaDiceArray is adapter for slice of InputMediaDice.
type InputMediaDiceArray []InputMediaDice

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputMediaStoryArray is adapter for slice of InputMediaStory.
type InputMediaStoryArray []InputMediaStory

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// SortByID sorts slice of InputMediaStory by ID.
func ( InputMediaStoryArray) () InputMediaStoryArray {
	return .Sort(func(,  InputMediaStory) bool {
		return .GetID() < .GetID()
	})
}

// SortStableByID sorts slice of InputMediaStory by ID.
func ( InputMediaStoryArray) () InputMediaStoryArray {
	return .SortStable(func(,  InputMediaStory) bool {
		return .GetID() < .GetID()
	})
}

// FillMap fills constructors to given map.
func ( InputMediaStoryArray) ( map[int]InputMediaStory) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputMediaStoryArray) () map[int]InputMediaStory {
	 := make(map[int]InputMediaStory, len())
	.FillMap()
	return 
}

// InputMediaWebPageArray is adapter for slice of InputMediaWebPage.
type InputMediaWebPageArray []InputMediaWebPage

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}