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

// InputWebFileLocationClassArray is adapter for slice of InputWebFileLocationClass.
type InputWebFileLocationClassArray []InputWebFileLocationClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputWebFileLocation returns copy with only InputWebFileLocation constructors.
func ( InputWebFileLocationClassArray) () ( InputWebFileLocationArray) {
	for ,  := range  {
		,  := .(*InputWebFileLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputWebFileGeoPointLocation returns copy with only InputWebFileGeoPointLocation constructors.
func ( InputWebFileLocationClassArray) () ( InputWebFileGeoPointLocationArray) {
	for ,  := range  {
		,  := .(*InputWebFileGeoPointLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputWebFileAudioAlbumThumbLocation returns copy with only InputWebFileAudioAlbumThumbLocation constructors.
func ( InputWebFileLocationClassArray) () ( InputWebFileAudioAlbumThumbLocationArray) {
	for ,  := range  {
		,  := .(*InputWebFileAudioAlbumThumbLocation)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputWebFileLocationArray is adapter for slice of InputWebFileLocation.
type InputWebFileLocationArray []InputWebFileLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputWebFileGeoPointLocationArray is adapter for slice of InputWebFileGeoPointLocation.
type InputWebFileGeoPointLocationArray []InputWebFileGeoPointLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputWebFileAudioAlbumThumbLocationArray is adapter for slice of InputWebFileAudioAlbumThumbLocation.
type InputWebFileAudioAlbumThumbLocationArray []InputWebFileAudioAlbumThumbLocation

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}