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

// InputFileLocationClassArray is adapter for slice of InputFileLocationClass.
type InputFileLocationClassArray []InputFileLocationClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputFileLocation returns copy with only InputFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputFileLocationArray) {
	for ,  := range  {
		,  := .(*InputFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputEncryptedFileLocation returns copy with only InputEncryptedFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputEncryptedFileLocationArray) {
	for ,  := range  {
		,  := .(*InputEncryptedFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputDocumentFileLocation returns copy with only InputDocumentFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputDocumentFileLocationArray) {
	for ,  := range  {
		,  := .(*InputDocumentFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputSecureFileLocation returns copy with only InputSecureFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputSecureFileLocationArray) {
	for ,  := range  {
		,  := .(*InputSecureFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPhotoFileLocation returns copy with only InputPhotoFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputPhotoFileLocationArray) {
	for ,  := range  {
		,  := .(*InputPhotoFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPhotoLegacyFileLocation returns copy with only InputPhotoLegacyFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputPhotoLegacyFileLocationArray) {
	for ,  := range  {
		,  := .(*InputPhotoLegacyFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPeerPhotoFileLocation returns copy with only InputPeerPhotoFileLocation constructors.
func ( InputFileLocationClassArray) () ( InputPeerPhotoFileLocationArray) {
	for ,  := range  {
		,  := .(*InputPeerPhotoFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStickerSetThumb returns copy with only InputStickerSetThumb constructors.
func ( InputFileLocationClassArray) () ( InputStickerSetThumbArray) {
	for ,  := range  {
		,  := .(*InputStickerSetThumb)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputGroupCallStream returns copy with only InputGroupCallStream constructors.
func ( InputFileLocationClassArray) () ( InputGroupCallStreamArray) {
	for ,  := range  {
		,  := .(*InputGroupCallStream)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputPeerPhotoFileLocationLegacy returns copy with only InputPeerPhotoFileLocationLegacy constructors.
func ( InputFileLocationClassArray) () ( InputPeerPhotoFileLocationLegacyArray) {
	for ,  := range  {
		,  := .(*InputPeerPhotoFileLocationLegacy)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputStickerSetThumbLegacy returns copy with only InputStickerSetThumbLegacy constructors.
func ( InputFileLocationClassArray) () ( InputStickerSetThumbLegacyArray) {
	for ,  := range  {
		,  := .(*InputStickerSetThumbLegacy)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputFileLocationArray is adapter for slice of InputFileLocation.
type InputFileLocationArray []InputFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputEncryptedFileLocationArray is adapter for slice of InputEncryptedFileLocation.
type InputEncryptedFileLocationArray []InputEncryptedFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputEncryptedFileLocationArray) ( map[int64]InputEncryptedFileLocation) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputEncryptedFileLocationArray) () map[int64]InputEncryptedFileLocation {
	 := make(map[int64]InputEncryptedFileLocation, len())
	.FillMap()
	return 
}

// InputDocumentFileLocationArray is adapter for slice of InputDocumentFileLocation.
type InputDocumentFileLocationArray []InputDocumentFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputDocumentFileLocationArray) ( map[int64]InputDocumentFileLocation) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputDocumentFileLocationArray) () map[int64]InputDocumentFileLocation {
	 := make(map[int64]InputDocumentFileLocation, len())
	.FillMap()
	return 
}

// InputSecureFileLocationArray is adapter for slice of InputSecureFileLocation.
type InputSecureFileLocationArray []InputSecureFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputSecureFileLocationArray) ( map[int64]InputSecureFileLocation) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputSecureFileLocationArray) () map[int64]InputSecureFileLocation {
	 := make(map[int64]InputSecureFileLocation, len())
	.FillMap()
	return 
}

// InputPhotoFileLocationArray is adapter for slice of InputPhotoFileLocation.
type InputPhotoFileLocationArray []InputPhotoFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputPhotoFileLocationArray) ( map[int64]InputPhotoFileLocation) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputPhotoFileLocationArray) () map[int64]InputPhotoFileLocation {
	 := make(map[int64]InputPhotoFileLocation, len())
	.FillMap()
	return 
}

// InputPhotoLegacyFileLocationArray is adapter for slice of InputPhotoLegacyFileLocation.
type InputPhotoLegacyFileLocationArray []InputPhotoLegacyFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

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

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

// FillMap fills constructors to given map.
func ( InputPhotoLegacyFileLocationArray) ( map[int64]InputPhotoLegacyFileLocation) {
	for ,  := range  {
		[.GetID()] = 
	}
}

// ToMap collects constructors to map.
func ( InputPhotoLegacyFileLocationArray) () map[int64]InputPhotoLegacyFileLocation {
	 := make(map[int64]InputPhotoLegacyFileLocation, len())
	.FillMap()
	return 
}

// InputPeerPhotoFileLocationArray is adapter for slice of InputPeerPhotoFileLocation.
type InputPeerPhotoFileLocationArray []InputPeerPhotoFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStickerSetThumbArray is adapter for slice of InputStickerSetThumb.
type InputStickerSetThumbArray []InputStickerSetThumb

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputGroupCallStreamArray is adapter for slice of InputGroupCallStream.
type InputGroupCallStreamArray []InputGroupCallStream

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputPeerPhotoFileLocationLegacyArray is adapter for slice of InputPeerPhotoFileLocationLegacy.
type InputPeerPhotoFileLocationLegacyArray []InputPeerPhotoFileLocationLegacy

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputStickerSetThumbLegacyArray is adapter for slice of InputStickerSetThumbLegacy.
type InputStickerSetThumbLegacyArray []InputStickerSetThumbLegacy

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}