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

// InputChatPhotoClassArray is adapter for slice of InputChatPhotoClass.
type InputChatPhotoClassArray []InputChatPhotoClass

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// AsInputChatUploadedPhoto returns copy with only InputChatUploadedPhoto constructors.
func ( InputChatPhotoClassArray) () ( InputChatUploadedPhotoArray) {
	for ,  := range  {
		,  := .(*InputChatUploadedPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsInputChatPhoto returns copy with only InputChatPhoto constructors.
func ( InputChatPhotoClassArray) () ( InputChatPhotoArray) {
	for ,  := range  {
		,  := .(*InputChatPhoto)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// InputChatUploadedPhotoArray is adapter for slice of InputChatUploadedPhoto.
type InputChatUploadedPhotoArray []InputChatUploadedPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}

// InputChatPhotoArray is adapter for slice of InputChatPhoto.
type InputChatPhotoArray []InputChatPhoto

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

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

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

	return 
}

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

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

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

	 := *
	 = [0]

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

	return , true
}

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

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

	return , true
}